/*
 * Montserrat and Lora, self-hosted as variable fonts (instead of Google Fonts).
 * Each file covers the full weight range actually used on that axis.
 */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/montserrat-variable-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Lora';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/lora-variable-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Lora';
    font-style: italic;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/lora-variable-italic-latin.woff2') format('woff2');
}

body {
    margin: 0;
}

/* ==========================================================================
   DESIGN SYSTEM TOKENS
   ========================================================================== */
#iic-app {
    /* --- A&PP corporate identity -------------------- */
    --cd-white: #ffffff; /* CMYK 0 0 0 0 */
    --cd-offwhite: #f9f6f1; /* CMYK 3 4 7 0 */
    --cd-yellow: #ebde0a; /* CMYK 13 3 93 0 — fills, buttons, brand bar */
    --cd-yellow-neon: #ffff00; /* CMYK 10 0 95 0 — highlight on dark grey */
    --cd-grey: #363635; /* CMYK 0 0 0 92 — text and dark surfaces */

    /* --- Derived surfaces ---------------------------------------------------- */
    --ink: var(--cd-grey);
    --ink-raised: #434342;
    --ink-line: #55554F;
    --paper: var(--cd-offwhite);
    --surface: var(--cd-white);
    --line: #E4DFD5;
    --line-strong: #C4BEB1;
    --text: var(--cd-grey);
    --text-muted: #6E6E6B;
    --text-on-ink: #F4F2ED;
    --text-on-ink-mut: #ADADA6;
    --accent: var(--cd-yellow);
    --accent-strong: var(--cd-grey); /* accent text: yellow is not legible on white */
    --accent-on-ink: var(--cd-yellow-neon);
    --accent-tint: #FDFBE6;
    --sel-tint: var(--cd-offwhite);
    --success: #2F6B4F;
    --error: #B02525;
    --error-tint: #FCF3F1;

    /* --- Typography  ---------------------------------- */
    /* Gotham requires a license and isn't freely available on the web — once a
       webfont license exists, prepend "Gotham Regular" here. Montserrat is the
       geometric substitute in the meantime. */
    --font-display: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    /* Accent typeface: Lora — used for questions, subheadings and emphasis. */
    --font-accent: "Lora", Georgia, "Times New Roman", serif;
    --w-reg: 400;
    --w-med: 500;

    /* --- Radii, shadows, grid ------------------------------------------------ */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-pill: 999px;
    --shadow-card: 0 1px 2px rgba(54, 54, 53, .05), 0 8px 24px rgba(54, 54, 53, .06);
    --shadow-lift: 0 2px 4px rgba(54, 54, 53, .07), 0 14px 34px rgba(54, 54, 53, .1);
    --rail-w: 336px;
    --stage-max: 760px;
    --dur: 240ms;
    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ==========================================================================
   BASE
   ========================================================================== */
#iic-app, #iic-app *, #iic-app *::before, #iic-app *::after {
    box-sizing: border-box;
}

#iic-app {
    background: var(--paper);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: var(--w-reg);
    line-height: 1.6;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
}

#iic-app h1, #iic-app h2, #iic-app h3, #iic-app h4 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: var(--w-reg);
    letter-spacing: -.004em;
    line-height: 1.2;
}

#iic-app p {
    margin: 0;
}

#iic-app button {
    font: inherit;
    color: inherit;
}

/*
 * Focus rings only appear for keyboard use. The .kbd class is set via JS as soon as Tab
 * is pressed — the UI stays quiet on mouse clicks.
 */
#iic-app :focus-visible {
    outline: none;
}

html.kbd #iic-app :focus-visible {
    outline: 2px solid var(--cd-grey);
    outline-offset: 3px;
    border-radius: 3px;
}

html.kbd #iic-app .rail :focus-visible {
    outline-color: var(--accent-on-ink);
}

/* Headings only receive focus programmatically, never visibly */
#iic-app h1, #iic-app h2, #iic-app h3, #iic-app h4 {
    outline: none !important;
}

#iic-app .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   BASE LAYOUT — mobile: dark header above the content
                 from 1024px: dark navigation column on the left
   ========================================================================== */
#iic-app .app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#iic-app .rail {
    background: var(--ink);
    color: var(--text-on-ink);
    position: relative;
}

#iic-app .rail__inner {
    padding: 18px 20px 22px;
    max-width: var(--stage-max);
    margin: 0 auto;
}

#iic-app .brandbar {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: space-between;
}

#iic-app .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

/*
 * Logo: inlined so its colors can be controlled per background. On a dark background the
 * grey wordmark turns white while the CI yellow stays.
 */
#iic-app .brandlogo {
    height: 52px;
    width: auto;
    display: block;
}

#iic-app .brandlogo .lg-dark {
    fill: #fff;
}

#iic-app .brandlogo .lg-y1, #iic-app .brandlogo .lg-y2 {
    fill: var(--cd-yellow);
}

#iic-app .brandbar__tools {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* From desktop width, "Save progress" sits top-right above the stage */
@media (min-width: 1024px) {
    #iic-app .brandbar__tools {
        position: fixed;
        top: 24px;
        right: 32px;
        z-index: 40;
    }
}

#iic-app .ghost {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: 1px solid var(--ink-line);
    color: var(--text-on-ink);
    padding: 7px 13px;
    border-radius: var(--r-pill);
    font-size: 13.5px;
    font-weight: var(--w-reg);
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

#iic-app .ghost:hover {
    border-color: var(--cd-yellow-neon);
    background: rgba(255, 255, 0, .1);
}

#iic-app .ghost svg {
    width: 14px;
    height: 14px;
    flex: none;
}

/* Save button — prominent treatment */
#iic-app .ghost--save {
    background: var(--cd-yellow-neon);
    border-color: var(--cd-yellow-neon);
    color: var(--cd-grey);
    font-weight: var(--w-med);
    font-size: 14px;
    padding: 11px 20px;
    letter-spacing: .02em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 8px 20px rgba(255, 255, 0, .22);
}

#iic-app .ghost--save:hover {
    background: var(--cd-yellow);
    border-color: var(--cd-yellow);
    color: var(--cd-grey);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, .22), 0 14px 28px rgba(255, 255, 0, .3);
}

#iic-app .ghost--save svg {
    width: 16px;
    height: 16px;
}

#iic-app .rail__title {
    margin-top: 22px;
    font-size: clamp(20px, 4.4vw, 25px);
    color: #fff;
    text-transform: uppercase;
    font-weight: var(--w-med);
    letter-spacing: .045em;
    line-height: 1.32;
}

#iic-app .rail__title em {
    font-family: var(--font-accent);
    font-style: italic;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    font-size: 1.16em;
    color: var(--cd-yellow-neon);
}

/* Progress: segmented bar on mobile */
#iic-app .segbar {
    display: flex;
    gap: 5px;
    margin-top: 18px;
}

html.kbd #iic-app .segbar button:focus-visible {
    outline: 2px solid var(--cd-yellow-neon);
    outline-offset: 4px;
}

#iic-app .segbar button {
    height: 5px;
    flex: 1;
    background: var(--ink-line);
    border-radius: 0;
    overflow: hidden;
    border: 0;
    padding: 0;
    cursor: default;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

/* Larger hit area without visually thickening the bar */
#iic-app .segbar button::after {
    content: "";
    position: absolute;
    inset: -11px -2px;
}

#iic-app .segbar button.is-done, #iic-app .segbar button.is-current {
    cursor: pointer;
}

#iic-app .segbar button.is-done:active i {
    opacity: .6;
}

#iic-app .segbar button i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--cd-yellow-neon);
    transition: width var(--dur) var(--ease);
}

#iic-app .segbar button.is-done i {
    width: 100%;
}

#iic-app .segbar button.is-current i {
    width: 100%;
    opacity: .55;
}

#iic-app .steplabel {
    margin-top: 11px;
    font-size: 13.5px;
    color: var(--text-on-ink-mut);
    display: flex;
    gap: 8px;
    align-items: baseline;
}

#iic-app .steplabel b {
    color: var(--text-on-ink);
    font-weight: var(--w-med);
}

/* Progress: vertical list on desktop */
#iic-app .steplist {
    display: none;
    list-style: none;
    padding: 0;
    margin: 30px 0 0;
}

#iic-app .steplist li {
    position: relative;
    padding: 0 0 0 40px;
    min-height: 42px;
}

#iic-app .steplist li + li {
    margin-top: 2px;
}

#iic-app .steplist li::before {
    /* connecting line to the next point */
    content: "";
    position: absolute;
    left: 13px;
    top: 26px;
    bottom: -2px;
    width: 2px;
    background: var(--ink-line);
    transition: background var(--dur) var(--ease);
}

/* Done: checkmark and line below turn light yellow — shows progress */
#iic-app .steplist li.is-done::before {
    background: var(--cd-yellow-neon);
}

#iic-app .steplist li:last-child::before {
    display: none;
}

#iic-app .steplist__btn {
    display: block;
    background: none;
    border: 0;
    padding: 5px 0;
    width: 100%;
    text-align: left;
    color: var(--text-on-ink-mut);
    font-size: 14.5px;
    cursor: default;
}

#iic-app .steplist__num svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    stroke: none;
    display: none;
}

#iic-app .steplist li.is-done .steplist__num span {
    display: none;
}

#iic-app .steplist li.is-done .steplist__num svg {
    display: block;
}

#iic-app .steplist__num {
    position: absolute;
    left: 0;
    top: 6px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    pointer-events: none;
    border: 1px solid var(--ink-line);
    display: grid;
    place-items: center;
    font-size: 12.5px;
    font-weight: var(--w-reg);
    color: var(--text-on-ink-mut);
    background: var(--ink);
    transition: all var(--dur) var(--ease);
}

#iic-app .steplist li.is-done .steplist__num {
    border-color: var(--cd-yellow-neon);
    color: var(--cd-yellow-neon);
}

/* The whole row, including the number/checkmark, is the click target */
#iic-app .steplist li.is-done {
    cursor: pointer;
}

#iic-app .steplist li.is-done .steplist__btn {
    color: var(--text-on-ink);
    cursor: pointer;
}

#iic-app .steplist li.is-done:hover .steplist__btn {
    color: var(--cd-yellow-neon);
}

#iic-app .steplist li.is-done:hover .steplist__num {
    background: var(--cd-yellow-neon);
    color: var(--cd-grey);
}

#iic-app .steplist li.is-current .steplist__num {
    border-color: var(--cd-yellow-neon);
    background: var(--cd-yellow-neon);
    color: var(--cd-grey);
    font-weight: var(--w-med);
}

#iic-app .steplist li.is-current .steplist__btn {
    color: #fff;
    font-weight: var(--w-med);
}

#iic-app .rail__help {
    margin-top: auto;
    padding-top: 26px;
}

#iic-app .helpcard {
    border: 1px solid var(--ink-line);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--ink-raised);
}

#iic-app .helpcard__head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: none;
    border: 0;
    padding: 14px 16px;
    cursor: pointer;
    color: var(--text-on-ink);
    font-size: 14px;
    font-weight: var(--w-med);
    text-align: left;
}

#iic-app .helpcard__head .chev {
    transition: transform var(--dur) var(--ease);
    flex: none;
    width: 15px;
    height: 15px;
    color: var(--text-on-ink-mut);
}

#iic-app .helpcard__head[aria-expanded="true"] .chev {
    transform: rotate(180deg);
}

#iic-app .helpcard__body {
    padding: 0 16px 16px;
    font-size: 14px;
    color: var(--text-on-ink-mut);
    line-height: 1.65;
}

#iic-app .helpcard__body[hidden] {
    display: none;
}

#iic-app .helpcard__body a {
    color: var(--accent-on-ink);
    text-decoration: none;
    border-bottom: 1px solid rgba(214, 183, 107, .35);
}

#iic-app .helpcard__body a:hover {
    border-bottom-color: var(--accent-on-ink);
}

#iic-app .helpcard__body strong {
    color: var(--text-on-ink);
    font-weight: var(--w-med);
    display: block;
    margin-bottom: 2px;
}

#iic-app .rail__foot {
    margin-top: 20px;
    font-size: 12px;
    color: #6E747E;
    line-height: 1.6;
}

#iic-app .rail__foot a {
    color: #8A9099;
}

/* Stage */
#iic-app .stage {
    flex: 1;
    padding: 26px 20px 120px;
}

#iic-app .stage__inner {
    max-width: var(--stage-max);
    margin: 0 auto;
}

@media (min-width: 1024px) {
    #iic-app .app {
        flex-direction: row;
    }

    #iic-app .rail {
        width: var(--rail-w);
        flex: none;
        display: flex;
        flex-direction: column;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }

    #iic-app .rail__inner {
        padding: 30px 28px;
        max-width: none;
        display: flex;
        flex-direction: column;
        flex: 1;
    }

    #iic-app .rail__title {
        font-size: 24px;
        margin-top: 26px;
    }

    #iic-app .segbar, #iic-app .steplabel, #iic-app .progwrap {
        display: none;
    }

    #iic-app .mobilefoot {
        display: none;
    }

    #iic-app .steplist {
        display: block;
    }

    #iic-app .stage {
        padding: 56px 48px 80px;
        display: flex;
        align-items: flex-start;
    }

    #iic-app .stage__inner {
        width: 100%;
        max-width: var(--stage-max);
    }

    #iic-app .brandbar__tools .ghost--save span {
        display: inline;
    }

    #iic-app .stage {
        padding-top: 78px;
    }
}

/* ==========================================================================
   STEP PANEL
   ========================================================================== */
#iic-app .panel {
    display: none;
}

#iic-app .panel.is-active {
    display: block;
    animation: iic-enter var(--dur) var(--ease) both;
}

#iic-app .panel.is-active.is-back {
    animation-name: iic-enter-back;
}

@keyframes iic-enter {
    from {
        opacity: 0;
        transform: translateX(16px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes iic-enter-back {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

#iic-app .eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 11.5px;
    font-weight: var(--w-med);
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--cd-grey);
    padding-bottom: 5px;
    box-shadow: inset 0 -5px 0 var(--cd-yellow);
}

#iic-app .q {
    margin-top: 18px;
    font-size: clamp(23px, 4.6vw, 32px);
    max-width: 24ch;
    font-family: var(--font-accent);
    font-weight: 600;
    letter-spacing: -.004em;
    word-spacing: -.14em;
    line-height: 1.24;
}

#iic-app .q--wide {
    max-width: 34ch;
}

#iic-app .q-hint {
    margin-top: 11px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 14.5px;
    font-weight: var(--w-med);
    word-spacing: normal;
    letter-spacing: 0;
}

#iic-app fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

#iic-app legend {
    padding: 0;
}

/* Choice cards */
#iic-app .options {
    display: grid;
    gap: 11px;
    margin-top: 26px;
}

/* All boxes equal height, regardless of text length */
#iic-app .options--even {
    grid-auto-rows: 1fr;
}

#iic-app .options--even .card {
    height: 100%;
}

@media (min-width: 620px) {
    #iic-app .options--2, #iic-app .options--2col {
        grid-template-columns: 1fr 1fr;
    }
}

#iic-app .card {
    position: relative;
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 18px 18px 20px;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}

#iic-app .card:hover:not(:has(input:checked)) {
    border-color: var(--line-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lift);
}

/* Row 1: icon */
#iic-app .card__ico {
    display: block;
    font-size: 28px;
    line-height: 1.1;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* Selection mark, top right */
#iic-app .card__mark {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    display: grid;
    place-items: center;
    transition: all var(--dur) var(--ease);
}

#iic-app .card__mark svg {
    width: 15px;
    height: 15px;
    opacity: 0;
    transform: scale(.6);
    transition: all var(--dur) var(--ease);
    color: var(--cd-yellow);
    stroke-width: 2.8;
}

/* Row 2: answer text, spaced from the icon */
#iic-app .card__label {
    display: block;
    margin-top: 16px;
    padding-right: 14px;
    font-family: var(--font-body);
    font-size: 15.5px;
    font-weight: var(--w-med);
    line-height: 1.4;
}

html.kbd #iic-app .card input:focus-visible + .card__mark {
    outline: 2px solid var(--cd-grey);
    outline-offset: 3px;
}

#iic-app .card:has(input:checked) {
    border-color: var(--cd-yellow);
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--cd-yellow), var(--shadow-card);
}

#iic-app .card:has(input:checked) .card__mark {
    background: transparent;
    border-color: transparent;
}

#iic-app .card:has(input:checked) .card__ico {
    color: var(--cd-grey);
}

#iic-app .card:has(input:checked) .card__label {
    font-weight: var(--w-med);
}

/* Multi-select: square mark instead of round */
#iic-app .card__mark--box {
    border-radius: 5px;
}

#iic-app .card:has(input:checked) .card__mark svg {
    opacity: 1;
    transform: none;
}

/* Form fields */
#iic-app .group {
    margin-top: 30px;
}

#iic-app .group__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-family: var(--font-body);
    font-size: 11.5px;
    font-weight: var(--w-med);
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--cd-grey);
}

#iic-app .group__head::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

#iic-app .grid {
    display: grid;
    gap: 16px;
}

@media (min-width: 620px) {
    #iic-app .grid--2 {
        grid-template-columns: 1fr 1fr;
    }

    #iic-app .col-span-2 {
        grid-column: span 2;
    }
}

#iic-app .field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

#iic-app .field > label, #iic-app .field__label {
    font-size: 14px;
    font-weight: var(--w-med);
    color: var(--text);
}

#iic-app .req {
    color: var(--cd-grey);
    font-weight: var(--w-med);
}

#iic-app input[type="text"], #iic-app input[type="tel"], #iic-app input[type="email"], #iic-app select, #iic-app textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 13px 14px;
    font: inherit;
    font-size: 15.5px;
    color: var(--text);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

#iic-app select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23666C75' stroke-width='1.6'%3E%3Cpath d='M4 6.5 8 10.5 12 6.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 38px;
}

#iic-app textarea {
    min-height: 112px;
    resize: vertical;
    line-height: 1.6;
}

#iic-app input:hover, #iic-app select:hover, #iic-app textarea:hover {
    border-color: var(--line-strong);
}

#iic-app input:focus, #iic-app select:focus, #iic-app textarea:focus {
    outline: 0;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 17, 22, .1);
}

#iic-app .field--invalid input, #iic-app .field--invalid select, #iic-app .field--invalid textarea {
    border-color: var(--error);
    background: var(--error-tint);
}

#iic-app .field__error {
    display: none;
    font-size: 13.5px;
    color: var(--error);
    font-weight: var(--w-med);
    align-items: center;
    gap: 6px;
}

#iic-app .field--invalid .field__error {
    display: flex;
}

#iic-app .dob {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 9px;
}

/* Postal code narrow, city fills the rest — without narrowing the other columns */
#iic-app .addrrow {
    display: grid;
    gap: 16px;
}

@media (min-width: 620px) {
    #iic-app .addrrow {
        grid-template-columns: minmax(0, 110px) minmax(0, 1fr);
    }
}

/* Segmented control (salutation, yes/no) */
#iic-app .seg {
    display: inline-flex;
    flex-wrap: wrap;
    align-self: flex-start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    padding: 3px;
    gap: 3px;
    max-width: 100%;
}

#iic-app .seg label {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 20px;
    border-radius: var(--r-pill);
    font-size: 14.5px;
    font-weight: var(--w-med);
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--dur) var(--ease);
    white-space: nowrap;
}

#iic-app .seg--compact label {
    padding: 8px 15px;
    font-size: 14px;
}

/* Yes/no on the consent rows: very compact */
#iic-app .seg--mini {
    padding: 2px;
}

#iic-app .seg--mini label {
    padding: 4px 13px;
    font-size: 12.5px;
    font-weight: var(--w-med);
}

#iic-app .seg label:hover {
    color: var(--text);
}

#iic-app .seg label:has(input:checked) {
    background: var(--ink);
    color: #fff;
}

html.kbd #iic-app .seg input:focus-visible + span {
    outline: 2px solid var(--cd-grey);
    outline-offset: 5px;
    border-radius: var(--r-pill);
}

#iic-app .seg--invalid {
    border-color: var(--error);
    background: var(--error-tint);
}

/* ==========================================================================
   STEP 7 — legal text
   ========================================================================== */
/* Legal text — deliberately small and dense, doesn't fill whole screens */
#iic-app .legal {
    margin-top: 14px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    max-height: 280px;
    overflow-y: auto;
    overscroll-behavior: contain;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-muted);
}

#iic-app .legal::-webkit-scrollbar {
    width: 9px;
}

#iic-app .legal::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 5px;
}

#iic-app .legal p {
    margin: 0;
}

#iic-app .legal p + p, #iic-app .legal ol + p {
    margin-top: 7px;
}

#iic-app .legal__kicker {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: var(--w-med);
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--cd-grey);
}

#iic-app .legal__sub {
    font-size: 10.5px;
    font-weight: var(--w-med);
    color: var(--cd-grey);
}

#iic-app .legal__h {
    margin-top: 11px !important;
    font-weight: var(--w-med);
    color: var(--cd-grey);
    font-size: 11px;
}

#iic-app .legal__addr {
    background: var(--paper);
    border-left: 3px solid var(--cd-yellow);
    padding: 7px 9px;
    margin-top: 5px !important;
}

#iic-app .legal__ol {
    margin: 5px 0 0;
    padding-left: 15px;
}

#iic-app .legal__ol li + li {
    margin-top: 6px;
}

#iic-app .legal__consenthead {
    margin-top: 18px;
    font-family: var(--font-body);
    font-size: 11.5px;
    font-weight: var(--w-med);
    color: var(--cd-grey);
    display: block;
}

#iic-app .legal__consenthead span {
    font-weight: var(--w-reg);
    color: var(--text-muted);
}

#iic-app .consent {
    margin-top: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 13px 15px;
}

#iic-app .consent__num {
    font-family: var(--font-body);
    font-weight: var(--w-med);
    color: var(--cd-grey);
}

#iic-app .consent__text {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.55;
    color: var(--text-muted);
}

#iic-app .consent__text strong {
    color: var(--cd-grey);
    font-weight: var(--w-med);
}

#iic-app .consent__choice {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

#iic-app .closing {
    margin-top: 14px;
    font-size: 11px;
    line-height: 1.6;
    color: var(--text-muted);
    padding: 12px 15px;
    border-left: 4px solid var(--cd-yellow);
    background: var(--surface);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* ==========================================================================
   ACTION BAR
   ========================================================================== */
#iic-app .actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 34px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

#iic-app .actions__spacer {
    flex: 1;
}

#iic-app .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: var(--r-md);
    padding: 14px 28px;
    font-size: 15px;
    font-weight: var(--w-med);
    letter-spacing: .02em;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

#iic-app .btn svg {
    width: 16px;
    height: 16px;
    flex: none;
}

/* Submit button: bold, as a closing signal */
#iic-app #btnSubmit {
    font-weight: 700;
}

#iic-app .btn--primary {
    background: var(--cd-yellow-neon);
    color: var(--cd-grey);
    box-shadow: 0 1px 2px rgba(54, 54, 53, .14), 0 8px 20px rgba(255, 255, 0, .34);
}

#iic-app .btn--primary:hover {
    background: var(--cd-yellow);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(54, 54, 53, .16), 0 14px 28px rgba(255, 255, 0, .42);
}

#iic-app .btn--primary:active {
    transform: none;
}

#iic-app .btn--primary[disabled] {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#iic-app .btn--quiet {
    background: transparent;
    border-color: var(--line);
    color: var(--text-muted);
    font-weight: var(--w-reg);
}

#iic-app .btn--quiet:hover {
    border-color: var(--line-strong);
    color: var(--text);
}

#iic-app .btn.is-busy {
    pointer-events: none;
}

#iic-app .btn.is-busy .btn__spin {
    display: block;
}

#iic-app .btn__spin {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(54, 54, 53, .3);
    border-top-color: var(--cd-grey);
    border-radius: 50%;
    animation: iic-spin .7s linear infinite;
}

@keyframes iic-spin {
    to {
        transform: rotate(360deg);
    }
}

#iic-app .formerror {
    display: none;
    align-items: flex-start;
    gap: 10px;
    margin-top: 20px;
    padding: 14px 16px;
    background: var(--error-tint);
    border: 1px solid rgba(163, 43, 43, .25);
    border-radius: var(--r-sm);
    color: var(--error);
    font-size: 14.5px;
    font-weight: var(--w-reg);
    line-height: 1.5;
}

#iic-app .formerror.is-visible {
    display: flex;
}

#iic-app .formerror svg {
    width: 17px;
    height: 17px;
    flex: none;
    margin-top: 2px;
}

/* ==========================================================================
   COMPLETION / DIALOGS
   ========================================================================== */
#iic-app .done {
    text-align: center;
    padding: 20px 0 0;
}

#iic-app .done__seal {
    width: 66px;
    height: 66px;
    margin: 0 auto 22px;
    border-radius: 50%;
    background: var(--cd-yellow);
    border: 0;
    display: grid;
    place-items: center;
    color: var(--cd-grey);
}

#iic-app .done__seal svg {
    width: 26px;
    height: 26px;
}

#iic-app .done h2 {
    font-size: clamp(24px, 4.6vw, 30px);
    font-family: var(--font-accent);
    font-weight: 700;
    font-style: italic;
    letter-spacing: 0;
    color: var(--cd-grey);
    max-width: 26ch;
    margin: 0 auto;
}

#iic-app .done p {
    margin-top: 12px;
    color: var(--cd-grey);
    max-width: 48ch;
    margin-left: auto;
    margin-right: auto;
}

#iic-app .done__contact {
    margin-top: 28px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

/* Contact options: yellow outline, text in CI dark grey */
#iic-app .done__contact .btn {
    border-color: var(--cd-yellow);
    color: var(--cd-grey);
    font-weight: var(--w-med);
    box-shadow: 0 0 0 1px var(--cd-yellow);
    text-decoration: none;
}

#iic-app .done__contact .btn:hover {
    border-color: var(--cd-yellow-neon);
    box-shadow: 0 0 0 1px var(--cd-yellow-neon);
    color: var(--cd-grey);
    background: var(--surface);
}

#iic-app dialog {
    border: 0;
    padding: 0;
    border-radius: var(--r-lg);
    max-width: 440px;
    width: calc(100% - 32px);
    box-shadow: 0 24px 70px rgba(20, 23, 28, .3);
    background: var(--surface);
    color: var(--text);
}

#iic-app dialog::backdrop {
    background: rgba(20, 23, 28, .55);
    backdrop-filter: blur(2px);
}

#iic-app .modal {
    padding: 26px;
}

#iic-app .modal h3 {
    font-size: 21px;
}

#iic-app .modal p {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 15px;
}

#iic-app .modal__link {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 11px 13px;
    font-size: 13.5px;
    word-break: break-all;
    color: var(--text-muted);
}

#iic-app .modal__actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==========================================================================
   MOBILE (up to 1023px)
   ========================================================================== */
@media (max-width: 1023px) {
    #iic-app .rail__inner {
        padding: 14px 18px 0;
    }

    #iic-app .brandlogo {
        height: 40px;
    }

    /* Save: icon only on mobile, the label text would be too wide */
    #iic-app .ghost--save {
        padding: 9px 11px;
    }

    #iic-app .ghost--save span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    #iic-app .rail__title {
        margin-top: 16px;
        font-size: 23px;
        line-height: 1.28;
    }

    /* Progress strip stays visible while scrolling */
    #iic-app .progwrap {
        position: sticky;
        top: 0;
        z-index: 30;
        margin: 16px -18px 0;
        padding: 13px 18px 14px;
        background: var(--ink);
        box-shadow: 0 6px 16px rgba(14, 17, 22, .35);
    }

    #iic-app .segbar {
        margin-top: 0;
    }

    /* Only the bars are visible; the text line remains for screen readers */
    #iic-app .steplabel {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    /* Help and footer sit at the end of the page instead of in the dark header */
    #iic-app .rail__help {
        margin-top: 0;
        padding-top: 0;
    }

    #iic-app .mobilefoot {
        background: var(--ink);
        color: var(--text-on-ink);
        padding: 20px 18px 26px;
    }

    #iic-app .mobilefoot:empty {
        display: none;
    }

    #iic-app .mobilefoot .rail__foot {
        margin-top: 16px;
    }

    #iic-app .stage {
        padding: 22px 18px 40px;
    }

    #iic-app .card {
        padding: 15px 15px 17px;
    }

    #iic-app .card__label {
        margin-top: 13px;
        font-size: 15px;
    }

    #iic-app .card__ico {
        font-size: 26px;
        width: 30px;
        height: 30px;
    }

    #iic-app .card__mark {
        top: 13px;
        right: 13px;
    }

    #iic-app .options {
        gap: 9px;
        margin-top: 22px;
    }

    /* Lora needs more space between words on small displays */
    #iic-app .q {
        margin-top: 15px;
        word-spacing: .06em;
        letter-spacing: 0;
        line-height: 1.32;
    }

    #iic-app .group {
        margin-top: 24px;
    }

    #iic-app .grid {
        gap: 14px;
    }

    #iic-app input[type="text"], #iic-app input[type="tel"], #iic-app input[type="email"], #iic-app select, #iic-app textarea {
        font-size: 16px;
        padding: 12px 13px;
    }

    #iic-app .dob {
        gap: 6px;
    }

    #iic-app .dob select {
        padding: 12px 8px;
        background-position: right 7px center;
        padding-right: 26px;
        font-size: 15px;
    }

    #iic-app .seg--compact label {
        padding: 8px 13px;
        font-size: 13.5px;
    }

    #iic-app .legal {
        max-height: 210px;
        padding: 14px 15px;
    }

    /* Action bar flows inline, directly below the last input field */
    #iic-app .actions {
        margin-top: 26px;
        padding-top: 20px;
        gap: 10px;
    }

    #iic-app .actions .btn {
        padding: 14px 18px;
    }

    #iic-app .actions .btn--primary {
        flex: 1 1 auto;
    }

    #iic-app .actions .btn--quiet {
        flex: 0 0 auto;
    }

    #iic-app .actions__spacer {
        display: none;
    }

    #iic-app .done {
        padding-top: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #iic-app *, #iic-app *::before, #iic-app *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    #iic-app .panel.is-active {
        animation: none;
    }
}

/* ==========================================================================
   Cookie consent banner (TermsFeed / PrivacyPolicies.com)
   Overrides the bundled library styles: smaller & finer footprint, and
   the CI yellow (#ebde0a with dark text — yellow is not legible in white)
   in place of the library's green. The injected <style> tags load after
   this file, so key colours use !important and sizing raises specificity.
   ========================================================================== */

/* Smaller, more delicate shell.
   The banner root carries .privacypolicies-com---palette-light AND
   .privacypolicies-com---nb; chaining both out-specifies the library's
   single-class rules, which are injected after this file loads. */
.privacypolicies-com---palette-light.privacypolicies-com---nb {
    font-size: 14px;
}

.privacypolicies-com---palette-light.privacypolicies-com---nb-simple {
    max-width: 380px;
    box-shadow: 0 6px 24px rgba(54, 54, 53, .18);
    border: 1px solid #e0ddd3;
    border-radius: 8px;
    margin: 0 1rem 1rem 0;
}

.privacypolicies-com---palette-light.privacypolicies-com---nb .cc-nb-main-container {
    padding: 1.25rem 1.5rem;
}

.privacypolicies-com---palette-light.privacypolicies-com---nb .cc-nb-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 .5rem 0;
}

.privacypolicies-com---palette-light.privacypolicies-com---nb .cc-nb-text {
    font-size: 12.5px;
    line-height: 1.5;
    margin: 0 0 1rem 0;
}

/* Finer buttons */
.privacypolicies-com---palette-light.privacypolicies-com---nb .cc-nb-okagree,
.privacypolicies-com---palette-light.privacypolicies-com---nb .cc-nb-reject,
.privacypolicies-com---palette-light.privacypolicies-com---nb .cc-nb-changep {
    font-size: 12.5px;
    padding: .45rem .9rem;
    border-radius: 5px;
}

/* Green -> CI yellow, with dark text for legibility */
.privacypolicies-com---nb .cc-nb-okagree,
.privacypolicies-com---palette-light .cc-nb-okagree,
.privacypolicies-com---nb .cc-nb-reject,
.privacypolicies-com---palette-light .cc-nb-reject,
.privacypolicies-com---palette-light .cc-cp-foot-save {
    background-color: #ebde0a !important;
    color: #363635 !important;
}
