/* ==========================================================
   CareFirst AIC — cf-style.css  v2.0.0
   "Clinical Elite" Design System
   Theme:  Navy #0A2540 bg · Teal #00D4FF accent · Glassmorphism
   Font:   Plus Jakarta Sans & Inter (Google Fonts)
   Accessibility: 60px touch targets · 40px slider thumb
   ========================================================== */

/* ── 0. GOOGLE FONTS ──────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

/* ── 1. DESIGN TOKENS ─────────────────────────────────────── */
:root {
    --cf-navy: #0A2540;
    --cf-navy-mid: #0d2e4d;
    --cf-navy-light: #1e3a5f;
    --cf-teal: #00D4FF;
    --cf-teal-dim: rgba(0, 212, 255, 0.15);
    --cf-teal-glow: rgba(0, 212, 255, 0.35);
    --cf-green: #22c55e;
    --cf-amber: #f59e0b;
    --cf-red: #ef4444;
    --cf-red-dim: rgba(239, 68, 68, 0.15);
    --cf-red-glow: rgba(239, 68, 68, 0.50);
    --cf-white: #ffffff;
    --cf-white-90: rgba(255, 255, 255, 0.90);
    --cf-white-60: rgba(255, 255, 255, 0.60);
    --cf-white-15: rgba(255, 255, 255, 0.08);
    --cf-text: #e2eaf4;
    --cf-text-muted: #94a3b8;
    --cf-border: rgba(255, 255, 255, 0.10);
    --cf-radius: 16px;
    --cf-radius-sm: 10px;
    --cf-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --cf-font-main: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    --cf-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── 2. WRAPPER BASE ──────────────────────────────────────── */
[x-cloak] {
    display: none !important;
}

#cf-aic-wrapper {
    font-family: var(--cf-font-main);
    min-height: 80vh;
    width: 100%;
    color: var(--cf-text);
    line-height: 1.7;
    box-sizing: border-box;
    padding: 0px 28px 80px;
    border-radius: var(--cf-radius);
    position: relative;
    overflow: hidden;
    margin-top: -45px;
    font-size: 1.05rem;
}

#cf-aic-wrapper *,
#cf-aic-wrapper *::before,
#cf-aic-wrapper *::after {
    box-sizing: border-box;
}


#cf-aic-wrapper::after {
    content: '';
    position: absolute;
    bottom: -120px;
    right: -120px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 100, 200, 0.2) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── 3. TRANSITIONS / ANIMATIONS ─────────────────────────── */
.cf-fade-in {
    animation: cfFadeIn 0.65s ease forwards;
}

.cf-fade-out {
    animation: cfFadeOut 0.5s ease forwards;
}

/*
 * Question-card opacity fade — NO translateX.
 * Using Alpine's explicit class hooks so cards fade in/out
 * WITHOUT moving in the layout → eliminates page shaking.
 */
.cf-q-enter {
    transition: opacity 0.35s ease, transform 0.35s ease !important;
}

.cf-q-enter-start {
    opacity: 0 !important;
    transform: translateY(10px) !important;
}

.cf-q-enter-end {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.cf-q-leave {
    transition: opacity 0.2s ease !important;
}

.cf-q-leave-start {
    opacity: 1 !important;
}

.cf-q-leave-end {
    opacity: 0 !important;
}

.cf-slide-in {
    animation: cfSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.cf-slide-out {
    animation: cfSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes cfFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes cfFadeOut {
    from {
        opacity: 1;
        transform: translateY(0)
    }

    to {
        opacity: 0;
        transform: translateY(-10px)
    }
}

@keyframes cfSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px)
    }

    to {
        opacity: 1;
        transform: translateX(0)
    }
}

@keyframes cfSlideOut {
    from {
        opacity: 1;
        transform: translateX(0)
    }

    to {
        opacity: 0;
        transform: translateX(-40px)
    }
}

@keyframes cfSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes cfPulseRed {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 var(--cf-red-glow);
    }

    50% {
        opacity: .85;
        box-shadow: 0 0 0 12px rgba(239, 68, 68, 0);
    }
}

@keyframes cfBannerPulse {

    0%,
    100% {
        background: rgba(239, 68, 68, 0.25);
    }

    50% {
        background: rgba(239, 68, 68, 0.40);
    }
}

@keyframes cfGaugeFill {
    from {
        stroke-dasharray: 0 251;
    }
}

/* ── 4. KILL-SWITCH EMERGENCY BANNER ─────────────────────── */
.cf-kill-switch-banner {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.55);
    border-radius: var(--cf-radius-sm);
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fca5a5;
    line-height: 1.5;
    animation: cfBannerPulse 2s ease-in-out infinite;
}

.cf-ks-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── 5. INTRO SCREEN (STEP 0) ─────────────────────────────── */
#cf-intro {
    position: relative;
    z-index: 1;
    max-width: 1060px;
    margin: 0 auto;
}

.cf-intro-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: -25px;
    background: transparent;
    border: none;
    border-radius: 28px;
    padding: 0px 24px;
    box-shadow: none;
    text-align: center;
}

.cf-intro-badge {
    display: inline-flex;
    align-items: center;
    gap: -25px;
    background: var(--cf-teal-dim);
    border: 1px solid var(--cf-teal-glow);
    color: var(--cf-teal);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 5px 24px;
    border-radius: 100px;
    margin: 0;
    position: relative;
    z-index: 2;
    text-transform: uppercase;
}

.cf-intro-title {
    font-size: clamp(2.4rem, 5.5vw, 3.8rem);
    font-weight: 800;
    color: var(--cf-white);
    line-height: 1.05;
    margin: -35px 0 14px 0;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #fff 40%, var(--cf-teal) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cf-intro-subtitle {
    font-size: 1.3rem;
    color: var(--cf-text-muted);
    margin: 0 0 40px;
}

.cf-intro-pillars {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: nowrap;
    margin-bottom: 32px;
}

.cf-pillar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--cf-white-15);
    border: 1px solid var(--cf-border);
    border-radius: 100px;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 600;
    color: var(--cf-white-90);
    white-space: nowrap;
}

.cf-pillar-icon {
    font-size: 20px;
}

.cf-intro-body {
    text-align: left;
    background: var(--cf-white-15);
    border-left: 4px solid var(--cf-teal);
    border-radius: var(--cf-radius-sm);
    padding: 28px 32px;
    margin-bottom: 36px;
}

.cf-intro-body p {
    font-size: 1.05rem;
    color: var(--cf-text-muted);
    margin: 0 0 14px;
}

.cf-intro-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cf-intro-body li {
    font-size: 1.05rem;
    color: var(--cf-text);
    padding: 7px 0;
    line-height: 1.6;
}

.cf-consent-box {
    background: var(--cf-white-15);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-sm);
    padding: 22px 28px;
    margin-bottom: 36px;
    text-align: left;
}

.cf-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-size: 1rem;
    color: var(--cf-text-muted);
    cursor: pointer;
    line-height: 1.6;
}

.cf-consent-check {
    margin-top: 3px;
    accent-color: var(--cf-teal);
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
    /* Suppress native browser red-outline validation flicker on submit */
    outline: none !important;
    box-shadow: none !important;
}

/* Prevent :invalid pseudo-class from showing red outline on AIC checkboxes */
#cf-aic-wrapper input[type="checkbox"]:invalid,
#cf-aic-wrapper input[type="checkbox"]:required {
    outline: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
}

.cf-intro-cta {
    width: 100%;
    background: linear-gradient(135deg, var(--cf-teal) 0%, #0099cc 100%);
    color: var(--cf-navy);
    font-family: var(--cf-font-main);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    border: none;
    border-radius: var(--cf-radius);
    padding: 26px 40px;
    min-height: 72px;
    cursor: pointer;
    transition: var(--cf-transition);
    box-shadow: 0 4px 28px rgba(0, 212, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.cf-intro-cta:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.6);
}

.cf-intro-cta.cf-cta-disabled,
.cf-intro-cta:disabled {
    background: #1e3a5f;
    color: var(--cf-text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.cf-cta-arrow {
    font-size: 1.5rem;
}

.cf-intro-disclaimer {
    font-size: 0.9rem;
    color: var(--cf-text-muted);
    margin: 24px 0 0;
    text-align: center;
}

/* ── 6. PROGRESS BAR ─────────────────────────────────────── */
#cf-quiz {
    position: relative;
    z-index: 1;
}

.cf-progress-wrap {
    max-width: 1060px;
    margin: 0 auto 36px;
    background: var(--cf-navy-light);
    border-radius: 100px;
    height: 10px;
    position: relative;
    overflow: visible;
}

.cf-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--cf-teal) 0%, #00aaff 100%);
    border-radius: 100px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 16px var(--cf-teal-glow);
    min-width: 5%;
}

.cf-progress-text {
    position: absolute;
    right: 0;
    top: -28px;
    font-size: 13px;
    color: var(--cf-text-muted);
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* ── 7. QUIZ LAYOUT (SIDEBAR + QUESTION) ─────────────────── */
.cf-quiz-layout {
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 36px;
    max-width: 1060px;
    margin: 0 auto;
    align-items: start;
}

/* ── 8. LIVE SCOREBOARD (SIDEBAR) ─────────────────────────── */
.cf-scoreboard {
    background: rgba(13, 46, 77, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    padding: 28px 22px;
    position: sticky;
    top: 80px;
    box-shadow: var(--cf-shadow);
}

.cf-sb-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cf-teal);
    margin: 0 0 24px;
    text-align: center;
}

/* ── SVG Arc Gauge ── */
.cf-gauge-wrap {
    margin-bottom: 24px;
    text-align: center;
}

.cf-gauge-svg {
    width: 100%;
    max-width: 150px;
    overflow: visible;
    display: block;
    margin: 0 auto;
}

/* Animated fill arc — CSS transition on stroke-dasharray */
.cf-gauge-arc {
    transition: stroke-dasharray 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        stroke 0.4s ease;
    animation: cfGaugeFill 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.cf-gauge-pct {
    font-family: var(--cf-font-main);
    font-size: 24px;
    font-weight: 800;
    fill: #ffffff;
}

.cf-gauge-sublabel {
    font-family: var(--cf-font-main);
    font-size: 11px;
    font-weight: 600;
    fill: var(--cf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cf-gauge-label {
    font-size: 13px;
    color: var(--cf-text-muted);
    margin: 8px 0 4px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cf-gauge-status {
    font-size: 14px;
    font-weight: 700;
}

/* ── Traffic Light ── */
.cf-traffic-wrap {
    margin-bottom: 24px;
    text-align: center;
}

.cf-traffic-lights {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 12px 0;
}

.cf-light {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: var(--cf-transition);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.cf-light-off {
    background: var(--cf-navy-light);
}

.cf-light-green {
    background: var(--cf-green);
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.75);
}

.cf-light-amber {
    background: var(--cf-amber);
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.75);
}

.cf-light-red {
    background: var(--cf-red);
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.75);
}

.cf-traffic-label {
    font-size: 14px;
    font-weight: 700;
}

.cf-status-green {
    color: var(--cf-green);
}

.cf-status-amber {
    color: var(--cf-amber);
}

.cf-status-red {
    color: var(--cf-red);
}

/* ── 9. QUESTION CARD ─────────────────────────────────────── */
/*
 * SHAKING FIX: .cf-question-zone has a stable min-height.
 * Cards are stacked in normal flow but only ONE is visible at a time.
 * The container never collapses above the min-height, so no vertical
 * reflow occurs when the visible card changes.
 */
.cf-question-zone {
    position: relative;
    min-height: 560px;
    will-change: contents;
}

.cf-card {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(13, 46, 77, 0.80);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--cf-border);
    border-radius: 24px;
    padding: 48px 44px;
    box-shadow: var(--cf-shadow);
}

.cf-card-section {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cf-teal);
    margin-bottom: 20px;
}

.cf-card-question {
    font-size: clamp(1.2rem, 2.8vw, 1.65rem);
    font-weight: 700;
    color: var(--cf-white);
    margin: 0 0 14px;
    line-height: 1.4;
}

.cf-card-hint {
    font-size: 1rem;
    color: var(--cf-text-muted);
    margin: 0 0 28px;
    font-style: italic;
}

/* Kill-Switch question warning label */
.cf-ks-warning {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.30);
    border-radius: var(--cf-radius-sm);
    padding: 10px 16px;
    font-size: 0.85rem;
    color: #fca5a5;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ── 10. TAP CARDS ─────────────────────────────────────────── */
.cf-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 18px;
    margin-top: 12px;
}

.cf-option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: var(--cf-white-15);
    border: 2px solid var(--cf-border);
    border-radius: var(--cf-radius);
    padding: 28px 18px;
    min-height: 100px;
    cursor: pointer;
    transition: var(--cf-transition);
    font-family: var(--cf-font-main);
    color: var(--cf-text);
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}

.cf-option-card:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 212, 255, 0.15);
}

.cf-option-card.cf-option-selected {
    background: rgba(0, 212, 255, 0.18);
    border-color: var(--cf-teal);
    box-shadow: 0 0 0 3px var(--cf-teal-dim), 0 6px 20px rgba(0, 212, 255, 0.25);
    transform: translateY(-2px);
}

/* Kill-Switch danger option style */
.cf-option-card.cf-option-danger {
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.06);
}

.cf-option-card.cf-option-danger:hover {
    border-color: rgba(239, 68, 68, 0.55);
    background: rgba(239, 68, 68, 0.12);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.15);
}

.cf-option-card.cf-option-danger.cf-option-selected {
    border-color: var(--cf-red);
    background: rgba(239, 68, 68, 0.18);
    box-shadow: 0 0 0 3px var(--cf-red-dim), 0 6px 20px rgba(239, 68, 68, 0.25);
}

.cf-option-icon {
    font-size: 2.8rem;
    line-height: 1;
}

.cf-option-label {
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
}

/* ── 11. SMART SLIDER (40px thumb) ────────────────────────── */
.cf-slider-wrap {
    margin-top: 12px;
}

.cf-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 100px;
    outline: none;
    cursor: pointer;
    transition: var(--cf-transition);
}

.cf-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 4px solid var(--cf-navy);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: var(--cf-transition);
}

.cf-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}

.cf-slider::-moz-range-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 4px solid var(--cf-navy);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

.cf-slider-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 14px 0 24px;
    font-size: 12px;
    color: var(--cf-text-muted);
}

.cf-slider-val {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--cf-white);
    background: var(--cf-white-15);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-sm);
    width: 72px;
    text-align: center;
    padding: 4px 0;
}

/* ── 11b. VAS SLIDER (Question 6) ────────────────────────── */
.cf-vas-wrap {
    margin-top: 12px;
}

.cf-vas-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.cf-vas-face {
    width: 80px;
    height: 80px;
}

.cf-vas-face-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.cf-vas-label {
    font-size: 1.25rem;
    font-weight: 800;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cf-vas-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 12px;
    border-radius: 100px;
    outline: none;
    cursor: pointer;
    background: linear-gradient(90deg, #22c55e 0%, #84cc16 30%, #eab308 50%, #f97316 80%, #ef4444 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 15px;
}

.cf-vas-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 4px solid var(--cf-navy);
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cf-vas-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}

.cf-vas-slider::-moz-range-thumb {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 4px solid var(--cf-navy);
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cf-vas-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
}

/* ── 12. TEXT & NUMBER INPUTS ─────────────────────────────── */
.cf-textarea,
.cf-number-input,
.cf-input {
    width: 100%;
    background: var(--cf-white-15);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-sm);
    color: var(--cf-white);
    font-family: var(--cf-font-main);
    font-size: 1rem;
    padding: 16px 18px;
    transition: var(--cf-transition);
    outline: none;
    resize: vertical;
}

.cf-textarea:focus,
.cf-number-input:focus,
.cf-input:focus {
    border-color: var(--cf-teal);
    box-shadow: 0 0 0 3px var(--cf-teal-dim);
}

.cf-textarea::placeholder,
.cf-number-input::placeholder,
.cf-input::placeholder {
    color: var(--cf-text-muted);
}

.cf-text-wrap,
.cf-number-wrap {
    margin-top: 8px;
}

.cf-number-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cf-number-unit {
    font-size: 1rem;
    font-weight: 600;
    color: var(--cf-text-muted);
}

.cf-number-input {
    width: 140px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    resize: none;
}

/* ── 12b. BODY METRICS (Weight + Height + BMI) ────────────── */
.cf-bm-wrap {
    margin-top: 8px;
}

.cf-bm-row {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.cf-bm-field {
    flex: 1;
    min-width: 130px;
}

.cf-bm-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--cf-teal);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.cf-bm-field .cf-number-input {
    width: 100%;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    resize: none;
}

/* ── BMI Display Card ── */
.cf-bmi-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 20px;
    padding: 14px 22px;
    background: rgba(13, 46, 77, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-sm);
    animation: cfBmiFadeIn 0.4s ease both;
}

@keyframes cfBmiFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cf-bmi-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--cf-white);
}

.cf-bmi-category {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 100px;
    transition: var(--cf-transition);
}

.cf-bmi-under {
    background: rgba(96, 165, 250, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(96, 165, 250, 0.4);
}

.cf-bmi-normal {
    background: rgba(0, 212, 255, 0.15);
    color: var(--cf-teal);
    border: 1px solid rgba(0, 212, 255, 0.35);
}

.cf-bmi-over {
    background: rgba(245, 158, 11, 0.15);
    color: var(--cf-amber);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.cf-bmi-obese {
    background: rgba(239, 68, 68, 0.15);
    color: var(--cf-red);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

/* ── 13. BUTTONS ──────────────────────────────────────────── */
.cf-next-btn,
.cf-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--cf-teal) 0%, #0099cc 100%);
    color: var(--cf-navy);
    font-family: var(--cf-font-main);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    border: none;
    border-radius: var(--cf-radius);
    padding: 16px 32px;
    min-height: 60px;
    cursor: pointer;
    transition: var(--cf-transition);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.35);
    margin-top: 20px;
    text-decoration: none;
}

.cf-next-btn:hover,
.cf-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 212, 255, 0.5);
}

.cf-next-btn:disabled,
.cf-cta-btn:disabled {
    background: var(--cf-navy-light);
    color: var(--cf-text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cf-cta-btn {
    width: 100%;
    font-size: 1.1rem;
    padding: 20px 32px;
    margin-top: 28px;
}

/* Emergency CTA – red gradient */
.cf-cta-emergency {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
    color: white !important;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.45) !important;
}

.cf-cta-emergency:hover {
    box-shadow: 0 8px 28px rgba(239, 68, 68, 0.6) !important;
    transform: translateY(-2px);
}

/* Outline secondary CTA */
.cf-cta-secondary {
    background: transparent;
    color: var(--cf-teal);
    border: 2px solid var(--cf-teal);
    box-shadow: none;
}

.cf-cta-secondary:hover {
    background: var(--cf-teal-dim);
    box-shadow: 0 0 20px var(--cf-teal-dim);
    transform: translateY(-2px);
}

/* ── 14. CONTACT GATE (Step 33) ───────────────────────────── */
.cf-contact-gate {
    max-width: 560px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.cf-contact-card {
    text-align: center;
}

.cf-contact-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 24px;
}

.cf-error-msg {
    font-size: 0.875rem;
    color: var(--cf-red);
    margin-top: 8px;
}

/* Emergency contact-gate header */
.cf-ks-contact-header {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-radius: var(--cf-radius-sm);
    padding: 12px 18px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fca5a5;
    animation: cfBannerPulse 2s ease-in-out infinite;
}

/* ── 15. LOADING OVERLAY (Step 34) ───────────────────────── */
.cf-loading-overlay {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}

.cf-loading-inner {
    text-align: center;
}

.cf-spinner {
    width: 64px;
    height: 64px;
    border: 5px solid var(--cf-navy-light);
    border-top-color: var(--cf-teal);
    border-radius: 50%;
    animation: cfSpin 0.9s linear infinite;
    margin: 0 auto 24px;
}

/* Emergency spinner colour override */
.cf-spinner-red {
    border-top-color: var(--cf-red);
    border-right-color: rgba(239, 68, 68, 0.4);
}

.cf-loading-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--cf-white);
    margin: 0 0 8px;
}

.cf-loading-sub {
    font-size: 0.9rem;
    color: var(--cf-text-muted);
    margin: 0;
}

/* ── 16. RESULT SCREEN (Step 35) ─────────────────────────── */
#cf-result {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.cf-result-card {
    background: rgba(13, 46, 77, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--cf-border);
    border-radius: 24px;
    padding: 48px 44px;
    box-shadow: var(--cf-shadow);
    text-align: center;
    transition: all 0.4s ease;
}

/* Emergency Verdict C — pulsing red border */
.cf-verdict-emergency {
    border-color: rgba(239, 68, 68, 0.55) !important;
    box-shadow: var(--cf-shadow), 0 0 0 1px rgba(239, 68, 68, 0.3) !important;
    animation: cfPulseRed 2.5s ease-in-out infinite;
}

.cf-verdict-badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 8px 24px;
    border-radius: 100px;
    margin-bottom: 28px;
    text-transform: uppercase;
}

.cf-badge-a {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: var(--cf-green);
}

.cf-badge-b {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: var(--cf-amber);
}

.cf-badge-c {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: var(--cf-red);
}

.cf-result-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--cf-white);
    margin: 0 0 20px;
}

.cf-result-scores {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.cf-score-pill {
    background: var(--cf-white-15);
    border: 1px solid var(--cf-border);
    border-radius: 100px;
    padding: 8px 20px;
    font-size: 14px;
    color: var(--cf-text-muted);
}

.cf-score-pill strong {
    color: var(--cf-teal);
}

.cf-result-body {
    font-size: 1rem;
    color: var(--cf-text);
    margin: 0 0 16px;
    line-height: 1.7;
    text-align: left;
}

.cf-unlock-box,
.cf-urgent-box {
    background: var(--cf-teal-dim);
    border: 1px solid var(--cf-teal-glow);
    border-radius: var(--cf-radius-sm);
    padding: 20px 24px;
    margin: 24px 0;
    text-align: left;
}

.cf-unlock-box p,
.cf-urgent-box p {
    font-size: 0.95rem;
    color: var(--cf-text);
    margin: 0 0 8px;
}

.cf-unlock-box p:last-child,
.cf-urgent-box p:last-child {
    margin: 0;
}

.cf-scarcity {
    color: var(--cf-amber) !important;
    font-weight: 600;
}

/* Urgent (red) box */
.cf-urgent-box {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.35);
}

/* Kill-Switch specific urgent box */
.cf-urgent-box-ks {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.55);
    border-width: 2px;
}

.cf-urgent-headline {
    font-weight: 800 !important;
    color: #fca5a5 !important;
}

/* ── 17. RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 720px) {
    #cf-aic-wrapper {
        padding: 20px 14px 48px;
    }

    .cf-intro-card {
        padding: 32px 22px;
    }

    .cf-quiz-layout {
        grid-template-columns: 1fr;
    }

    /* Scoreboard → compact 3-col horizontal strip on mobile */
    .cf-scoreboard {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        padding: 14px;
    }

    .cf-sb-title {
        display: none;
    }

    .cf-gauge-svg {
        max-width: 80px;
    }

    .cf-gauge-pct {
        font-size: 13px;
    }

    .cf-gauge-sublabel {
        font-size: 7px;
    }

    .cf-gauge-label,
    .cf-gauge-status,
    .cf-traffic-label {
        font-size: 10px;
    }

    .cf-traffic-lights {
        gap: 5px;
    }

    .cf-light {
        width: 16px;
        height: 16px;
    }

    .cf-card {
        padding: 28px 20px;
    }

    .cf-card-question {
        font-size: 1.05rem;
    }

    .cf-options-grid {
        grid-template-columns: 1fr 1fr;
    }

    .cf-option-card {
        min-height: 60px;
        padding: 16px 8px;
    }

    /* keep 60px touch target */
    .cf-option-icon {
        font-size: 1.6rem;
    }

    .cf-result-card {
        padding: 32px 20px;
    }

    .cf-intro-pillars {
        gap: 8px;
    }

    .cf-pillar {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 420px) {
    .cf-options-grid {
        grid-template-columns: 1fr;
    }

    .cf-scoreboard {
        grid-template-columns: 1fr;
    }
}

/* ── 18. ACCESSIBILITY ────────────────────────────────────── */
.cf-option-card:focus-visible {
    outline: 3px solid var(--cf-teal);
    outline-offset: 2px;
}

.cf-next-btn:focus-visible,
.cf-cta-btn:focus-visible,
.cf-intro-cta:focus-visible {
    outline: 3px solid var(--cf-teal);
    outline-offset: 3px;
}

.cf-card-question,
.cf-result-title,
.cf-option-label {
    color: var(--cf-white);
}

/* Reduced-motion: disable all animations */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── 19. PRINT (Verdict C Doctor Report) ─────────────────── */
@media print {
    #cf-aic-wrapper {
        background: #fff !important;
        color: #000 !important;
        padding: 20px !important;
        border-radius: 0 !important;
    }

    .cf-scoreboard,
    .cf-progress-wrap,
    .cf-kill-switch-banner,
    .cf-cta-btn,
    .cf-next-btn,
    .cf-intro-cta {
        display: none !important;
    }

    .cf-result-card {
        background: #fff !important;
        color: #000 !important;
        border: 2px solid #c00 !important;
        border-radius: 4px !important;
        box-shadow: none !important;
        animation: none !important;
        padding: 20px !important;
    }

    .cf-verdict-badge,
    .cf-card-question,
    .cf-result-title {
        color: #000 !important;
    }

    .cf-result-body {
        color: #222 !important;
    }

    .cf-urgent-box {
        background: #ffe0e0 !important;
        border-color: #c00 !important;
    }

    .cf-urgent-box p {
        color: #000 !important;
    }
}