/* =========================================================
   MyWealthCare — Apply Wizard CSS  v2.2
   Fully aligned with premium theme (common.css + business-home.css)

   Palette:
     Navy heading   #071b46
     Blue vivid     #2563eb  (primary action)
     Blue soft      #eff6ff
     Gold           #fbbf24
     Orange         #f97316
     Page bg        #f0f4f8
     Card bg        #ffffff / #f8fafc
     Muted text     #64748b
     Border         #e2e8f0
     Green          #16a34a
     Red            #ef4444

   Type scale (matches site):
     Page H2        clamp(22px, 2.8vw, 32px)
     Step H2        clamp(20px, 2.4vw, 28px)
     Body           14–15px
     Small          13px
     Micro          11–12px

   ⚠ REQUIRES the viewport meta tag inside <head>:
       <meta name="viewport" content="width=device-width, initial-scale=1.0">
     Without it the browser renders at desktop width and scales the
     page down, so NO media query below ever fires. Four option
     cards squeezed side by side on a phone is the signature of a
     missing viewport tag, not a CSS problem.

   CHANGELOG v2.1 → v2.2
   ─ Option cards stack to a single vertical column from 860px down
     (was two columns until 640px). Full-width rows are far easier
     to read and tap than squeezed tiles.

   CHANGELOG v2.0 → v2.1  (mobile only — no colour changes)
   ─ Inputs go to 16px at ≤860px. Below 16px, iOS Safari zooms the
     viewport on focus and leaves the page scrolled sideways.
   ─ Date input given explicit appearance/height for iOS.
   ─ :has() fallback via .mfc-selected for older browsers.
   ─ Action bar becomes sticky on mobile so Next stays reachable.
   ─ Landscape phone breakpoint added.
   ─ Long option labels wrap instead of overflowing.
   ─ 360px breakpoint; safe-area insets for notched iPhones.
========================================================= */

/* ─────────────────────────────────────────
   PAGE SHELL
───────────────────────────────────────── */
.mfc-wizard-page {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.65;
    color: #0a1628;
    background: #f0f4f8;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.mfc-wizard-page *, .mfc-wizard-page *::before, .mfc-wizard-page *::after {
    box-sizing: border-box;
}

.mfc-wizard-container {
    width: min(1080px, calc(100% - 40px));
    margin: 0 auto;
}

/* ─────────────────────────────────────────
   WIZARD SECTION WRAPPER
───────────────────────────────────────── */
.mfc-wizard-section {
    padding: 48px 0 72px;
}

/* ─────────────────────────────────────────
   TOP BAR  (title + back link)
───────────────────────────────────────── */
.mfc-wizard-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.mfc-wizard-top h2 {
    font-size: clamp(22px, 2.8vw, 30px);
    font-weight: 800;
    color: #071b46;
    margin: 0 0 6px;
    letter-spacing: -.4px;
    line-height: 1.2;
}

.mfc-selected-bank {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.mfc-selected-bank strong {
    color: #2563eb;
    font-weight: 700;
}

.mfc-back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
    white-space: nowrap;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1.5px solid #bfdbfe;
    background: #fff;
    transition: background .15s, border-color .15s;
    flex-shrink: 0;
}
.mfc-back-link:hover {
    background: #eff6ff;
    border-color: #2563eb;
}

/* ─────────────────────────────────────────
   STEP LABEL
───────────────────────────────────────── */
.mfc-step-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 10px;
}
.mfc-step-label strong {
    color: #2563eb;
    font-weight: 800;
}

/* ─────────────────────────────────────────
   PROGRESS BAR
───────────────────────────────────────── */
.mfc-progress {
    width: 100%;
    height: 10px;
    margin-bottom: 28px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.mfc-progress-fill {
    height: 100%;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    background: linear-gradient(90deg, #2563eb 0%, #fbbf24 100%);
    transition: width .3s ease;
    font-size: 9px;
    font-weight: 800;
    color: rgba(255,255,255,.9);
    letter-spacing: .02em;
    border-radius: 999px;
}

.mfc-progress-fill span {
    font-size: 9px;
}

/* ─────────────────────────────────────────
   ALERT / ERROR BANNER
───────────────────────────────────────── */
.mfc-alert {
    display: none;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    font-size: 13px;
    font-weight: 700;
}
.mfc-alert.show { display: block; }

.mfc-error-box {
    padding: 14px 18px;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* ─────────────────────────────────────────
   SUCCESS STATE
───────────────────────────────────────── */
.mfc-success-box {
    padding: 36px 32px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #bbf7d0;
    box-shadow: 0 4px 6px rgba(10,30,80,.04), 0 16px 40px rgba(10,30,80,.07);
    text-align: center;
}

.mfc-success-box h2 {
    font-size: 22px;
    font-weight: 800;
    color: #16a34a;
    margin: 0 0 10px;
}

.mfc-success-box p {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 24px;
    line-height: 1.65;
}

.mfc-success-box a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 22px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(37,99,235,.3);
    transition: transform .2s, box-shadow .2s;
}
.mfc-success-box a:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(37,99,235,.4);
}

/* ─────────────────────────────────────────
   STEP CARD
───────────────────────────────────────── */
.mfc-wizard-form { position: relative; }

.mfc-step {
    display: none;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 36px 36px 100px;
    box-shadow:
        0 2px 8px rgba(10,30,80,.04),
        0 16px 48px rgba(10,30,80,.09);
    min-height: 360px;
    position: relative;
}
.mfc-step.active { display: block; }

.mfc-step.active::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb 0%, #fbbf24 100%);
    border-radius: 22px 22px 0 0;
}

.mfc-step h2 {
    font-size: clamp(20px, 2.4vw, 26px);
    font-weight: 800;
    color: #071b46;
    margin: 0 0 28px;
    text-align: center;
    letter-spacing: -.4px;
    line-height: 1.2;
}

/* ─────────────────────────────────────────
   OPTION CARDS  (radio tile grid)
───────────────────────────────────────── */
.mfc-option-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}

.mfc-option-grid.two-options {
    grid-template-columns: repeat(2, minmax(140px, 200px));
    justify-content: center;
    gap: 16px;
}

/* city grid — 3 cols */
.city-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mfc-option-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 120px;
    padding: 18px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    cursor: pointer;
    text-align: center;
    transition: border-color .2s, box-shadow .2s, background .2s, transform .2s;
    -webkit-tap-highlight-color: transparent;
}

.mfc-option-card input[type=radio] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mfc-option-card:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37,99,235,.1);
}

/* selected state.
   .mfc-selected is a fallback for browsers without :has() support —
   toggle it in apply-wizard.js on change if you want the highlight
   to work there too. Harmless if the class is never set. */
.mfc-option-card:has(input:checked),
.mfc-option-card.mfc-selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12), 0 8px 20px rgba(37,99,235,.1);
}

.mfc-icon {
    width: 54px; height: 54px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    line-height: 1;
    transition: background .2s, transform .2s, border-color .2s;
    flex-shrink: 0;
}

.mfc-option-card:has(input:checked) .mfc-icon,
.mfc-option-card.mfc-selected .mfc-icon {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: transparent;
    transform: scale(1.06);
    box-shadow: 0 6px 16px rgba(37,99,235,.28);
    font-size: 24px;
}

.mfc-option-card strong {
    font-size: 13px;
    font-weight: 700;
    color: #071b46;
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* radio dot indicator */
.mfc-option-card strong::before {
    content: '';
    width: 13px; height: 13px;
    border-radius: 50%;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    flex-shrink: 0;
    transition: border-color .2s, background .2s;
}
.mfc-option-card:has(input:checked) strong::before,
.mfc-option-card.mfc-selected strong::before {
    border-color: #2563eb;
    background: radial-gradient(circle, #2563eb 40%, #fff 44%);
}

@keyframes mfcOptionAdvance {
    0%   { box-shadow: 0 0 0 3px rgba(37,99,235,.12), 0 8px 20px rgba(37,99,235,.1); }
    50%  { box-shadow: 0 0 0 6px rgba(37,99,235,.2), 0 8px 20px rgba(37,99,235,.15); }
    100% { box-shadow: 0 0 0 3px rgba(37,99,235,.12), 0 8px 20px rgba(37,99,235,.1); }
}
.mfc-option-card:has(input:checked),
.mfc-option-card.mfc-selected {
    animation: mfcOptionAdvance .5s ease;
}

/* ── City card variant — horizontal ── */
.city-card {
    flex-direction: row;
    justify-content: flex-start;
    min-height: auto;
    padding: 12px 14px;
    gap: 12px;
    text-align: left;
}

.city-card .mfc-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
    flex-shrink: 0;
}

.city-card:has(input:checked) .mfc-icon,
.city-card.mfc-selected .mfc-icon {
    font-size: 18px;
}

.mfc-city-dot { display: none; }

/* ─────────────────────────────────────────
   TEXT / NUMBER INPUTS
───────────────────────────────────────── */
.mfc-input-box {
    max-width: 600px;
    margin: 0 auto;
}

.mfc-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 28px;
    max-width: 920px;
    margin: 0 auto;
}

/* Boxes nested inside the 2-column grid must fill their column —
   the standalone box's max-width + auto-margin above would otherwise
   override grid's default stretch and shrink each field to its content
   width, centering it and leaving huge gaps between columns. */
.mfc-input-grid .mfc-input-box {
    max-width: none;
    width: 100%;
    margin: 0;
}

.mfc-input-box label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.mfc-input-box input,
.mfc-input-box select,
.mfc-input-grid input,
.mfc-input-grid select {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #0a1628;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
    -webkit-appearance: none;
    appearance: none;
}

.mfc-input-box input:focus,
.mfc-input-box select:focus,
.mfc-input-grid input:focus,
.mfc-input-grid select:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.mfc-input-box input.mfc-error-field,
.mfc-input-grid input.mfc-error-field {
    border-color: #ef4444;
    background: #fff5f5;
    box-shadow: 0 0 0 3px rgba(239,68,68,.08);
}

/* iOS collapses date inputs to a shorter height than text inputs,
   so DOB sits misaligned beside Mobile Number in the grid */
.mfc-input-box input[type=date],
.mfc-input-grid input[type=date] {
    min-height: 46px;
    line-height: 1.2;
    display: block;
}
.mfc-wizard-page input[type=date]::-webkit-date-and-time-value {
    text-align: left;
}

/* select chevron */
.mfc-input-box select,
.mfc-input-grid select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.mfc-help {
    font-size: 11.5px;
    color: #94a3b8;
    font-weight: 600;
    margin-top: 5px;
}

.mfc-amount-words {
    min-height: 16px;
    font-size: 12px;
    font-weight: 700;
    color: #2563eb;
    margin-top: 4px;
    line-height: 1.4;
}

/* co-applicant / other city spacing */
.other-city-box { margin-top: 20px; }
.coapplicant-fields {
    margin-top: 0;
    display: none;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: opacity .25s ease;
}
.mfc-input-grid.coapplicant-fields.mfc-show {
    display: grid;
    margin-top: 24px;
    max-height: none;
    opacity: 1;
}

/* ─────────────────────────────────────────
   CAPTCHA VERIFICATION BOX
───────────────────────────────────────── */
.mfc-captcha-box {
    max-width: 340px;
    margin: 26px auto 0;
    padding: 16px 18px;
    border: 1.5px dashed #bfdbfe;
    border-radius: 14px;
    background: #eff6ff;
}

.mfc-captcha-box label {
    display: block;
    font-size: 12.5px;
    font-weight: 800;
    color: #071b46;
    letter-spacing: 0;
    text-transform: none;
    margin-bottom: 8px;
}

.mfc-captcha-code {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    margin-bottom: 10px;
    padding: 12px 10px;
    border-radius: 10px;
    border: 1.5px solid #bfdbfe;
    background:
        repeating-linear-gradient(135deg, rgba(37,99,235,.05) 0 6px, transparent 6px 12px),
        #fff;
    user-select: none;
    -webkit-user-select: none;
}

.mfc-captcha-code span {
    display: inline-block;
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
}
.mfc-captcha-code span:nth-child(6n+1) { color: #2563eb; transform: rotate(-9deg) translateY(1px); }
.mfc-captcha-code span:nth-child(6n+2) { color: #071b46; transform: rotate(7deg)  translateY(-2px); }
.mfc-captcha-code span:nth-child(6n+3) { color: #f97316; transform: rotate(-5deg) translateY(2px); }
.mfc-captcha-code span:nth-child(6n+4) { color: #1d4ed8; transform: rotate(8deg)  translateY(-1px); }
.mfc-captcha-code span:nth-child(6n+5) { color: #071b46; transform: rotate(-8deg) translateY(1px); }
.mfc-captcha-code span:nth-child(6n+6) { color: #f97316; transform: rotate(6deg)  translateY(-2px); }

.mfc-captcha-hint {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    margin: -2px 0 10px;
}

.mfc-captcha-input {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1.5px solid #bfdbfe;
    border-radius: 10px;
    background: #fff;
    color: #071b46;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    letter-spacing: .18em;
    text-transform: uppercase;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.mfc-captcha-input::placeholder {
    font-family: inherit;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
}

.mfc-captcha-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.mfc-captcha-input.mfc-error-field {
    border-color: #ef4444;
    background: #fff5f5;
    box-shadow: 0 0 0 3px rgba(239,68,68,.08);
}

/* ─────────────────────────────────────────
   CONSENT CHECKBOX
───────────────────────────────────────── */
.mfc-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 920px;
    margin: 24px auto 0;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.6;
}

.mfc-consent input[type=checkbox] {
    flex-shrink: 0;
    width: 16px; height: 16px;
    margin-top: 2px;
    accent-color: #2563eb;
    cursor: pointer;
}

/* ─────────────────────────────────────────
   FORM ACTION BUTTONS
───────────────────────────────────────── */
.mfc-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    position: absolute;
    bottom: 28px;
    left: 36px;
    right: 36px;
    z-index: 5;
}

/* On the first step, Previous is display:none, leaving Next as the only
   flex child — justify-content: flex-end keeps it pinned to the right.
   On later steps, Previous is visible again; margin-right:auto pushes it
   to the left while Next/Submit stay grouped on the right. */
#prevBtn {
    margin-right: auto;
}

.mfc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    min-width: 110px;
    padding: 0 22px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 800;
    transition: transform .2s, box-shadow .2s, background .15s;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

/* Previous */
.mfc-btn-light {
    background: #f1f5f9;
    color: #475569;
    border: 1.5px solid #e2e8f0;
}
.mfc-btn-light:hover {
    background: #e2e8f0;
    color: #071b46;
}

/* Next */
.mfc-btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(37,99,235,.32);
    position: relative;
    overflow: hidden;
}
.mfc-btn-primary::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.15) 0%, transparent 55%);
    border-radius: 12px;
}
.mfc-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(37,99,235,.42);
}

/* Submit */
.mfc-btn-submit {
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
    color: #07142e;
    box-shadow: 0 6px 18px rgba(251,191,36,.36);
    position: relative;
    overflow: hidden;
}
.mfc-btn-submit::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, transparent 55%);
    border-radius: 12px;
}
.mfc-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(251,191,36,.46);
}

#submitBtn { display: none; }


/* ═════════════════════════════════════════
   RESPONSIVE
═════════════════════════════════════════ */

/* ── ≤ 860px — tablet and below: options go VERTICAL ──
   Four or three tiles across stop being readable well before the
   phone breakpoint. One full-width row per option keeps every
   label legible and every tap target comfortably large. */
@media (max-width: 860px) {
    .mfc-wizard-container { width: calc(100% - 36px); }

    .mfc-option-grid,
    .city-grid,
    .mfc-option-grid.two-options {
        grid-template-columns: 1fr;
        gap: 10px;
        justify-content: stretch;
    }

    /* Row layout: icon left, label right */
    .mfc-option-card {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        min-height: 64px;
        padding: 12px 16px;
        gap: 14px;
    }

    .mfc-icon {
        width: 46px;
        height: 46px;
        font-size: 22px;
        flex-shrink: 0;
    }

    .mfc-option-card strong {
        font-size: 14px;
        flex: 1;
    }

    .mfc-input-grid {
        grid-template-columns: 1fr;
    }

    .mfc-step {
        padding: 30px 24px 100px;
    }

    /* 16px is the threshold below which iOS Safari zooms the viewport
       on focus, leaving the page scrolled sideways. This one rule is
       the difference between a form that feels native on iPhone and
       one that feels broken. */
    .mfc-input-box input,
    .mfc-input-box select,
    .mfc-input-grid input,
    .mfc-input-grid select {
        font-size: 16px;
        min-height: 48px;
    }

    /* Hover lift on a touch device leaves cards stuck raised after a
       tap, since there's no pointer to move away */
    .mfc-option-card:hover {
        transform: none;
    }
}

/* ── ≤ 640px — phone ── */
@media (max-width: 640px) {
    .mfc-wizard-container { width: calc(100% - 28px); }
    .mfc-wizard-section   { padding: 36px 0 56px; }

    .mfc-wizard-top { flex-direction: column; gap: 12px; }
    .mfc-wizard-top h2 { font-size: 22px; }
    .mfc-back-link { min-height: 40px; }

    .mfc-step {
        padding: 24px 18px 24px;   /* bottom padding no longer reserves
                                      space — actions are sticky below */
        border-radius: 18px;
        min-height: auto;
    }
    .mfc-step h2 { font-size: 20px; margin-bottom: 22px; }

    .mfc-option-card {
        min-height: 60px;
        padding: 12px 14px;
    }

    /* ── Sticky action bar ──
       Absolute positioning parked Next at the bottom of the step,
       which on the 9-item city list meant scrolling past every
       option to reach it. Sticky keeps it in view throughout.
       Delete this block to restore the v2.0 absolute behaviour. */
    .mfc-form-actions {
        position: sticky;
        left: auto;
        right: auto;
        bottom: 0;
        margin-top: 20px;
        padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
        background: #fff;
        flex-direction: row;
    }
    .mfc-form-actions::before {
        content: '';
        position: absolute;
        left: 0; right: 0; top: -18px;
        height: 18px;
        background: linear-gradient(to top, #fff, rgba(255,255,255,0));
        pointer-events: none;
    }
    .mfc-btn {
        min-width: 0;
        flex: 1;
        min-height: 48px;
        font-size: 14px;
        padding: 0 14px;
    }

    .mfc-progress { height: 8px; }
    .mfc-progress-fill span { display: none; }

    .mfc-captcha-box { max-width: 100%; }

    .mfc-consent { font-size: 13px; }
    .mfc-consent input[type=checkbox] {
        width: 20px; height: 20px;   /* 16px is hard to hit accurately */
    }
}

/* ── ≤ 400px ── */
@media (max-width: 400px) {
    .mfc-wizard-container { width: calc(100% - 20px); }
    .mfc-step { padding: 20px 14px 20px; }
    .mfc-step h2 { font-size: 18px; margin-bottom: 18px; }

    .mfc-option-card { padding: 11px 12px; gap: 12px; min-height: 56px; }
    .mfc-icon { width: 42px; height: 42px; font-size: 20px; }
    .mfc-option-card strong { font-size: 13px; }

    .mfc-captcha-code { gap: 2px; padding: 10px 6px; }
    .mfc-captcha-code span { font-size: 20px; }
}

/* ── ≤ 360px — older/smaller Android (Redmi, Galaxy A) ── */
@media (max-width: 360px) {
    .mfc-wizard-top h2 { font-size: 20px; }
    .mfc-option-card strong { font-size: 12.5px; }
    .mfc-icon { width: 38px; height: 38px; font-size: 18px; }
    .mfc-captcha-code span { font-size: 18px; }

    /* Two full-width buttons beat two unreadable ones */
    .mfc-form-actions { flex-wrap: wrap; }
    .mfc-btn { flex: 1 1 100%; }
    #prevBtn { margin-right: 0; }
}

/* ── Landscape phone ──
   Viewport height drops to ~380px, where the step card's min-height
   and the sticky bar together leave almost nothing scrollable. */
@media (max-height: 480px) and (orientation: landscape) {
    .mfc-wizard-section { padding: 20px 0 32px; }
    .mfc-step { min-height: auto; padding: 18px 20px; }
    .mfc-step h2 { font-size: 18px; margin-bottom: 14px; }
    .mfc-option-card { min-height: 48px; padding: 10px 12px; }
    .mfc-icon { width: 36px; height: 36px; font-size: 18px; }

    /* Sticky would eat too much of a short viewport */
    .mfc-form-actions { position: static; padding: 12px 0 0; }
    .mfc-form-actions::before { display: none; }

    /* Width is plentiful in landscape even if height isn't */
    .mfc-option-grid,
    .city-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─────────────────────────────────────────
   ACCESSIBILITY
───────────────────────────────────────── */

/* The real radio is opacity:0, so keyboard users get no focus ring
   without this — the card itself has to show the focus state */
.mfc-option-card:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.25);
}

.mfc-wizard-page input:focus-visible,
.mfc-wizard-page select:focus-visible,
.mfc-wizard-page textarea:focus-visible,
.mfc-wizard-page .mfc-btn:focus-visible,
.mfc-wizard-page .mfc-back-link:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .mfc-wizard-page *,
    .mfc-wizard-page *::before,
    .mfc-wizard-page *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .mfc-option-card:has(input:checked),
    .mfc-option-card.mfc-selected { animation: none; }
}