
/* ==========================================================
   /ui/css/base/ljh-forms.css
   LJH FORMS – Global Base
   ----------------------------------------------------------
   Ansvar:
   - Formulärstruktur och spacing
   - Input, textarea, select – styling
   - Form grid och layout
   - Form row (label + input i kolumn)
   - Checkbox / radio
   - Action bar
   ----------------------------------------------------------
   ÄGER ENDAST FORMULÄR – INTE LAYOUT
   Inga fasta bredder, inga layoutregler
========================================================== */


/* ==========================================================
   FORM ROOT
========================================================== */

.ljh-form {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    min-width: 0;
}


/* ==========================================================
   FORM FIELD
========================================================== */

.ljh-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

/* Lägg till detta istället: */
[hidden] {
    display: none !important;
}

.ljh-form-field.is-frozen {
    opacity: 0.5;
    pointer-events: none;
}


/* ==========================================================
   FORM SHELL – Visuellt skal, ingen layout
========================================================== */

.ljh-form-shell {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    padding: 1.8rem;
    border-radius: 20px;
}


/* ==========================================================
   FORM ROW – Label + input i kolumn
   (från ljh-banner.css)
========================================================== */

.ljh-form-row {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ljh-form-row label {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.85;
}

.ljh-form-row input,
.ljh-form-row textarea {
    padding: 12px 14px;
    font-size: 1rem;
    border-radius: 14px;
    background: rgba(255,255,255,0.85);
    color: #111;
    border: 1px solid rgba(0,0,0,0.12);
}

.ljh-form-row textarea {
    min-height: 180px;
    resize: vertical;
}

.ljh-form-row ::placeholder {
    color: rgba(0,0,0,0.45);
}


/* ==========================================================
   INPUTS – input, textarea, select
========================================================== */

.ljh-form input,
.ljh-form textarea,
.ljh-form select,
.ljh-input-text {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    line-height: 1.5;
    font-size: 0.95rem;
    font-family: inherit;
    background: linear-gradient(
        180deg,
        rgba(255,255,255,0.22),
        rgba(255,255,255,0.14)
    );
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(235,245,255,0.95);
    transition: border 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.ljh-form input:focus,
.ljh-form textarea:focus,
.ljh-form select:focus,
.ljh-input-text:focus {
    outline: none;
    border-color: rgba(120,180,255,0.6);
    box-shadow: 0 0 0 2px rgba(120,180,255,0.15);
}

.ljh-form input::placeholder,
.ljh-form textarea::placeholder,
.ljh-input-text::placeholder {
    color: rgba(180,210,255,0.4);
}


/* ==========================================================
   ACTION BAR
========================================================== */

.ljh-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 1.2rem;
}


/* ==========================================================
   CHECKBOX / RADIO
========================================================== */

.ljh-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.ljh-checkbox input {
    accent-color: var(--ljh-aqua);
}


/* ==========================================================
   FORM GRID
========================================================== */

.ljh-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.4rem;
}

.ljh-form-span-12 { grid-column: 1 / -1; }
.ljh-form-span-6  { grid-column: span 1; }

@media (max-width: 600px) {
    .ljh-form-grid   { grid-template-columns: 1fr; }
    .ljh-form-span-6 { grid-column: 1 / -1; }
}


/* ==========================================================
   FORM HINT – Hjälptext under fält
========================================================== */

.ljh-form-hint {
    font-size: 0.78rem;
    color: var(--ljh-text-muted);
    margin-top: 0.2rem;
    opacity: 0.85;
}


/* ==========================================================
   FORM LABEL – Globalt klassnamn (matchar .ljh-form-row label)
========================================================== */

.ljh-form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ljh-text-soft);
    opacity: 0.9;
}


/* ==========================================================
   RADIO – Matchar .ljh-checkbox-stilen
========================================================== */

.ljh-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--ljh-text-soft);
}

.ljh-radio input {
    accent-color: var(--ljh-aqua);
}


/* ==========================================================
   FORM GRID – Utökning med span-4 och span-8
========================================================== */

.ljh-form-grid.is-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.ljh-form-span-4 { grid-column: span 1; }
.ljh-form-span-8 { grid-column: span 2; }

@media (max-width: 600px) {
    .ljh-form-grid.is-cols-3 { grid-template-columns: 1fr; }
    .ljh-form-span-4 { grid-column: 1 / -1; }
    .ljh-form-span-8 { grid-column: 1 / -1; }
}


/* ==========================================================
   BUTTONS – Global Aqua-knapp
   ----------------------------------------------------------
   Användning:
     <button class="ljh-btn ljh-btn-primary">Spara</button>
     <button class="ljh-btn ljh-btn-secondary">Avbryt</button>
     <button class="ljh-btn ljh-btn-warning">Arkivera</button>
     <button class="ljh-btn ljh-btn-success">Aktivera</button>
     <button class="ljh-btn ljh-btn-danger">Ta bort</button>
   ----------------------------------------------------------
   Storlek:
     Standard
     .is-sm  – kompakt (för inline-actions)
     .is-lg  – stor (för primära CTA)
========================================================== */


/* ==========================================================
   BUTTON RESET – Minimalt, stör ej komponenter
========================================================== */

button {
    font: inherit;
    cursor: pointer;
}

.ljh-btn,
.news-type-pill {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    box-sizing: border-box;
}

.ljh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease,
                transform 0.12s ease, box-shadow 0.18s ease;
    user-select: none;
    background: transparent;
    color: var(--ljh-text);
}

.ljh-btn:hover    { transform: translateY(-1px); }
.ljh-btn:active   { transform: translateY(0); }
.ljh-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Sizes */
.ljh-btn.is-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.ljh-btn.is-lg { padding: 0.9rem 1.6rem; font-size: 1rem; }

/* PRIMARY – Aqua glow */
.ljh-btn-primary {
    background: linear-gradient(180deg, var(--ljh-aqua-light), var(--ljh-aqua));
    border-color: var(--ljh-aqua);
    color: #0b1220;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4),
                0 4px 12px rgba(96,165,250,0.25);
}

.ljh-btn-primary:hover {
    background: linear-gradient(180deg, var(--ljh-aqua), var(--ljh-aqua-light));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5),
                0 6px 16px rgba(96,165,250,0.4);
}

/* SECONDARY – Glas */
.ljh-btn-secondary {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.18);
    color: var(--ljh-text-soft);
}

.ljh-btn-secondary:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.3);
}

/* WARNING – Arkivera */
.ljh-btn-warning {
    background: rgba(251,146,60,0.12);
    border-color: rgba(251,146,60,0.4);
    color: #fb923c;
}

.ljh-btn-warning:hover {
    background: rgba(251,146,60,0.22);
    border-color: rgba(251,146,60,0.6);
}

/* SUCCESS – Aktivera */
.ljh-btn-success {
    background: rgba(74,222,128,0.12);
    border-color: rgba(74,222,128,0.4);
    color: #4ade80;
}

.ljh-btn-success:hover {
    background: rgba(74,222,128,0.22);
    border-color: rgba(74,222,128,0.6);
}

/* DANGER – Radera */
.ljh-btn-danger {
    background: rgba(248,113,113,0.12);
    border-color: rgba(248,113,113,0.4);
    color: #f87171;
}

.ljh-btn-danger:hover {
    background: rgba(248,113,113,0.22);
    border-color: rgba(248,113,113,0.6);
}


/* ==========================================================
   FIELDSET RESET – Ta bort webbläsarens inbyggda stil
========================================================== */

fieldset {
    border: none;
    padding: 0;
    margin: 0;
    min-width: 0;
}



