.ffa-root * { box-sizing: border-box; }
.ffa-root {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 620px;
    margin: 32px auto;
    color: #1a1a2e;
    line-height: 1.6;
}

/* ---------------------------------------------------------------
 * Quiz card
 * ------------------------------------------------------------- */
.ffa-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    padding: 36px 40px 32px;
    position: relative;
}

/* Progress bar */
.ffa-progress-wrap {
    background: #e5e7eb;
    border-radius: 99px;
    height: 6px;
    margin-bottom: 8px;
    overflow: hidden;
}
.ffa-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6d28d9, #2563eb);
    border-radius: 99px;
    transition: width 0.4s ease;
}
.ffa-progress-text {
    font-size: 12px;
    color: #9ca3af;
    text-align: right;
    margin-bottom: 24px;
}

.ffa-question {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 8px;
    line-height: 1.3;
    color: #1a1a2e;
}
.ffa-hint {
    font-size: 14px;
    color: #4b5563;
    margin: 0 0 24px;
    line-height: 1.65;
    background: #f8fafc;
    border-left: 3px solid #e5e7eb;
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
}

/* Select */
.ffa-input-wrap { position: relative; }
.ffa-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    color: #1a1a2e;
    appearance: none;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s;
}
.ffa-select:focus { outline: none; border-color: #6d28d9; }

/* Stepper */
.ffa-stepper {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 8px 0 4px;
}
.ffa-step-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid #6d28d9;
    background: #fff;
    color: #6d28d9;
    font-size: 26px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    padding: 0;
    line-height: 1;
}
.ffa-step-btn:hover { background: #6d28d9; color: #fff; }
.ffa-step-val {
    font-size: 36px;
    font-weight: 800;
    min-width: 48px;
    text-align: center;
    color: #1a1a2e;
}
.ffa-step-lbl { font-size: 16px; color: #6b7280; }

/* Income input */
.ffa-income-wrap {
    display: flex;
    align-items: center;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.ffa-income-wrap:focus-within { border-color: #6d28d9; }
.ffa-income-pre {
    padding: 0 16px;
    font-size: 22px;
    font-weight: 600;
    color: #6b7280;
    background: #f9fafb;
    border-right: 2px solid #d1d5db;
    height: 56px;
    display: flex;
    align-items: center;
}
.ffa-income-input {
    border: none;
    outline: none;
    padding: 16px 18px;
    font-size: 20px;
    width: 100%;
    background: transparent;
    color: #1a1a2e;
    font-family: inherit;
}

/* Chips */
.ffa-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 4px;
}
.ffa-chip {
    padding: 10px 18px;
    border-radius: 99px;
    border: 2px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    font-family: inherit;
    line-height: 1.4;
}
.ffa-chip:hover { border-color: #6d28d9; }
.ffa-chip-active { border-color: #6d28d9; background: #6d28d9; color: #fff; }

/* Validation error */
.ffa-step-error {
    color: #dc2626;
    font-size: 13px;
    font-weight: 600;
    margin: 8px 0 0;
}

/* Nav */
.ffa-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 28px;
    gap: 12px;
}
.ffa-back-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 4px;
    font-family: inherit;
    transition: color 0.15s;
}
.ffa-back-btn:hover { color: #1a1a2e; }
.ffa-next-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, #6d28d9, #2563eb);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    font-family: inherit;
}
.ffa-next-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ---------------------------------------------------------------
 * Results
 * ------------------------------------------------------------- */
.ffa-results {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    overflow: hidden;
}

.ffa-results-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    padding: 32px 36px;
    color: #fff;
}
.ffa-results-summary-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.ffa-fpl-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.ffa-fpl-num {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
}
.ffa-fpl-lbl {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    margin-top: 2px;
}
.ffa-match-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ffa-match-pill {
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 700;
}
.ffa-match-likely { background: rgba(209,250,229,0.2); color: #d1fae5; border: 1px solid rgba(209,250,229,0.4); }
.ffa-match-maybe  { background: rgba(254,243,199,0.2); color: #fef3c7; border: 1px solid rgba(254,243,199,0.4); }
.ffa-results-intro { font-size: 15px; color: rgba(255,255,255,0.88); margin: 0; line-height: 1.6; }

/* CTA wrap */
.ffa-cta-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px 36px 24px;
    border-top: 1px solid #e5e7eb;
}
.ffa-cta-bottom {
    border-top: 1px solid #e5e7eb;
}
.ffa-cta {
    display: block;
    width: 100%;
    text-align: center;
    padding: 15px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none !important;
    transition: opacity 0.2s;
}
.ffa-cta:hover { opacity: 0.88; }
.ffa-cta-primary  { background: #6d28d9; color: #fff !important; }
.ffa-cta-secondary { background: #fff; color: #6d28d9 !important; border: 2px solid #6d28d9; }

/* Program list */
.ffa-prog-list {
    padding: 24px 36px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ffa-prog-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px 20px;
}
.ffa-prog-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.ffa-prog-name {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
}
.ffa-prog-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    white-space: nowrap;
}
.ffa-prog-summary {
    font-size: 14px;
    color: #374151;
    margin: 0 0 4px;
    font-weight: 600;
}
.ffa-prog-detail {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 10px;
    line-height: 1.5;
}
.ffa-prog-link {
    font-size: 13px;
    font-weight: 700;
    color: #2563eb !important;
    text-decoration: none !important;
}
.ffa-prog-link:hover { text-decoration: underline !important; }

/* FPL explanation callout */
.ffa-fpl-explain {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    padding: 18px 24px;
    margin: 24px 28px 4px;
}
.ffa-fpl-explain-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.ffa-fpl-explain strong { font-size: 14px; font-weight: 700; color: #1e3a5f; display: block; margin-bottom: 4px; }
.ffa-fpl-explain p { font-size: 13px; color: #374151; margin: 0; line-height: 1.65; }

/* Section labels */
.ffa-section-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 28px 8px;
}
.ffa-section-label span {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #374151;
    white-space: nowrap;
}
.ffa-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}
.ffa-section-label--dim span { color: #9ca3af; }

/* Over-limit intro text */
.ffa-check-intro {
    font-size: 13px;
    color: #6b7280;
    padding: 0 28px 4px;
    margin: 0;
    line-height: 1.6;
}

/* Dimmed card for over-limit programs */
.ffa-prog-card--dim {
    opacity: 0.75;
    background: #fafafa;
}
.ffa-prog-card--dim .ffa-prog-name { color: #6b7280; }

/* No-match message */
.ffa-no-match {
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 14px;
    padding: 16px 20px;
    margin: 8px 28px 4px;
    font-size: 14px;
    color: #92400e;
    line-height: 1.6;
}
.ffa-no-match p { margin: 0; }

.ffa-results-disclaimer {
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    padding: 0 36px 16px;
    margin: 0;
    line-height: 1.6;
}

.ffa-restart-btn {
    display: block;
    margin: 0 auto 28px;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    padding: 4px 8px;
    transition: color 0.15s;
}
.ffa-restart-btn:hover { color: #374151; }

/* ---------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------- */
@media (max-width: 520px) {
    .ffa-card, .ffa-results-header, .ffa-cta-wrap, .ffa-prog-list { padding-left: 20px; padding-right: 20px; }
    .ffa-card { padding-top: 24px; padding-bottom: 24px; }
    .ffa-question { font-size: 19px; }
    .ffa-fpl-num { font-size: 38px; }
    .ffa-cta-wrap { flex-direction: column; }
    .ffa-cta { text-align: center; }
}
