/* ─────────────────────────────────────────────────────────────────────────────
   First-Gen Fit Score — style.css  v1.0.0
   Aesthetic: Warm academic guidance. Forest green + cream + terracotta accent.
   Fonts: Zilla Slab (display) + Outfit (body)
───────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Zilla+Slab:ital,wght@0,400;0,500;0,600;1,400&family=Outfit:wght@300;400;500;600&display=swap');

/* ── Tokens ─────────────────────────────────────────────────────────────── */
.fgfs-wrap {
    --c-bg:        #f7f3ec;
    --c-surface:   #ffffff;
    --c-border:    #ddd5c3;
    --c-green:     #2d6a4f;
    --c-green-lt:  #52b788;
    --c-green-xlt: #d8f3dc;
    --c-terra:     #bc6c25;
    --c-text:      #1b2b1e;
    --c-muted:     #6b7a6f;
    --c-error:     #b5371a;
    --c-score-hi:  #2d6a4f;
    --c-score-md:  #bc6c25;
    --c-score-lo:  #888;
    --r:           16px;
    --r-sm:        10px;
    --shadow:      0 4px 24px rgba(30,50,35,.10);
    --shadow-card: 0 2px 12px rgba(30,50,35,.08);
    --transition:  .2s cubic-bezier(.4,0,.2,1);

    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    color: var(--c-text);
    max-width: 760px;
    margin: 2rem auto;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.fgfs-hero {
    background: var(--c-green);
    padding: 36px 36px 32px;
    position: relative;
    overflow: hidden;
}

.fgfs-hero::after {
    content: '';
    position: absolute;
    right: -40px; bottom: -40px;
    width: 220px; height: 220px;
    border-radius: 50%;
    background: rgba(255,255,255,.05);
    pointer-events: none;
}

.fgfs-hero-eyebrow {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--c-green-lt);
    margin-bottom: 8px;
}

.fgfs-hero-title {
    font-family: 'Zilla Slab', serif;
    font-size: 2rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 10px;
    line-height: 1.2;
}

.fgfs-hero-sub {
    font-size: .9rem;
    color: rgba(255,255,255,.72);
    max-width: 520px;
    line-height: 1.6;
    margin: 0;
}

/* ── Quiz body ───────────────────────────────────────────────────────────── */
#fgfs-quiz {
    padding: 0 36px 28px;
}

@media (max-width: 520px) {
    .fgfs-hero { padding: 24px 20px 20px; }
    #fgfs-quiz { padding: 0 16px 20px; }
    .fgfs-hero-title { font-size: 1.5rem; }
}

/* ── Step ────────────────────────────────────────────────────────────────── */
.fgfs-step {
    padding: 22px 0 18px;
    border-bottom: 1px solid var(--c-border);
}

.fgfs-step:last-of-type { border-bottom: none; }

.fgfs-step-hd {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.fgfs-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--c-green);
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.fgfs-step.is-skipped .fgfs-step-num {
    background: var(--c-border);
    color: var(--c-muted);
}

.fgfs-step-label {
    font-weight: 500;
    font-size: .95rem;
    flex: 1;
    color: var(--c-text);
}

.fgfs-step.is-skipped .fgfs-step-label {
    color: var(--c-muted);
    text-decoration: line-through;
    text-decoration-color: var(--c-border);
}

.fgfs-skip-btn {
    font-family: inherit;
    font-size: .78rem;
    color: var(--c-muted);
    background: none;
    border: 1px solid var(--c-border);
    border-radius: 100px;
    padding: 3px 12px;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
    margin-left: auto;
}
.fgfs-skip-btn:hover {
    color: var(--c-terra);
    border-color: var(--c-terra);
    background: rgba(188,108,37,.05);
}
.fgfs-step.is-skipped .fgfs-skip-btn {
    color: var(--c-green);
    border-color: var(--c-green-lt);
    background: var(--c-green-xlt);
}

/* ── Pill group ──────────────────────────────────────────────────────────── */
.fgfs-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fgfs-pill {
    font-family: inherit;
    font-size: .875rem;
    padding: 8px 18px;
    border-radius: 100px;
    border: 1.5px solid var(--c-border);
    background: var(--c-surface);
    color: var(--c-text);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.fgfs-pill em {
    font-style: normal;
    font-size: .78rem;
    color: var(--c-muted);
}

.fgfs-pill:hover {
    border-color: var(--c-green);
    background: var(--c-green-xlt);
    color: var(--c-green);
}

.fgfs-pill.is-active {
    background: var(--c-green);
    border-color: var(--c-green);
    color: #fff;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(45,106,79,.3);
}

.fgfs-pill.is-active em { color: rgba(255,255,255,.7); }

.fgfs-step.is-skipped .fgfs-pill-group,
.fgfs-step.is-skipped .fgfs-budget-ui,
.fgfs-step.is-skipped .fgfs-select-wrap {
    opacity: .35;
    pointer-events: none;
}

/* ── Budget sliders ──────────────────────────────────────────────────────── */
.fgfs-budget-ui {}

.fgfs-range-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.fgfs-range-block {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fgfs-range-sep {
    align-self: center;
    color: var(--c-muted);
    font-size: 1.2rem;
    padding-top: 20px;
}

.fgfs-range-lbl {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--c-muted);
    font-weight: 500;
}

.fgfs-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 4px;
    background: var(--c-border);
    outline: none;
    cursor: pointer;
}

.fgfs-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--c-green);
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(45,106,79,.2);
    transition: box-shadow var(--transition);
}
.fgfs-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 5px rgba(45,106,79,.25);
}

.fgfs-range-val {
    font-family: 'Zilla Slab', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--c-green);
}

/* ── Select ──────────────────────────────────────────────────────────────── */
.fgfs-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 280px;
}

.fgfs-select {
    width: 100%;
    padding: 10px 38px 10px 14px;
    appearance: none;
    background: var(--c-surface);
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-sm);
    color: var(--c-text);
    font-family: inherit;
    font-size: .95rem;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.fgfs-select:focus {
    border-color: var(--c-green);
    box-shadow: 0 0 0 3px rgba(45,106,79,.15);
}
.fgfs-caret {
    position: absolute;
    right: 10px;
    pointer-events: none;
    color: var(--c-muted);
}

/* ── CTA row ─────────────────────────────────────────────────────────────── */
.fgfs-cta-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 24px;
    flex-wrap: wrap;
}

.fgfs-run-btn {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 13px 32px;
    background: var(--c-green);
    color: #fff;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(45,106,79,.35);
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.fgfs-run-btn:hover {
    background: #245a41;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(45,106,79,.4);
}
.fgfs-run-btn:active { transform: none; }
.fgfs-run-btn:disabled { opacity: .6; cursor: default; transform: none; }

.fgfs-reset-btn {
    font-family: inherit;
    font-size: .875rem;
    color: var(--c-muted);
    background: none;
    border: 1px solid var(--c-border);
    border-radius: 100px;
    padding: 10px 20px;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}
.fgfs-reset-btn:hover { color: var(--c-terra); border-color: var(--c-terra); }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.fgfs-spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: fgfs-spin .65s linear infinite;
}
@keyframes fgfs-spin { to { transform: rotate(360deg); } }

/* ── Error ───────────────────────────────────────────────────────────────── */
.fgfs-error {
    margin: 16px 36px 0;
    padding: 14px 18px;
    background: rgba(181,55,26,.08);
    border: 1px solid rgba(181,55,26,.3);
    border-radius: var(--r-sm);
    color: var(--c-error);
    font-size: .9rem;
    line-height: 1.5;
}

/* ── Results section ─────────────────────────────────────────────────────── */
#fgfs-results {
    padding: 0 36px 36px;
    animation: fgfs-fadein .4s ease;
}

@keyframes fgfs-fadein {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fgfs-results-hd {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 24px 0 18px;
    border-bottom: 2px solid var(--c-border);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.fgfs-results-title {
    font-family: 'Zilla Slab', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--c-text);
}

.fgfs-results-sub {
    font-size: .82rem;
    color: var(--c-muted);
    margin-top: 2px;
}

.fgfs-refine-btn {
    font-family: inherit;
    font-size: .82rem;
    color: var(--c-green);
    background: var(--c-green-xlt);
    border: 1px solid rgba(45,106,79,.25);
    border-radius: 100px;
    padding: 6px 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition);
}
.fgfs-refine-btn:hover { background: #c0eacc; }

/* ── School cards ────────────────────────────────────────────────────────── */
.fgfs-cards-grid {
    display: grid;
    gap: 14px;
}

.fgfs-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    padding: 18px 20px;
    display: grid;
    grid-template-columns: 52px 1fr auto;
    gap: 0 16px;
    align-items: start;
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
    animation: fgfs-cardslide .35s ease both;
}

.fgfs-card:hover {
    box-shadow: 0 6px 24px rgba(30,50,35,.13);
    transform: translateY(-2px);
    border-color: rgba(45,106,79,.3);
}

@keyframes fgfs-cardslide {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* staggered reveal */
.fgfs-card:nth-child(1)  { animation-delay: .03s; }
.fgfs-card:nth-child(2)  { animation-delay: .06s; }
.fgfs-card:nth-child(3)  { animation-delay: .09s; }
.fgfs-card:nth-child(4)  { animation-delay: .12s; }
.fgfs-card:nth-child(5)  { animation-delay: .15s; }
.fgfs-card:nth-child(6)  { animation-delay: .18s; }
.fgfs-card:nth-child(7)  { animation-delay: .21s; }
.fgfs-card:nth-child(8)  { animation-delay: .24s; }
.fgfs-card:nth-child(9)  { animation-delay: .27s; }
.fgfs-card:nth-child(10) { animation-delay: .30s; }

/* Rank badge */
.fgfs-rank {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2px;
}

.fgfs-rank-num {
    font-family: 'Zilla Slab', serif;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1;
    color: var(--c-muted);
}

.fgfs-card:nth-child(1) .fgfs-rank-num { color: var(--c-green); font-size: 1.7rem; }
.fgfs-card:nth-child(2) .fgfs-rank-num { color: var(--c-green); }
.fgfs-card:nth-child(3) .fgfs-rank-num { color: var(--c-terra); }

.fgfs-rank-label {
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--c-muted);
    margin-top: 1px;
}

/* Card body */
.fgfs-card-body {}

.fgfs-card-name {
    font-family: 'Zilla Slab', serif;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--c-text);
    line-height: 1.25;
    margin-bottom: 2px;
}

.fgfs-card-name a {
    color: inherit;
    text-decoration: none;
}
.fgfs-card-name a:hover { color: var(--c-green); text-decoration: underline; }

.fgfs-card-location {
    font-size: .8rem;
    color: var(--c-muted);
    margin-bottom: 12px;
}

/* Stats row */
.fgfs-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fgfs-stat {
    display: flex;
    flex-direction: column;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 6px 12px;
    min-width: 80px;
}

.fgfs-stat-val {
    font-family: 'Zilla Slab', serif;
    font-size: 1rem;
    font-weight: 500;
    color: var(--c-text);
    line-height: 1.2;
}

.fgfs-stat.is-highlight .fgfs-stat-val { color: var(--c-green); }
.fgfs-stat.is-budget    .fgfs-stat-val { color: var(--c-terra); }

.fgfs-stat-lbl {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--c-muted);
    margin-top: 1px;
}

/* Ownership chip */
.fgfs-type-chip {
    display: inline-block;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: 2px 8px;
    border-radius: 100px;
    border: 1px solid var(--c-border);
    color: var(--c-muted);
    background: var(--c-bg);
    margin-bottom: 8px;
}

/* Score donut on right side */
.fgfs-card-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2px;
    min-width: 58px;
}

.fgfs-score-ring {
    position: relative;
    width: 52px; height: 52px;
}

.fgfs-score-ring svg {
    transform: rotate(-90deg);
}

.fgfs-score-ring-bg {
    fill: none;
    stroke: var(--c-border);
    stroke-width: 4;
}

.fgfs-score-ring-fill {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset .6s ease;
}

.fgfs-score-num {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Zilla Slab', serif;
    font-size: .95rem;
    font-weight: 600;
    color: var(--c-text);
}

.fgfs-score-lbl {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--c-muted);
    margin-top: 4px;
    text-align: center;
}

@media (max-width: 520px) {
    .fgfs-card {
        grid-template-columns: 40px 1fr;
        grid-template-rows: auto auto;
    }
    .fgfs-card-score {
        grid-column: 2;
        grid-row: 1;
        flex-direction: row;
        gap: 6px;
        align-items: center;
        justify-content: flex-end;
        min-width: unset;
    }
    #fgfs-results { padding: 0 16px 24px; }
}

/* ── Attribution ─────────────────────────────────────────────────────────── */
.fgfs-attr {
    font-size: .73rem;
    color: var(--c-muted);
    text-align: center;
    padding: 0 36px 20px;
    line-height: 1.6;
    margin: 0;
}
.fgfs-attr a { color: var(--c-muted); }
.fgfs-attr a:hover { color: var(--c-green); }
