/* Shared styles for stepper-based wizard forms (Triage etc.).
   Page layout: .form-page > .form-layout > (.form-progress-mobile | .form-rail | .form-main) */

.form-page {
    /* Theme-aware highlight for selected/current items. Built on Ethos Light
       Green (#789D4A) rather than --mud-palette-secondary, because the dark
       palette maps Secondary to Dark Green (#07272D) which vanishes against
       the dark surface. Mixing over the surface keeps text readable in both themes. */
    --form-highlight-accent: #789D4A;
    --form-highlight: color-mix(in srgb, #789D4A 28%, var(--mud-palette-surface));
    background-color: var(--mud-palette-background);
    min-height: calc(100vh - 64px);
}

.form-card {
    background-color: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 16px;
}

.form-subtext {
    color: var(--mud-palette-text-secondary);
}

.form-callout {
    background-color: var(--form-highlight);
    border-left: 4px solid var(--form-highlight-accent);
    border-radius: 8px;
}

.form-radio-card,
.mud-radio.form-radio-card {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    padding: 8px 12px;
    margin: 0 8px 8px 0 !important;
}

.form-radio-card:has(input:checked) {
    border-color: var(--form-highlight-accent);
    background-color: var(--form-highlight);
}

.form-check-card {
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.form-check-card.selected {
    border-color: var(--form-highlight-accent);
    background-color: var(--form-highlight);
}

.form-dropzone {
    border: 2px dashed var(--mud-palette-lines-default);
    border-radius: 12px;
    cursor: pointer;
    background-color: var(--mud-palette-background);
}

.form-thumb {
    background-color: var(--mud-palette-background);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    height: 64px;
}

.form-support-card {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.form-support-card.selected {
    border-color: var(--form-highlight-accent);
    background-color: var(--form-highlight);
}

/* Terms: always visible, scrolls internally so the step buttons stay on screen */
.form-terms {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    background-color: var(--mud-palette-background);
}

.form-signature {
    border: 2px dashed var(--mud-palette-lines-default);
    border-radius: 12px;
    min-height: 120px;
}

/* Hide MudStepper's built-in nav — replaced by custom mobile blocks / desktop rail */
.form-stepper > .mud-stepper-nav {
    display: none !important;
}

.form-stepper > .mud-stepper-content {
    padding: 0;
}

/* Mobile progress blocks */
.form-progress-blocks {
    display: flex;
    gap: 6px;
}

.form-progress-block {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background-color: var(--mud-palette-lines-default);
}

.form-progress-block.done,
.form-progress-block.current {
    background-color: var(--form-highlight-accent);
}

/* Autosave indicator */
.form-autosave {
    color: var(--mud-palette-success);
}

.form-autosave-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--mud-palette-success);
    margin-right: 4px;
    vertical-align: 1px;
}

/* Desktop rail */
.form-rail {
    display: none;
}

.form-rail-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    color: var(--mud-palette-text-secondary);
}

.form-rail-step.current {
    background-color: var(--form-highlight);
    color: var(--mud-palette-text-primary);
    font-weight: 600;
}

.form-rail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 13px;
    border: 1px solid var(--mud-palette-lines-default);
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-secondary);
}

.form-rail-step.current .form-rail-icon {
    background-color: var(--form-highlight-accent);
    border-color: var(--form-highlight-accent);
    color: #FFFFFF;
}

.form-rail-step.done .form-rail-icon {
    background-color: var(--mud-palette-success);
    border-color: var(--mud-palette-success);
    color: #FFFFFF;
}

.form-rail-connector {
    width: 1px;
    height: 14px;
    margin-left: 26px;
    background-color: var(--mud-palette-lines-default);
}

/* Mobile: padded single column */
.form-layout {
    padding: 24px 16px;
}

@media (min-width: 960px) {
    .form-progress-mobile {
        display: none;
    }

    /* Rail pinned to the left edge of the screen, form content to its right */
    .form-layout {
        display: grid;
        grid-template-columns: 280px minmax(0, 1fr);
        align-items: stretch;
        padding: 0;
        min-height: calc(100vh - 64px);
    }

    .form-rail {
        display: flex;
        flex-direction: column;
        position: sticky;
        top: 64px;
        height: calc(100vh - 64px);
        padding: 16px 12px;
        background-color: var(--mud-palette-surface);
        border-right: 1px solid var(--mud-palette-lines-default);
    }

    .form-rail-footer {
        margin-top: auto;
    }

    .form-main {
        width: 100%;
        max-width: 900px;
        padding: 32px 48px;
    }
}

/* ---- Ethos Awards (/ethosawards): header card, one card per award, picked-name pill ---- */
.ea-hero { background: #07272D; color: #fff; border-radius: 16px; padding: 24px; margin-bottom: 16px; }
.ea-hero h1 { margin: 4px 0 8px; font-size: 1.9rem; line-height: 1.2; }
.ea-hero p { margin: 0 0 16px; opacity: .9; }
.ea-eyebrow { color: #789D4A; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; }
.ea-progress-label { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 8px; }
.ea-progress-label span:last-child { color: #789D4A; }
.ea-as { margin-top: 12px; font-size: .85rem; opacity: .85; }
.ea-card { background: var(--mud-palette-surface); border: 2px solid transparent; border-radius: 16px; padding: 20px; margin-bottom: 14px; }
.ea-card-done { border-color: #789D4A; }
.ea-card-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.ea-card-title { flex: 1; min-width: 0; }
.ea-card-title h2 { margin: 0; font-size: 1.2rem; }
.ea-card-title p { margin: 2px 0 0; color: var(--mud-palette-text-secondary); }
.ea-num { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
          background: color-mix(in srgb, #789D4A 25%, var(--mud-palette-surface)); }
.ea-done { flex: none; display: inline-flex; align-items: center; gap: 4px; background: #789D4A; color: #07272D; font-weight: 700; border-radius: 999px; padding: 4px 12px; }
.ea-pick { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ea-chip { display: inline-flex; align-items: center; gap: 10px; background: #07272D; color: #fff; font-weight: 700; border-radius: 999px; padding: 6px 18px 6px 6px; }
.ea-initials { width: 32px; height: 32px; border-radius: 50%; background: #789D4A; color: #07272D; display: grid; place-items: center; font-size: .8rem; }
@media (max-width: 600px) { .ea-hero { padding: 18px; } .ea-hero h1 { font-size: 1.5rem; } .ea-card { padding: 16px; } }
