/* ============================================================
   RIGHT-FIT PAGE STYLES
   Namespace: .rfp-  (right fit page)
   All rules scoped under .rfp-shell to prevent collisions.
   ============================================================ */

.rfp-shell {
    /* ---------- Design tokens ---------- */
    --rfp-ink-900: #0b0f27;
    --rfp-ink-700: #262b4d;
    --rfp-ink-500: #5b607f;
    --rfp-ink-300: #a5aac7;

    --rfp-surface: #ffffff;
    --rfp-surface-soft: rgba(255, 255, 255, 0.85);
    --rfp-border: rgba(15, 18, 38, 0.08);
    --rfp-border-strong: rgba(15, 18, 38, 0.14);

    --rfp-shadow-card:
        0 20px 45px -12px rgba(15, 18, 38, 0.12),
        0 2px 6px rgba(15, 18, 38, 0.04);
    --rfp-shadow-soft:
        0 8px 22px rgba(15, 18, 38, 0.06);
    --rfp-shadow-lift:
        0 18px 40px -10px rgba(15, 18, 38, 0.18);

    /* Section accent (updated by JS per section) */
    --rfp-accent: #6366f1;
    --rfp-accent-soft: #e0e7ff;
    --rfp-accent-deep: #4338ca;
    --rfp-accent-alt: #a5b4fc;
    --rfp-grad-start: #818cf8;
    --rfp-grad-end: #4f46e5;

    /* Layout */
    position: relative;
    width: 100%;
    min-height: calc(100vh - 72px);
    padding: 2.5rem 0 4rem;
    background:
        radial-gradient(ellipse 60% 45% at 12% 8%, rgba(99, 102, 241, 0.18), transparent 60%),
        radial-gradient(ellipse 55% 40% at 88% 92%, rgba(139, 92, 246, 0.16), transparent 60%),
        linear-gradient(180deg, #e6e9f5 0%, #dfe4f2 50%, #e2e7f4 100%);
    overflow: hidden;
    isolation: isolate;
    box-sizing: border-box;
    transition: --rfp-accent 0.4s ease;
}

.rfp-shell *,
.rfp-shell *::before,
.rfp-shell *::after {
    box-sizing: border-box;
}

/* Decorative glows */
.rfp-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
    transition: background 0.6s ease;
}
.rfp-glow--a {
    width: 420px; height: 420px;
    top: -80px; left: -80px;
    background: radial-gradient(circle, var(--rfp-accent-alt), transparent 70%);
}
.rfp-glow--b {
    width: 380px; height: 380px;
    bottom: -120px; right: -60px;
    background: radial-gradient(circle, var(--rfp-accent), transparent 70%);
}

/* ============================================================
   PHASE 1 — INTRO
   ============================================================ */
.rfp-intro {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: 1.5rem;
}
.rfp-intro[hidden] { display: none; }

.rfp-intro-card {
    width: 100%;
    max-width: 720px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.75);
    outline: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: 28px;
    padding: clamp(2rem, 4vw, 3rem);
    box-shadow: var(--rfp-shadow-card);
    text-align: center;
    animation: rfpFadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.rfp-intro-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 1.1rem;
    background: var(--rfp-accent-soft);
    color: var(--rfp-accent-deep);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}
.rfp-intro-badge-icon { width: 16px; height: 16px; }

.rfp-intro-heading {
    margin: 0 0 1rem;
    font-size: clamp(1.7rem, 3.6vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--rfp-ink-900);
}
.rfp-intro-heading-accent {
    display: block;
    background: linear-gradient(120deg, #4f46e5 0%, #8b5cf6 50%, #ec4899 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.rfp-intro-sub {
    margin: 0 auto 2rem;
    max-width: 520px;
    color: var(--rfp-ink-500);
    font-size: 1rem;
    line-height: 1.6;
}

.rfp-intro-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid var(--rfp-border);
    border-bottom: 1px solid var(--rfp-border);
}
.rfp-intro-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}
.rfp-intro-stat-icon {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    background: var(--rfp-accent-soft);
    color: var(--rfp-accent-deep);
    border-radius: 50%;
    margin-bottom: 0.25rem;
}
.rfp-intro-stat-icon svg { width: 18px; height: 18px; }
.rfp-intro-stat strong {
    font-size: 0.95rem;
    color: var(--rfp-ink-900);
    font-weight: 800;
}
.rfp-intro-stat span {
    font-size: 0.75rem;
    color: var(--rfp-ink-500);
}

.rfp-intro-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.2px;
    box-shadow: 0 12px 28px -8px rgba(79, 70, 229, 0.55);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.rfp-intro-cta svg { width: 16px; height: 16px; transition: transform 0.25s ease; }
.rfp-intro-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px -10px rgba(79, 70, 229, 0.6);
}
.rfp-intro-cta:hover svg { transform: translateX(3px); }
.rfp-intro-cta:active { transform: translateY(0); }

.rfp-intro-note {
    margin: 1.5rem 0 0;
    font-size: 0.75rem;
    color: var(--rfp-ink-300);
}

/* ============================================================
   PHASE 2 — WIZARD
   ============================================================ */
.rfp-wizard {
    position: relative;
    z-index: 2;
    max-width: 820px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 2rem);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}
.rfp-wizard[hidden] { display: none; }

/* ---------- Progress header ---------- */
.rfp-progress-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    outline: 1px solid var(--rfp-border);
    border-radius: 20px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--rfp-shadow-soft);
}

.rfp-progress-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.rfp-progress-section-label {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    flex: 1 1 auto;
}
.rfp-progress-section-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    background: var(--rfp-accent-soft);
    color: var(--rfp-accent-deep);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background 0.4s ease, color 0.4s ease;
}
.rfp-progress-section-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--rfp-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
    transition: background 0.4s ease, box-shadow 0.4s ease;
}
.rfp-progress-section-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--rfp-ink-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rfp-progress-counter {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--rfp-ink-700);
    font-variant-numeric: tabular-nums;
}
#rfpCounterCurrent { color: var(--rfp-accent-deep); font-size: 1.05rem; }
.rfp-progress-counter-sep { color: var(--rfp-ink-300); }

/* ---------- Progress bar ---------- */
.rfp-progress-track {
    position: relative;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(15, 18, 38, 0.06);
    overflow: hidden;
}
.rfp-progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg,
        var(--rfp-grad-start) 0%,
        var(--rfp-accent) 50%,
        var(--rfp-grad-end) 100%);
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.4s ease;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}
.rfp-progress-markers {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    pointer-events: none;
}
.rfp-progress-marker {
    position: relative;
}
.rfp-progress-marker::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
}
.rfp-progress-marker:last-child::after { display: none; }

/* ---------- Question viewport ---------- */
.rfp-viewport {
    position: relative;
    width: 100%;
    min-height: 460px;
    overflow: hidden;   /* holds the sliding cards */
}

.rfp-card {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    outline: 1px solid var(--rfp-border);
    border-radius: 24px;
    padding: clamp(1.5rem, 3vw, 2.25rem);
    box-shadow: var(--rfp-shadow-card);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    will-change: transform, opacity;
    overflow-y: auto;
}

/* Question header */
.rfp-q-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.rfp-q-icon {
    width: 52px; height: 52px;
    flex-shrink: 0;
    display: grid; place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg,
        var(--rfp-accent-alt) 0%,
        var(--rfp-accent) 100%);
    color: #ffffff;
    box-shadow: 0 8px 18px -6px rgba(99, 102, 241, 0.55);
    transition: background 0.4s ease, box-shadow 0.4s ease;
}
.rfp-q-icon svg { width: 26px; height: 26px; }

.rfp-q-meta {
    flex: 1;
    min-width: 0;
}

.rfp-q-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--rfp-accent-deep);
    margin-bottom: 0.35rem;
}
.rfp-q-eyebrow-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--rfp-accent);
}
.rfp-q-title {
    margin: 0 0 0.4rem;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 800;
    line-height: 1.3;
    color: var(--rfp-ink-900);
    letter-spacing: -0.015em;
}
.rfp-q-sub {
    margin: 0;
    font-size: 0.85rem;
    color: var(--rfp-ink-500);
    line-height: 1.5;
}

/* ---------- Options ---------- */
.rfp-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.7rem;
}
.rfp-options[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.rfp-options[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }

.rfp-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1.1rem;
    background: #ffffff;
    border: 1.5px solid var(--rfp-border-strong);
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--rfp-ink-700);
    transition: all 0.22s ease;
    min-height: 52px;
}
.rfp-option:hover:not([aria-checked="true"]) {
    border-color: var(--rfp-accent);
    background: rgba(99, 102, 241, 0.03);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -8px rgba(99, 102, 241, 0.3);
}
.rfp-option[aria-checked="true"] {
    border-color: var(--rfp-accent);
    background: linear-gradient(135deg,
        rgba(99, 102, 241, 0.08),
        rgba(139, 92, 246, 0.05));
    color: var(--rfp-ink-900);
    box-shadow: 0 10px 24px -10px rgba(99, 102, 241, 0.5);
}
.rfp-option:focus-visible {
    outline: 2px solid var(--rfp-accent);
    outline-offset: 2px;
}
.rfp-option:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.rfp-option-icon {
    width: 34px; height: 34px;
    flex-shrink: 0;
    display: grid; place-items: center;
    border-radius: 10px;
    background: var(--rfp-accent-soft);
    color: var(--rfp-accent-deep);
    transition: background 0.22s ease, color 0.22s ease;
}
.rfp-option-icon svg { width: 18px; height: 18px; }

.rfp-option[aria-checked="true"] .rfp-option-icon {
    background: linear-gradient(135deg,
        var(--rfp-accent) 0%,
        var(--rfp-accent-deep) 100%);
    color: #ffffff;
}

.rfp-option-label {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}

.rfp-option-check {
    width: 22px; height: 22px;
    flex-shrink: 0;
    display: grid; place-items: center;
    border-radius: 50%;
    border: 2px solid var(--rfp-border-strong);
    background: #ffffff;
    transition: all 0.22s ease;
}
.rfp-option-check svg {
    width: 12px; height: 12px;
    color: #ffffff;
    opacity: 0;
    transform: scale(0.4);
    transition: all 0.22s ease;
}
.rfp-option[aria-checked="true"] .rfp-option-check {
    background: var(--rfp-accent);
    border-color: var(--rfp-accent);
}
.rfp-option[aria-checked="true"] .rfp-option-check svg {
    opacity: 1;
    transform: scale(1);
}

/* ---------- Text & number inputs ---------- */
.rfp-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.5rem 0.35rem 1rem;
    background: #ffffff;
    border: 1.5px solid var(--rfp-border-strong);
    border-radius: 14px;
    transition: all 0.22s ease;
}
.rfp-input-wrap:focus-within {
    border-color: var(--rfp-accent);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}
.rfp-input-icon {
    color: var(--rfp-accent-deep);
    display: grid; place-items: center;
    flex-shrink: 0;
}
.rfp-input-icon svg { width: 18px; height: 18px; }
.rfp-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--rfp-ink-900);
    padding: 0.7rem 0;
    min-width: 0;
}
.rfp-input::placeholder {
    color: var(--rfp-ink-300);
    font-weight: 500;
}
.rfp-input-suffix {
    padding: 0.35rem 0.85rem;
    background: var(--rfp-accent-soft);
    color: var(--rfp-accent-deep);
    font-size: 0.8rem;
    font-weight: 800;
    border-radius: 10px;
    flex-shrink: 0;
}

.rfp-input-hint {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--rfp-ink-500);
}

/* ---------- Footer nav ---------- */
.rfp-footer-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.25rem;
}

.rfp-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s ease;
    border: 1.5px solid transparent;
    white-space: nowrap;
}
.rfp-nav-btn svg { width: 16px; height: 16px; }

.rfp-nav-btn--ghost {
    background: #ffffff;
    color: var(--rfp-ink-700);
    border-color: var(--rfp-border-strong);
}
.rfp-nav-btn--ghost:hover:not(:disabled) {
    border-color: var(--rfp-accent);
    color: var(--rfp-accent-deep);
    transform: translateY(-1px);
}
.rfp-nav-btn--ghost:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.rfp-nav-btn--primary {
    background: linear-gradient(135deg,
        var(--rfp-grad-start) 0%,
        var(--rfp-grad-end) 100%);
    color: #ffffff;
    box-shadow: 0 12px 26px -10px rgba(99, 102, 241, 0.6);
}
.rfp-nav-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px -12px rgba(99, 102, 241, 0.7);
}
.rfp-nav-btn--primary svg { transition: transform 0.25s ease; }
.rfp-nav-btn--primary:hover svg { transform: translateX(3px); }
.rfp-nav-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.rfp-footer-progress-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.15;
    text-align: center;
    min-width: 0;
}
.rfp-footer-hint-strong {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--rfp-accent-deep);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    transition: color 0.4s ease;
}
.rfp-footer-hint-soft {
    font-size: 0.7rem;
    color: var(--rfp-ink-500);
    font-weight: 500;
}

.rfp-skip-link {
    align-self: center;
    background: transparent;
    border: none;
    color: var(--rfp-ink-500);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 0.4rem;
    transition: color 0.2s ease;
}
.rfp-skip-link:hover { color: var(--rfp-accent-deep); }
.rfp-skip-link[hidden] { display: none; }

/* ============================================================
   PHASE 3 — RESULT
   ============================================================ */
.rfp-result {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: 1.5rem;
}
.rfp-result[hidden] { display: none; }

.rfp-result-card {
    width: 100%;
    max-width: 620px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    outline: 1px solid var(--rfp-border);
    border-radius: 28px;
    padding: clamp(1.75rem, 3.5vw, 2.5rem);
    box-shadow: var(--rfp-shadow-card);
    text-align: center;
    animation: rfpFadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.rfp-result-icon {
    width: 72px; height: 72px;
    margin: 0 auto 1.25rem;
    display: grid; place-items: center;
    border-radius: 22px;
    background: linear-gradient(135deg,
        var(--rfp-accent-alt) 0%,
        var(--rfp-accent-deep) 100%);
    color: #ffffff;
    box-shadow: 0 16px 32px -12px rgba(99, 102, 241, 0.6);
}
.rfp-result-icon svg { width: 36px; height: 36px; }

.rfp-result-heading {
    margin: 0 0 0.6rem;
    font-size: clamp(1.4rem, 2.8vw, 1.8rem);
    font-weight: 800;
    color: var(--rfp-ink-900);
    letter-spacing: -0.02em;
}
.rfp-result-sub {
    margin: 0 0 1.75rem;
    font-size: 0.9rem;
    color: var(--rfp-ink-500);
    line-height: 1.55;
}

.rfp-result-form {
    display: grid;
    gap: 0.85rem;
    text-align: left;
}

.rfp-result-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.rfp-result-field label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--rfp-ink-700);
    letter-spacing: 0.2px;
}
.rfp-result-field label span { color: #ef4444; }
.rfp-result-field input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--rfp-border-strong);
    border-radius: 12px;
    background: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--rfp-ink-900);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.rfp-result-field input:focus {
    border-color: var(--rfp-accent);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.rfp-result-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.75rem;
    color: var(--rfp-ink-500);
    line-height: 1.45;
    cursor: pointer;
    margin-top: 0.25rem;
}
.rfp-result-consent input {
    margin-top: 2px;
    accent-color: var(--rfp-accent);
    flex-shrink: 0;
}

.rfp-result-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 0.75rem;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg,
        var(--rfp-grad-start) 0%,
        var(--rfp-grad-end) 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.2px;
    box-shadow: 0 12px 28px -10px rgba(99, 102, 241, 0.65);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.rfp-result-submit svg { width: 16px; height: 16px; }
.rfp-result-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px -12px rgba(99, 102, 241, 0.75);
}
.rfp-result-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.rfp-result-error {
    margin: 0.5rem 0 0;
    padding: 0.6rem 0.85rem;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* Thank you state */
.rfp-result-thanks {
    padding: 0.5rem 0;
    animation: rfpFadeUp 0.5s ease both;
}
.rfp-result-thanks[hidden] { display: none; }
.rfp-result-thanks-icon {
    width: 64px; height: 64px;
    margin: 0 auto 1rem;
    display: grid; place-items: center;
    border-radius: 50%;
    background: #d1fae5;
    color: #047857;
}
.rfp-result-thanks-icon svg { width: 32px; height: 32px; }
.rfp-result-thanks h3 {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--rfp-ink-900);
}
.rfp-result-thanks p {
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
    color: var(--rfp-ink-500);
    line-height: 1.55;
}
.rfp-result-done {
    padding: 0.85rem 1.6rem;
    border: 1.5px solid var(--rfp-border-strong);
    border-radius: 999px;
    background: #ffffff;
    color: var(--rfp-ink-700);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s ease;
}
.rfp-result-done:hover {
    border-color: var(--rfp-accent);
    color: var(--rfp-accent-deep);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes rfpFadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .rfp-shell {
        padding: 1.5rem 0 2.5rem;
        min-height: auto;
    }
    .rfp-intro,
    .rfp-result {
        min-height: auto;
        padding: 1rem;
    }
    .rfp-intro-card,
    .rfp-result-card { padding: 1.5rem 1.25rem; border-radius: 22px; }

    .rfp-intro-stats {
        grid-template-columns: 1fr;
        gap: 0.85rem;
        padding: 1rem 0;
    }
    .rfp-intro-stat {
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.75rem;
        text-align: left;
    }
    .rfp-intro-stat-icon { margin-bottom: 0; }
    .rfp-intro-stat strong,
    .rfp-intro-stat span { display: block; }

    .rfp-wizard { padding: 0 1rem; gap: 1.25rem; }

    .rfp-progress-header { padding: 1rem 1.1rem; border-radius: 16px; }
    .rfp-progress-section-name { font-size: 0.78rem; }
    .rfp-progress-section-pill { font-size: 0.65rem; padding: 0.3rem 0.6rem; }

    .rfp-viewport { min-height: 520px; }
    .rfp-card { padding: 1.25rem; border-radius: 20px; gap: 1.25rem; }

    .rfp-q-icon { width: 44px; height: 44px; border-radius: 14px; }
    .rfp-q-icon svg { width: 22px; height: 22px; }
    .rfp-q-title { font-size: 1.08rem; }
    .rfp-q-sub { font-size: 0.8rem; }

    .rfp-options[data-cols="2"],
    .rfp-options[data-cols="3"] { grid-template-columns: 1fr; }

    .rfp-option { padding: 0.85rem 0.9rem; font-size: 0.88rem; }
    .rfp-option-icon { width: 30px; height: 30px; }
    .rfp-option-icon svg { width: 16px; height: 16px; }

    .rfp-footer-nav { gap: 0.5rem; }
    .rfp-nav-btn { padding: 0.7rem 1.1rem; font-size: 0.85rem; }
    .rfp-footer-progress-hint { display: none; }
}

@media (max-width: 480px) {
    .rfp-intro-heading { font-size: 1.6rem; }
    .rfp-intro-sub { font-size: 0.9rem; }
    .rfp-intro-cta { width: 100%; justify-content: center; }

    .rfp-viewport { min-height: 560px; }
    .rfp-q-head { gap: 0.75rem; }
    .rfp-q-icon { width: 40px; height: 40px; }
    .rfp-q-icon svg { width: 20px; height: 20px; }

    .rfp-nav-btn {
        flex: 1;
        justify-content: center;
        padding: 0.75rem 0.8rem;
        font-size: 0.82rem;
    }
    .rfp-nav-btn svg { width: 14px; height: 14px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .rfp-card[data-state="enter"],
    .rfp-card[data-state="enter-active"],
    .rfp-card[data-state="exit"],
    .rfp-card[data-state="exit-active"] {
        transition: opacity 0.2s ease !important;
        transform: none !important;
    }
    .rfp-intro-card,
    .rfp-result-card,
    .rfp-result-thanks { animation: none !important; }
}

/* High contrast */
@media (forced-colors: active) {
    .rfp-option[aria-checked="true"] {
        border: 2px solid Highlight;
    }
    .rfp-progress-fill {
        background: Highlight;
    }
}

/* ============================================================
   NUDGE ANIMATION — highlights a card when the user tries
   to advance a required question without answering.
   ============================================================ */
@keyframes rfpNudge {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}
.rfp-card.rfp-card--nudge {
    animation: rfpNudge 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12),
                0 20px 45px -12px rgba(15, 18, 38, 0.12) !important;
}

.rfp-nav-btn--primary.rfp-nav-btn--ready {
    box-shadow: 0 12px 26px -10px rgba(99, 102, 241, 0.6),
                0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ============================================================
   INTRO CARD — INTERACTIVE & ANIMATED ENHANCEMENTS
   ============================================================ */

/* ---------- 1. Card: subtle tilt + depth via CSS variables ---------- */
.rfp-intro-card {
    position: relative;
    transform-style: preserve-3d;
    transform:
        perspective(1200px)
        rotateX(var(--rfp-tilt-x, 0deg))
        rotateY(var(--rfp-tilt-y, 0deg))
        translateZ(0);
    transition:
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.45s ease;
    will-change: transform;
}

.rfp-intro-card:hover {
    box-shadow:
        0 30px 65px -12px rgba(15, 18, 38, 0.18),
        0 4px 12px rgba(15, 18, 38, 0.06);
}

/* Floating inner layers get depth on tilt */
.rfp-intro-badge,
.rfp-intro-heading,
.rfp-intro-sub,
.rfp-intro-stats,
.rfp-intro-cta {
    transform: translateZ(20px);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 2. Staggered entrance choreography ---------- */
.rfp-intro-card .rfp-intro-badge   { animation: rfpIntroIn 0.6s 0.05s both cubic-bezier(0.22, 1, 0.36, 1); }
.rfp-intro-card .rfp-intro-heading { animation: rfpIntroIn 0.6s 0.15s both cubic-bezier(0.22, 1, 0.36, 1); }
.rfp-intro-card .rfp-intro-sub     { animation: rfpIntroIn 0.6s 0.25s both cubic-bezier(0.22, 1, 0.36, 1); }
.rfp-intro-card .rfp-intro-stats   { animation: rfpIntroIn 0.6s 0.35s both cubic-bezier(0.22, 1, 0.36, 1); }
.rfp-intro-card .rfp-intro-cta     { animation: rfpIntroIn 0.6s 0.45s both cubic-bezier(0.22, 1, 0.36, 1); }
.rfp-intro-card .rfp-intro-note    { animation: rfpIntroIn 0.6s 0.55s both cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes rfpIntroIn {
    from { opacity: 0; transform: translateY(14px) translateZ(20px); }
    to   { opacity: 1; transform: translateY(0)   translateZ(20px); }
}

/* ---------- 3. Stat icons — hover pulse ---------- */
.rfp-intro-stat {
    transition: transform 0.3s ease;
    cursor: default;
}
.rfp-intro-stat:hover {
    transform: translateY(-3px);
}
.rfp-intro-stat:hover .rfp-intro-stat-icon {
    animation: rfpIconPulse 0.6s ease;
    background: linear-gradient(135deg, var(--rfp-accent-alt), var(--rfp-accent-deep));
    color: #ffffff;
    box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.5);
}
.rfp-intro-stat-icon {
    transition:
        background 0.35s ease,
        color 0.35s ease,
        box-shadow 0.35s ease,
        transform 0.35s ease;
}
@keyframes rfpIconPulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* ---------- 4. Get Started button — pulse ring + shimmer ---------- */
.rfp-intro-cta {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    animation: rfpCtaGlow 3.4s ease-in-out 0.9s infinite;
}

/* Pulse ring behind the button */
.rfp-intro-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    z-index: -1;
    animation: rfpCtaRing 2.8s cubic-bezier(0.4, 0, 0.2, 1) 0.9s infinite;
}
@keyframes rfpCtaRing {
    0%   { opacity: 0.55; transform: scale(1); }
    70%  { opacity: 0;    transform: scale(1.35); }
    100% { opacity: 0;    transform: scale(1.35); }
}

/* Shimmer sweep across the button */
.rfp-intro-cta::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        100deg,
        transparent 0%,
        rgba(255, 255, 255, 0.45) 50%,
        transparent 100%
    );
    transform: skewX(-20deg);
    animation: rfpCtaShimmer 3.2s ease-in-out 1.4s infinite;
    pointer-events: none;
}
@keyframes rfpCtaShimmer {
    0%   { left: -120%; }
    35%  { left: 130%;  }
    100% { left: 130%;  }
}

/* Arrow micro-bounce on the CTA */
.rfp-intro-cta svg {
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.rfp-intro-cta:hover svg {
    transform: translateX(5px);
}
/* Gentle idle bounce */
@keyframes rfpArrowBounce {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(4px); }
}
.rfp-intro-cta:not(:hover) svg {
    animation: rfpArrowBounce 2s ease-in-out 1s infinite;
}

/* Focus-visible ring for accessibility */
.rfp-intro-cta:focus-visible {
    outline: 3px solid #a5b4fc;
    outline-offset: 4px;
}

/* Reduced-motion safety */
@media (prefers-reduced-motion: reduce) {
    .rfp-intro-card,
    .rfp-intro-card .rfp-intro-badge,
    .rfp-intro-card .rfp-intro-heading,
    .rfp-intro-card .rfp-intro-sub,
    .rfp-intro-card .rfp-intro-stats,
    .rfp-intro-card .rfp-intro-cta,
    .rfp-intro-card .rfp-intro-note,
    .rfp-intro-cta,
    .rfp-intro-cta::before,
    .rfp-intro-cta::after,
    .rfp-intro-cta svg {
        animation: none !important;
        transition: none !important;
    }
    .rfp-intro-stat:hover { transform: none; }
    .rfp-intro-stat:hover .rfp-intro-stat-icon { animation: none; }
}

/* ============================================================
   PROGRESS HEADER — RICH GRADIENT + LIVE BAR (Option A)
   ============================================================ */
.rfp-progress-header {
    position: sticky;
    top: 0;
    z-index: 30;

    padding: 1.5rem 2rem 1.35rem;

    background: linear-gradient(
        135deg,
        var(--rfp-grad-start) 0%,
        var(--rfp-accent) 45%,
        var(--rfp-grad-end) 100%
    );

    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 22px;
    overflow: hidden;
    isolation: isolate;

    box-shadow:
        0 18px 40px -14px rgba(15, 18, 38, 0.35),
        0 4px 10px rgba(15, 18, 38, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);

    transition:
        background 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.4s ease;
}

/* Ambient radial glow inside the header */
.rfp-progress-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 120% at 8% 0%, rgba(255, 255, 255, 0.22), transparent 60%),
        radial-gradient(ellipse 50% 120% at 92% 100%, rgba(255, 255, 255, 0.12), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Subtle dot texture */
.rfp-progress-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.08) 1px, transparent 0);
    background-size: 18px 18px;
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}

.rfp-progress-header > * {
    position: relative;
    z-index: 1;
}

/* ---------- Top row: pill + section name + counter ---------- */
.rfp-progress-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
    flex-wrap: nowrap;
}

.rfp-progress-section-label {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
    flex: 1 1 auto;
}

/* Section pill — glass-white for contrast on gradient */
.rfp-progress-section-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.rfp-progress-section-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28);
    animation: rfpDotPulse 1.8s ease-in-out infinite;
}

@keyframes rfpDotPulse {
    0%, 100% { transform: scale(1);   box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28); }
    50%      { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.12); }
}

/* Section name — bigger, becomes the actual heading */
.rfp-progress-section-name {
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.015em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* Counter — bigger and elegant */
.rfp-progress-counter {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    padding: 0.45rem 0.95rem;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

#rfpCounterCurrent {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 800;
}

.rfp-progress-counter-sep {
    color: rgba(255, 255, 255, 0.55);
}

/* ---------- LIVE progress bar ---------- */
.rfp-progress-track {
    position: relative;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

.rfp-progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        #ffffff 0%,
        #f8faff 50%,
        #ffffff 100%
    );
    box-shadow:
        0 0 14px rgba(255, 255, 255, 0.7),
        0 0 6px rgba(255, 255, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

/* Live shimmer moving across the fill */
.rfp-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: linear-gradient(
        100deg,
        transparent 0%,
        rgba(255, 255, 255, 0.85) 50%,
        transparent 100%
    );
    transform: skewX(-20deg);
    animation: rfpProgressShimmer 2.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes rfpProgressShimmer {
    0%   { left: -40%; }
    60%  { left: 120%; }
    100% { left: 120%; }
}

/* Live glowing leading dot at the edge of the fill */
.rfp-progress-fill::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.5),
        0 0 18px 4px rgba(255, 255, 255, 0.65);
    animation: rfpLeadingDot 1.6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes rfpLeadingDot {
    0%, 100% {
        box-shadow:
            0 0 0 3px rgba(255, 255, 255, 0.5),
            0 0 18px 4px rgba(255, 255, 255, 0.65);
    }
    50% {
        box-shadow:
            0 0 0 5px rgba(255, 255, 255, 0.35),
            0 0 26px 8px rgba(255, 255, 255, 0.85);
    }
}

/* Section markers — subtle white ticks on top of the track */
.rfp-progress-markers {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    pointer-events: none;
}

.rfp-progress-marker {
    position: relative;
}

.rfp-progress-marker::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5px;
    height: 60%;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 2px;
}

.rfp-progress-marker:last-child::after {
    display: none;
}

/* ---------- Mobile tightening ---------- */
@media (max-width: 640px) {
    .rfp-progress-header {
        padding: 1.15rem 1.1rem 1.05rem;
        border-radius: 16px;
    }
    .rfp-progress-top {
        margin-bottom: 0.85rem;
    }
    .rfp-progress-section-pill {
        padding: 0.4rem 0.75rem;
        font-size: 0.7rem;
    }
    .rfp-progress-section-name {
        font-size: 1rem;
    }
    .rfp-progress-counter {
        padding: 0.35rem 0.7rem;
        font-size: 0.78rem;
    }
    #rfpCounterCurrent {
        font-size: 0.95rem;
    }
    .rfp-progress-track {
        height: 8px;
    }
    .rfp-progress-fill::before {
        width: 12px;
        height: 12px;
    }
}

/* Reduced motion — stop all the live motion */
@media (prefers-reduced-motion: reduce) {
    .rfp-progress-section-dot,
    .rfp-progress-fill::after,
    .rfp-progress-fill::before {
        animation: none !important;
    }
}

/* ============================================================
   SLIDE TRANSITIONS — direction-aware, shadow-trailing
   Forward: current exits LEFT, next enters from RIGHT
   Back:    current exits RIGHT, prev enters from LEFT
   ============================================================ */

/* ---------- DEFAULT (forward) ---------- */

/* New card starting position — off-screen to the RIGHT */
.rfp-card[data-state="enter"] {
    opacity: 0;
    transform: translateX(100%) scale(0.96);
    box-shadow: 0 0 0 rgba(15, 18, 38, 0);
    pointer-events: none;
}

/* New card settled in place */
.rfp-card[data-state="enter-active"] {
    opacity: 1;
    transform: translateX(0) scale(1);
    box-shadow: 0 20px 45px -12px rgba(15, 18, 38, 0.12),
                0 2px 6px rgba(15, 18, 38, 0.04);
    transition:
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.42s ease,
        box-shadow 0.55s ease;
}

/* Old card at rest (about to leave) */
.rfp-card[data-state="exit"] {
    opacity: 1;
    transform: translateX(0) scale(1);
    box-shadow: 0 20px 45px -12px rgba(15, 18, 38, 0.12),
                0 2px 6px rgba(15, 18, 38, 0.04);
}

/* Old card sliding LEFT off the stage — with a trailing shadow */
.rfp-card[data-state="exit-active"] {
    opacity: 0;
    transform: translateX(-100%) scale(0.96);
    /* Shadow lags behind the movement, giving a sense of weight */
    box-shadow: -30px 20px 60px -18px rgba(15, 18, 38, 0.22),
                -8px 8px 20px rgba(15, 18, 38, 0.10);
    transition:
        transform 0.5s cubic-bezier(0.55, 0, 0.7, 0.2),
        opacity 0.42s ease 0.05s,
        box-shadow 0.5s ease;
    pointer-events: none;
}

/* ---------- REVERSE (back navigation) ---------- */

/* New card starting position — off-screen to the LEFT */
.rfp-card[data-state="enter"][data-dir="back"] {
    opacity: 0;
    transform: translateX(-100%) scale(0.96);
    box-shadow: 0 0 0 rgba(15, 18, 38, 0);
    pointer-events: none;
}

/* Old card sliding RIGHT off the stage */
.rfp-card[data-state="exit-active"][data-dir="back"] {
    opacity: 0;
    transform: translateX(100%) scale(0.96);
    box-shadow: 30px 20px 60px -18px rgba(15, 18, 38, 0.22),
                8px 8px 20px rgba(15, 18, 38, 0.10);
    transition:
        transform 0.5s cubic-bezier(0.55, 0, 0.7, 0.2),
        opacity 0.42s ease 0.05s,
        box-shadow 0.5s ease;
    pointer-events: none;
}

/* ---------- Viewport needs horizontal clipping + perspective ---------- */
.rfp-viewport {
    position: relative;
    width: 100%;
    min-height: 460px;
    overflow: hidden;
    perspective: 1400px;
    /* gentle fade-mask on both edges so cards appear to slide in
       from a soft "backstage" rather than hard-cut */
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 4%,
        #000 96%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 4%,
        #000 96%,
        transparent 100%
    );
}

/* Reduced motion — no slide, just fade */
@media (prefers-reduced-motion: reduce) {
    .rfp-card[data-state="enter"],
    .rfp-card[data-state="enter-active"],
    .rfp-card[data-state="exit"],
    .rfp-card[data-state="exit-active"] {
        transform: none !important;
        transition: opacity 0.25s ease !important;
    }
}

/* ============================================================
   WIZARD SHELL — 3-COLUMN LAYOUT WITH LEFT RAIL
   ============================================================ */

.rfp-wizard-shell {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1560px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 2rem);
    display: grid;
    grid-template-columns: 300px minmax(0, 820px) 1fr;
    gap: clamp(1rem, 2vw, 2rem);
    align-items: start;
}

.rfp-wizard-shell[hidden] { display: none; }

/* Center column = existing .rfp-wizard */
.rfp-wizard-shell .rfp-wizard {
    max-width: 100%;
    padding: 0;
    margin: 0;
    grid-column: 2 / 3;
    grid-row: 1;
}

/* ============================================================
   LEFT RAIL
   ============================================================ */
.rfp-rail {
    grid-column: 1 / 2;
    grid-row: 1;
    position: sticky;
    top: 96px;                              /* clears the site header */
    align-self: start;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.35) transparent;
}
.rfp-rail::-webkit-scrollbar { width: 6px; }
.rfp-rail::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.35);
    border-radius: 3px;
}
.rfp-rail::-webkit-scrollbar-track { background: transparent; }

/* Blocks */
.rfp-rail-block {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    outline: 1px solid rgba(15, 18, 38, 0.06);
    border-radius: 20px;
    padding: 1.1rem 1rem 1.2rem;
    box-shadow:
        0 10px 26px -12px rgba(15, 18, 38, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.rfp-rail-block--recap {
    display: flex;
    flex-direction: column;
    min-height: 220px;
}

/* Head */
.rfp-rail-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px dashed rgba(15, 18, 38, 0.08);
}

.rfp-rail-head-icon {
    width: 26px; height: 26px;
    display: grid; place-items: center;
    border-radius: 8px;
    background: var(--rfp-accent-soft);
    color: var(--rfp-accent-deep);
    transition: background 0.4s ease, color 0.4s ease;
}
.rfp-rail-head-icon svg { width: 14px; height: 14px; }

.rfp-rail-head-text {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--rfp-ink-700);
}

/* ---------- Journey List ---------- */
.rfp-rail-list {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

/* Vertical connector line behind all nodes */
.rfp-rail-list::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 18px;
    bottom: 18px;
    width: 2px;
    background: rgba(15, 18, 38, 0.08);
    border-radius: 2px;
    z-index: 0;
}

/* Fill line — represents progress through sections */
.rfp-rail-fill {
    position: absolute;
    left: 15px;
    top: 18px;
    width: 2px;
    background: linear-gradient(
        to bottom,
        var(--rfp-accent) 0%,
        var(--rfp-grad-end) 100%
    );
    border-radius: 2px;
    transition:
        height 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        background 0.5s ease;
    z-index: 1;
}

/* ---------- Node ---------- */
.rfp-rail-node {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.5rem 0.55rem 0;
    border-radius: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    width: 100%;
    transition: background 0.2s ease, transform 0.2s ease;
}
.rfp-rail-node:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.05);
    transform: translateX(2px);
}
.rfp-rail-node:disabled {
    cursor: not-allowed;
    opacity: 0.75;
}
.rfp-rail-node:focus-visible {
    outline: 2px solid var(--rfp-accent);
    outline-offset: 2px;
}

/* Node badge (letter A–F) */
.rfp-rail-node-badge {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    background: #ffffff;
    color: var(--rfp-ink-500);
    border: 2px solid rgba(15, 18, 38, 0.10);
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

/* Node text */
.rfp-rail-node-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    line-height: 1.25;
}

.rfp-rail-node-label {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--rfp-ink-500);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.rfp-rail-node-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--rfp-ink-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

/* ---------- Node states ---------- */

/* Upcoming (default) — dim */
.rfp-rail-node[data-status="upcoming"] .rfp-rail-node-badge {
    background: #f3f4f8;
    color: var(--rfp-ink-300);
    border-color: rgba(15, 18, 38, 0.06);
}
.rfp-rail-node[data-status="upcoming"] .rfp-rail-node-name {
    color: var(--rfp-ink-300);
    font-weight: 600;
}
.rfp-rail-node[data-status="upcoming"] .rfp-rail-node-label {
    color: var(--rfp-ink-300);
}

/* Current — highlighted with pulsing ring */
.rfp-rail-node[data-status="current"] .rfp-rail-node-badge {
    background: linear-gradient(
        135deg,
        var(--rfp-grad-start),
        var(--rfp-grad-end)
    );
    color: #ffffff;
    border-color: transparent;
    box-shadow:
        0 0 0 4px rgba(99, 102, 241, 0.18),
        0 6px 14px -6px rgba(99, 102, 241, 0.6);
    animation: rfpRailPulse 2.2s ease-in-out infinite;
}
.rfp-rail-node[data-status="current"] .rfp-rail-node-name {
    color: var(--rfp-accent-deep);
    font-weight: 800;
}
.rfp-rail-node[data-status="current"] .rfp-rail-node-label {
    color: var(--rfp-accent-deep);
}

@keyframes rfpRailPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18), 0 6px 14px -6px rgba(99, 102, 241, 0.55); }
    50%      { box-shadow: 0 0 0 7px rgba(99, 102, 241, 0.08), 0 6px 18px -6px rgba(99, 102, 241, 0.75); }
}

/* Completed — check + accent color */
.rfp-rail-node[data-status="completed"] .rfp-rail-node-badge {
    background: #ffffff;
    color: var(--rfp-accent-deep);
    border-color: var(--rfp-accent);
}
.rfp-rail-node[data-status="completed"] .rfp-rail-node-badge svg {
    width: 14px;
    height: 14px;
}
.rfp-rail-node[data-status="completed"] .rfp-rail-node-name {
    color: var(--rfp-ink-700);
}

/* ---------- Recap ---------- */
.rfp-recap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}
.rfp-recap::-webkit-scrollbar { width: 5px; }
.rfp-recap::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

.rfp-recap-empty {
    margin: 0.5rem 0;
    font-size: 0.75rem;
    color: var(--rfp-ink-300);
    text-align: center;
    line-height: 1.5;
    font-style: italic;
}

.rfp-recap-card {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 0.65rem;
    background: #ffffff;
    border: 1px solid rgba(15, 18, 38, 0.07);
    border-left: 3px solid var(--rfp-accent);
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    width: 100%;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
    animation: rfpRecapIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.rfp-recap-card:hover {
    transform: translateX(3px);
    box-shadow: 0 6px 16px -6px rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.35);
    border-left-color: var(--rfp-accent);
}

@keyframes rfpRecapIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

.rfp-recap-card-icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--rfp-accent-soft);
    color: var(--rfp-accent-deep);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.2px;
}
.rfp-recap-card-icon svg {
    width: 13px;
    height: 13px;
}

.rfp-recap-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.rfp-recap-card-q {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--rfp-ink-500);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rfp-recap-card-a {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--rfp-ink-900);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Chip strip (tablet & below) ---------- */
.rfp-chip-strip {
    display: none;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.25rem 0 0.5rem;
    margin-bottom: 0.4rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.rfp-chip-strip::-webkit-scrollbar { display: none; }

.rfp-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 18, 38, 0.10);
    background: #ffffff;
    color: var(--rfp-ink-500);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.22s ease;
}
.rfp-chip[data-status="current"] {
    background: linear-gradient(
        135deg,
        var(--rfp-grad-start),
        var(--rfp-grad-end)
    );
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 6px 14px -6px rgba(99, 102, 241, 0.55);
}
.rfp-chip[data-status="completed"] {
    background: var(--rfp-accent-soft);
    color: var(--rfp-accent-deep);
    border-color: rgba(99, 102, 241, 0.28);
}
.rfp-chip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.rfp-chip-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.8;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Below 1100px — kill side rail, show chip strip */
@media (max-width: 1100px) {
    .rfp-wizard-shell {
        grid-template-columns: 1fr;
        gap: 0;
        max-width: 820px;
    }
    .rfp-rail { display: none; }
    .rfp-wizard-shell .rfp-wizard { grid-column: 1 / -1; }
    .rfp-chip-strip { display: flex; }
}

/* Below 500px — tighter spacing */
@media (max-width: 500px) {
    .rfp-chip-strip {
        padding: 0.15rem 0 0.4rem;
    }
    .rfp-chip {
        padding: 0.4rem 0.7rem;
        font-size: 0.7rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .rfp-rail-node[data-status="current"] .rfp-rail-node-badge,
    .rfp-recap-card {
        animation: none !important;
    }
    .rfp-rail-fill {
        transition: none !important;
    }
}

/* ============================================================
   WIZARD SHELL — 4-COLUMN LAYOUT
   [Journey] [Wizard] [Answers gutter] [Answers]
   Actually: 280px | 1fr | 280px  (3 columns)
   ============================================================ */

.rfp-wizard-shell {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 2rem);
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 280px;
    gap: clamp(1rem, 2vw, 1.75rem);
    align-items: start;
}

.rfp-wizard-shell[hidden] { display: none; }

/* Center column = existing .rfp-wizard */
.rfp-wizard-shell .rfp-wizard {
    max-width: 100%;
    padding: 0;
    margin: 0;
    grid-column: 2 / 3;
    grid-row: 1;
    min-width: 0;
}

/* ============================================================
   LEFT RAIL (Your Journey)
   ============================================================ */
.rfp-rail--left {
    grid-column: 1 / 2;
    grid-row: 1;
}

/* ============================================================
   RIGHT RAIL (Your Answers)
   ============================================================ */
.rfp-rail--right {
    grid-column: 3 / 4;
    grid-row: 1;
}

/* Shared rail positioning (both left & right) */
.rfp-rail {
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.35) transparent;
}

.rfp-rail::-webkit-scrollbar { width: 6px; }
.rfp-rail::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.35);
    border-radius: 3px;
}
.rfp-rail::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Below 1280px — hide right rail (per (1a) choice) */
@media (max-width: 1280px) {
    .rfp-wizard-shell {
        grid-template-columns: 280px minmax(0, 1fr);
        max-width: 1100px;
    }
    .rfp-rail--right { display: none; }
}

/* Below 1100px — hide left rail too, show chip strip */
@media (max-width: 1100px) {
    .rfp-wizard-shell {
        grid-template-columns: 1fr;
        gap: 0;
        max-width: 820px;
    }
    .rfp-rail { display: none; }
    .rfp-wizard-shell .rfp-wizard { grid-column: 1 / -1; }
    .rfp-chip-strip { display: flex; }
}

/* Below 500px — tighter spacing */
@media (max-width: 500px) {
    .rfp-chip-strip {
        padding: 0.15rem 0 0.4rem;
    }
    .rfp-chip {
        padding: 0.4rem 0.7rem;
        font-size: 0.7rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .rfp-rail-node[data-status="current"] .rfp-rail-node-badge,
    .rfp-recap-card {
        animation: none !important;
    }
    .rfp-rail-fill {
        transition: none !important;
    }
}

/* ============================================================
   DUAL NUMBER INPUT — percentage OR cgpa
   Used for A4 "final percentage / CGPA"
   ============================================================ */

.rfp-dual-wrap {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

/* "or" separator in the middle */
.rfp-dual-sep {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--rfp-ink-300);
    user-select: none;
    transition: color 0.25s ease;
}

/* When one side is active, highlight the "or" divider subtly */
.rfp-dual-wrap[data-active="percentage"] .rfp-dual-sep,
.rfp-dual-wrap[data-active="cgpa"] .rfp-dual-sep {
    color: var(--rfp-accent-deep);
}

/* Each side keeps the same input-wrap styling but full-width within its column */
.rfp-dual-wrap .rfp-input-wrap {
    width: 100%;
    min-width: 0;
}

/* Highlight the inactive side (dimmed) to reinforce "only one" */
.rfp-dual-wrap[data-active="percentage"] .rfp-dual-cell[data-key="cgpa"] .rfp-input-wrap,
.rfp-dual-wrap[data-active="cgpa"] .rfp-dual-cell[data-key="percentage"] .rfp-input-wrap {
    opacity: 0.55;
    border-color: rgba(15, 18, 38, 0.08);
    background: #fafbfc;
}

.rfp-dual-wrap[data-active="percentage"] .rfp-dual-cell[data-key="cgpa"] .rfp-input::placeholder,
.rfp-dual-wrap[data-active="cgpa"] .rfp-dual-cell[data-key="percentage"] .rfp-input::placeholder {
    color: var(--rfp-ink-300);
}

/* Small helper text below (already in .rfp-input-hint) */
.rfp-dual-hint {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--rfp-ink-500);
}

/* ---------- Mobile: stack vertically ---------- */
@media (max-width: 640px) {
    .rfp-dual-wrap {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    .rfp-dual-sep {
        padding: 0;
    }
    .rfp-dual-wrap[data-active="percentage"] .rfp-dual-cell[data-key="cgpa"] .rfp-input-wrap,
    .rfp-dual-wrap[data-active="cgpa"] .rfp-dual-cell[data-key="percentage"] .rfp-input-wrap {
        opacity: 1;
        background: #ffffff;
        border-color: var(--rfp-border-strong);
    }
}

/* ============================================================
   NATIVE DATE INPUT — A5 "date of passing"
   Styled to match the existing .rfp-input-wrap look
   ============================================================ */

/* Reuse the outer .rfp-input-wrap shell — this targets the input inside it */
.rfp-input[type="date"] {
    /* Ensure equal font metrics with other inputs */
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--rfp-ink-900);
    /* Remove iOS default centering quirks */
    -webkit-appearance: none;
    appearance: none;
    /* Give the native indicator some room */
    padding-right: 4px;
    min-height: 1.5rem;
    /* Hide the "hint" appearance on some browsers */
    background: transparent;
}

/* Remove the default calendar indicator so we can style our own */
.rfp-input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.2s ease;
    padding: 0 2px;
    margin-left: 4px;
}

.rfp-input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Mobile Safari — force the whole field to open the picker on tap */
@media (max-width: 640px) {
    .rfp-input[type="date"] {
        font-size: 0.95rem;
        padding-right: 2px;
    }
}

/* Firefox — date inputs get a slightly different style by default */
.rfp-input[type="date"]::-moz-focus-inner {
    border: 0;
}

/* ============================================================
   RIGHT-FIT RESULTS — FULL-SCREEN REPORT
   ============================================================ */

.rfp-results-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 28, 63, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.rfp-results-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.rfp-results-scroll {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding: clamp(1rem, 3vh, 2rem) clamp(0.75rem, 2vw, 1.5rem);
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 28, 63, 0.35) transparent;
}
.rfp-results-scroll::-webkit-scrollbar { width: 10px; }
.rfp-results-scroll::-webkit-scrollbar-thumb {
    background: rgba(15, 28, 63, 0.3);
    border-radius: 5px;
}

.rfp-results-page {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    background: #f7f8fc;
    border-radius: 24px;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    box-shadow: 0 40px 90px -20px rgba(15, 28, 63, 0.35);
    display: flex;
    flex-direction: column;
    gap: clamp(1.25rem, 2.5vw, 1.75rem);
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.rfp-results-modal.is-open .rfp-results-page {
    transform: translateY(0);
    opacity: 1;
}

/* Close */
.rfp-results-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(15, 28, 63, 0.08);
    border: none;
    display: grid;
    place-items: center;
    color: #0f1c3f;
    cursor: pointer;
    transition: all 0.22s ease;
    z-index: 10;
}
.rfp-results-close:hover {
    background: #ef4444;
    color: #fff;
    transform: rotate(90deg);
}
.rfp-results-close svg { width: 16px; height: 16px; }

/* ================= HEADER ================= */
.rfp-results-header {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: clamp(1rem, 2vw, 1.5rem);
    align-items: start;
}

.rfp-results-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.rfp-results-header-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.rfp-results-emoji {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1;
}

.rfp-results-title {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 800;
    color: #0f1c3f;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.rfp-results-sub {
    margin: 0;
    font-size: clamp(0.85rem, 1.1vw, 0.95rem);
    color: #4b5568;
    line-height: 1.55;
    max-width: 620px;
}

.rfp-results-sub-soft {
    margin: 0;
    font-size: clamp(0.78rem, 1vw, 0.85rem);
    color: #6b7280;
    line-height: 1.5;
    font-style: italic;
}

/* Download card */
.rfp-results-download-card {
    display: flex;
    gap: 0.9rem;
    background: linear-gradient(135deg, #eaf1ff 0%, #f4f0ff 100%);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: 16px;
    padding: 1rem 1.1rem;
}

.rfp-results-download-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #ffffff;
    display: grid;
    place-items: center;
    color: #2563eb;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.12);
}
.rfp-results-download-icon svg { width: 22px; height: 22px; }

.rfp-results-download-body h3 {
    margin: 0 0 0.3rem;
    font-size: 0.88rem;
    font-weight: 800;
    color: #0f1c3f;
    line-height: 1.25;
}
.rfp-results-download-body p {
    margin: 0 0 0.7rem;
    font-size: 0.72rem;
    color: #5b607f;
    line-height: 1.45;
}

.rfp-results-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1rem;
    background: #0f1c3f;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s ease;
    width: 100%;
    justify-content: center;
}
.rfp-results-download-btn:hover {
    background: #1e3a8a;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -6px rgba(15, 28, 63, 0.4);
}
.rfp-results-download-btn svg { width: 13px; height: 13px; }

/* ================= TOP 3 SHORTLIST ================= */
.rfp-results-top3-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(0.85rem, 1.5vw, 1.25rem);
}

.rfp-shortcard {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    border: 1.5px solid rgba(15, 28, 63, 0.08);
    padding: 1rem 1.1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.rfp-shortcard:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px -14px rgba(15, 28, 63, 0.18);
}
.rfp-shortcard--best {
    border-color: #10b981;
    box-shadow: 0 12px 28px -12px rgba(16, 185, 129, 0.3);
}

/* Top row: rank badge + (optional) best match pill */
.rfp-shortcard-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.rfp-shortcard-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 0.6rem;
    border-radius: 50px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}
.rfp-shortcard-rank--1 { background: #10b981; }
.rfp-shortcard-rank--2 { background: #2563eb; }
.rfp-shortcard-rank--3 { background: #7c3aed; }

.rfp-shortcard-best {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    background: #e6f8f0;
    color: #047857;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}
.rfp-shortcard-best svg { width: 11px; height: 11px; }

/* University row */
.rfp-shortcard-uni-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.rfp-shortcard-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid rgba(15, 28, 63, 0.08);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
}
.rfp-shortcard-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}
.rfp-shortcard-uni-text { min-width: 0; }
.rfp-shortcard-uni-name {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 800;
    color: #0f1c3f;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rfp-shortcard-uni-country {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 500;
    color: #6b7280;
}

/* Program */
.rfp-shortcard-program {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
    color: #0f1c3f;
    line-height: 1.3;
}
.rfp-shortcard-program-sub {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: #5b607f;
    line-height: 1.35;
}

/* Pills */
.rfp-shortcard-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.rfp-shortcard-pill {
    padding: 0.28rem 0.6rem;
    background: #f1f3f9;
    color: #4b5568;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Bottom: score + fit band */
.rfp-shortcard-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(15, 28, 63, 0.07);
    margin-top: auto;
}
.rfp-shortcard-stat-label {
    font-size: 0.68rem;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 0.15rem;
    display: block;
}
.rfp-shortcard-score {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: #0f1c3f;
}
.rfp-shortcard-score span {
    font-size: 0.8rem;
    font-weight: 600;
    color: #9ca3af;
}
.rfp-shortcard-score--1 { color: #10b981; }
.rfp-shortcard-score--2 { color: #2563eb; }
.rfp-shortcard-score--3 { color: #7c3aed; }

.rfp-shortcard-fit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    align-self: flex-end;
}
.rfp-shortcard-fit--excellent {
    background: #d1fae5;
    color: #047857;
    border: 1px solid #a7f3d0;
}
.rfp-shortcard-fit--strong {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.rfp-shortcard-fit--strong-purple {
    background: #ede9fe;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}

/* ================= BEST MATCH DETAIL ================= */
.rfp-best {
    background: linear-gradient(180deg, #eafaf3 0%, #f5fbf8 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 20px;
    overflow: hidden;
}

/* Top strip */
.rfp-best-strip {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1.1rem 1.4rem;
    background: rgba(255, 255, 255, 0.75);
    border-bottom: 1px solid rgba(16, 185, 129, 0.15);
}
.rfp-best-strip-rank {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 6px 14px -4px rgba(16, 185, 129, 0.5);
}
.rfp-best-strip-mid h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f1c3f;
    line-height: 1.2;
}
.rfp-best-strip-mid p {
    margin: 0.15rem 0 0;
    font-size: 0.8rem;
    color: #4b5568;
}

.rfp-best-strip-stats {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}
.rfp-best-strip-stat { text-align: left; }
.rfp-best-strip-stat-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #6b7280;
    display: block;
    margin-bottom: 0.15rem;
}
.rfp-best-strip-stat-score {
    font-size: 1.35rem;
    font-weight: 800;
    color: #10b981;
    line-height: 1;
}
.rfp-best-strip-stat-score span {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 600;
}
.rfp-best-strip-fit {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    background: #d1fae5;
    color: #047857;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    border: 1px solid #a7f3d0;
}

/* 3-column body */
.rfp-best-body {
    display: grid;
    grid-template-columns: 1.15fr 1fr 1fr;
    gap: clamp(1rem, 2vw, 1.5rem);
    padding: clamp(1.1rem, 2.4vw, 1.6rem);
}

/* Left column */
.rfp-best-left .rfp-shortcard-uni-row {
    margin-bottom: 0.75rem;
}
.rfp-best-left .rfp-shortcard-program {
    font-size: 1.15rem;
    margin-bottom: 0.2rem;
}
.rfp-best-left .rfp-shortcard-program-sub {
    font-size: 0.88rem;
    margin-bottom: 0.75rem;
}

.rfp-best-desc {
    font-size: 0.82rem;
    color: #4b5568;
    line-height: 1.55;
    margin: 0 0 0.9rem;
}

.rfp-best-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.rfp-best-info-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
}
.rfp-best-info-row svg {
    width: 15px;
    height: 15px;
    color: #6b7280;
    flex-shrink: 0;
}
.rfp-best-info-row strong {
    color: #0f1c3f;
    font-weight: 700;
    min-width: 85px;
}
.rfp-best-info-row span {
    color: #4b5568;
}

/* Middle column */
.rfp-best-mid h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f1c3f;
}
.rfp-best-mid h4 svg {
    width: 18px;
    height: 18px;
    color: #10b981;
}

.rfp-best-why {
    list-style: none;
    margin: 0 0 1.1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.rfp-best-why li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #374151;
    line-height: 1.45;
}
.rfp-best-why li svg {
    width: 15px;
    height: 15px;
    color: #10b981;
    flex-shrink: 0;
    margin-top: 2px;
}

.rfp-best-highlights {
    background: #fffbe8;
    border: 1px solid #fde68a;
    border-left: 4px solid #fbbf24;
    border-radius: 10px;
    padding: 0.85rem 0.95rem;
}
.rfp-best-highlights h5 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.5rem;
    font-size: 0.82rem;
    font-weight: 800;
    color: #92400e;
}
.rfp-best-highlights h5 svg {
    width: 14px;
    height: 14px;
    color: #d97706;
}
.rfp-best-highlights ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.rfp-best-highlights li {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #78350f;
    line-height: 1.45;
}
.rfp-best-highlights li::before {
    content: '•';
    color: #d97706;
    font-weight: 800;
    flex-shrink: 0;
}

/* Right column — score breakdown */
.rfp-best-right h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.85rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f1c3f;
}
.rfp-best-right h4 svg {
    width: 18px;
    height: 18px;
    color: #10b981;
}

.rfp-bar-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.rfp-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.rfp-bar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.rfp-bar-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.3;
}
.rfp-bar-score {
    font-size: 0.72rem;
    font-weight: 800;
    color: #10b981;
    white-space: nowrap;
}
.rfp-bar-score--blue { color: #2563eb; }

.rfp-bar-track {
    position: relative;
    height: 7px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}
.rfp-bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.rfp-bar-fill--blue {
    background: linear-gradient(90deg, #60a5fa 0%, #2563eb 100%);
}

/* ================= NEXT STEPS ================= */
.rfp-results-next-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: clamp(1rem, 2vw, 1.75rem);
    align-items: center;
    background: #ffffff;
    border: 1px solid rgba(15, 28, 63, 0.08);
    border-radius: 18px;
    padding: clamp(1.1rem, 2.4vw, 1.5rem) clamp(1.1rem, 2.4vw, 1.75rem);
    box-shadow: 0 8px 22px -12px rgba(15, 28, 63, 0.1);
}

.rfp-results-next-title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.25rem;
}
.rfp-results-next-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #eef2ff;
    color: #4f46e5;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.rfp-results-next-icon svg { width: 18px; height: 18px; }
.rfp-results-next-title-row h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f1c3f;
}
.rfp-results-next-sub {
    margin: 0 0 1rem;
    font-size: 0.82rem;
    color: #4b5568;
}

.rfp-results-steps {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.rfp-results-step {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}
.rfp-results-step-num {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #4b5568;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    font-weight: 800;
}
.rfp-results-step-text {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    color: #4b5568;
    line-height: 1.3;
}
.rfp-results-step-text strong {
    color: #0f1c3f;
    font-weight: 700;
}
.rfp-results-step-arrow {
    color: #9ca3af;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.rfp-results-next-right {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 260px;
}

.rfp-results-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.22s ease;
    border: none;
    white-space: nowrap;
}
.rfp-results-cta svg { width: 14px; height: 14px; }

.rfp-results-cta--dark {
    background: #0f1c3f;
    color: #fff;
    box-shadow: 0 8px 18px -6px rgba(15, 28, 63, 0.4);
}
.rfp-results-cta--dark:hover {
    background: #1e3a8a;
    transform: translateY(-2px);
}

.rfp-results-cta--outline {
    background: #ffffff;
    color: #0f1c3f;
    border: 1.5px solid #0f1c3f;
}
.rfp-results-cta--outline:hover {
    background: #0f1c3f;
    color: #fff;
    transform: translateY(-2px);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .rfp-results-header { grid-template-columns: 1fr; }
    .rfp-results-download-card { max-width: 420px; }

    .rfp-best-body { grid-template-columns: 1fr 1fr; }
    .rfp-best-right { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
    .rfp-results-top3-grid {
        grid-template-columns: 1fr;
        max-width: 420px;
        margin: 0 auto;
    }
    .rfp-shortcard { min-height: auto; }

    .rfp-best-strip {
        grid-template-columns: auto 1fr;
    }
    .rfp-best-strip-stats {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-top: 0.5rem;
        border-top: 1px dashed rgba(16, 185, 129, 0.25);
    }

    .rfp-best-body { grid-template-columns: 1fr; }
    .rfp-best-right { grid-column: auto; }

    .rfp-results-next-inner {
        grid-template-columns: 1fr;
    }
    .rfp-results-next-right { min-width: 0; }
    .rfp-results-cta { width: 100%; }
}

@media (max-width: 480px) {
    .rfp-results-page {
        padding: 1rem;
        border-radius: 18px;
    }
    .rfp-results-title { font-size: 1.35rem; }
    .rfp-results-emoji { font-size: 1.5rem; }
    .rfp-results-sub { font-size: 0.82rem; }

    .rfp-shortcard { padding: 0.9rem; }
    .rfp-shortcard-score { font-size: 1.3rem; }

    .rfp-best-strip { padding: 0.85rem 1rem; gap: 0.7rem; }
    .rfp-best-strip-rank { width: 42px; height: 42px; }
    .rfp-best-strip-stat-score { font-size: 1.15rem; }

    .rfp-results-steps { gap: 0.4rem; }
    .rfp-results-step-arrow { font-size: 0.9rem; }
    .rfp-results-step-text { font-size: 0.7rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .rfp-results-modal,
    .rfp-results-page,
    .rfp-shortcard,
    .rfp-bar-fill {
        transition: none !important;
    }
}

/* This MUST exist — no older rule should override it */
.rfp-results-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 28, 63, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.rfp-results-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.rfp-results-scroll {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding: clamp(1rem, 3vh, 2rem) clamp(0.75rem, 2vw, 1.5rem);
}

.rfp-results-page {
    position: relative;
    max-width: 1200px;   /* ← THIS gives the full width */
    margin: 0 auto;
    background: #f7f8fc;
    border-radius: 24px;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    box-shadow: 0 40px 90px -20px rgba(15, 28, 63, 0.35);
    display: flex;
    flex-direction: column;
    gap: clamp(1.25rem, 2.5vw, 1.75rem);
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

/* ============================================================
   DEFENSIVE FIX — Force the results modal to the viewport
   ============================================================ */
.rfp-results-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    margin: 0 !important;
    /* NOTE: do NOT reset transform / backdrop-filter — these are
       needed for the modal's own styling. The problem was never the
       modal itself — it was the transformed ancestor. Fix = HTML move. */
}

.rfp-results-page {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
}

.rfp-results-scroll {
    width: 100% !important;
    height: 100% !important;
}

/* ============================================================
   RESULT FORM — Back to previous question link
   ============================================================ */
.rfp-result-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem auto 0;
    padding: 0.7rem 1.25rem;
    background: transparent;
    border: 1.5px solid var(--rfp-border-strong);
    border-radius: 999px;
    color: var(--rfp-ink-700);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s ease;
    text-decoration: none;
}

.rfp-result-back svg {
    width: 14px;
    height: 14px;
    transition: transform 0.22s ease;
}

.rfp-result-back:hover {
    border-color: var(--rfp-accent);
    color: var(--rfp-accent-deep);
    background: rgba(99, 102, 241, 0.04);
    transform: translateY(-1px);
}

.rfp-result-back:hover svg {
    transform: translateX(-3px);
}

.rfp-result-back:focus-visible {
    outline: 2px solid var(--rfp-accent);
    outline-offset: 2px;
}

/* Center the back button inside the result card (card is text-align:center) */
.rfp-result-card .rfp-result-back {
    align-self: center;
}

/* Mobile */
@media (max-width: 480px) {
    .rfp-result-back {
        font-size: 0.8rem;
        padding: 0.6rem 1rem;
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   YEAR SELECT — Q5 "Year of passing"
   Matches the .rfp-input-wrap visual, native select styled.
   ============================================================ */
.rfp-input-wrap--select {
    padding-right: 0.5rem; /* room for the caret */
}

.rfp-input--select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c6c8a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 14px 14px;
    padding-right: 2.5rem;
}

.rfp-input--select:focus {
    outline: none;
}

/* Ensure the selected option looks right */
.rfp-input--select option {
    color: var(--rfp-ink-900);
    background: #ffffff;
}

.rfp-input--select option:disabled {
    color: var(--rfp-ink-300);
}

/* ============================================================
   DUAL NUMBER INPUT — invalid flash when out of range
   ============================================================ */
.rfp-input.rfp-input--invalid {
    color: #ef4444;
    animation: rfpInvalidFlash 0.4s ease;
}

@keyframes rfpInvalidFlash {
    0%, 100% { background: transparent; }
    50%      { background: rgba(239, 68, 68, 0.08); }
}