/* ═══════════════════════════════════════════════
   CAASPPTest — Main Stylesheet
   ═══════════════════════════════════════════════ */

:root {
  --blue:     #1a237e;
  --blue-mid: #283593;
  --blue-lt:  #3949ab;
  --accent:   #f57c00;
  --green:    #388e3c;
  --red:      #d32f2f;
  --yellow:   #f9a825;
  --text:     #1a1a2e;
  --text-2:   #444;
  --text-3:   #666;
  --border:   #e0e4ef;
  --bg:       #f5f7fa;
  --card:     #ffffff;
  --radius:   12px;
  --shadow:   0 2px 16px rgba(26,35,126,.08);
  --shadow-lg:0 8px 40px rgba(26,35,126,.13);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: var(--blue-lt); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* ── UTILITIES ────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

.section { padding: 4rem 1.25rem; }
.section-alt { background: #fff; }
.section-title { font-size: 2rem; font-weight: 800; text-align: center; margin-bottom: .5rem; color: var(--blue); }
.section-sub { text-align: center; color: var(--text-3); margin-bottom: 2.5rem; }

/* ── BUTTONS ──────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .6rem 1.4rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: .95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .18s ease;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary  { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-mid); border-color: var(--blue-mid); color: #fff; }

.btn-outline   { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: #fff; }

.btn-danger    { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #b71c1c; border-color: #b71c1c; color: #fff; }

.btn-sm  { padding: .4rem 1rem; font-size: .85rem; }
.btn-lg  { padding: .85rem 2rem; font-size: 1.05rem; border-radius: 10px; }
.btn-full { width: 100%; }

/* ── NAV ──────────────────────────────────────── */
.nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav-logo { display: flex; align-items: center; gap: .5rem; text-decoration: none; }
.logo-icon { font-size: 1.4rem; }
.logo-text { font-family: 'Nunito', sans-serif; font-size: 1.2rem; font-weight: 800; color: var(--blue); }
.nav-links { display: flex; align-items: center; gap: 1.25rem; }
.nav-link { color: var(--text-2); font-weight: 500; font-size: .92rem; transition: color .15s; }
.nav-link:hover { color: var(--blue); text-decoration: none; }
.nav-badge { font-size: .75rem; font-weight: 700; padding: .2rem .6rem; border-radius: 20px; }
.badge-premium { background: #fff8e1; color: #f57c00; border: 1px solid #f57c00; }
.badge-free { background: #f3f3f3; color: #666; border: 1px solid #ddd; }

/* ── HERO ─────────────────────────────────────── */
.hero { background: linear-gradient(135deg, var(--blue) 0%, #1565c0 100%); color: #fff; padding: 4rem 1.25rem; }
.hero-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 420px; gap: 3rem; align-items: center; }
.hero-badge { display: inline-block; background: rgba(255,255,255,.15); color: #fff; font-size: .8rem; font-weight: 600; padding: .3rem .9rem; border-radius: 20px; margin-bottom: 1rem; letter-spacing: .3px; }
.hero-title { font-family: 'Nunito', sans-serif; font-size: 3rem; font-weight: 800; line-height: 1.15; margin-bottom: 1rem; }
.hero-accent { color: #ffd54f; }
.hero-sub { font-size: 1.1rem; opacity: .9; margin-bottom: 2rem; line-height: 1.7; max-width: 520px; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.hero-actions .btn-outline { color: #fff; border-color: rgba(255,255,255,.6); }
.hero-actions .btn-outline:hover { background: rgba(255,255,255,.15); }
.hero-trust { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: .85rem; opacity: .85; }

/* Score Demo Card */
.hero-card { }
.score-demo { background: #fff; color: var(--text); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-lg); }
.score-demo-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); margin-bottom: .25rem; }
.score-demo-grade { font-size: .9rem; font-weight: 600; color: var(--blue); margin-bottom: .5rem; }
.score-demo-score { font-size: 3.5rem; font-weight: 900; color: var(--blue); line-height: 1; margin-bottom: .5rem; }
.score-demo-level { display: inline-block; color: #fff; font-size: .85rem; font-weight: 700; padding: .3rem 1rem; border-radius: 20px; margin-bottom: 1rem; }
.score-bar-track { height: 8px; background: #e0e0e0; border-radius: 4px; margin-bottom: .5rem; overflow: hidden; position: relative; }
.score-bar-fill { height: 100%; border-radius: 4px; transition: width .8s ease; }
.score-bar-labels { display: flex; justify-content: space-between; font-size: .7rem; color: var(--text-3); }
.score-demo-breakdown { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 1rem; }
.breakdown-row { display: flex; justify-content: space-between; font-size: .85rem; padding: .25rem 0; }
.pct { font-weight: 700; }
.pct.good { color: var(--green); }
.pct.ok   { color: var(--accent); }
.pct.warn { color: var(--red); }

/* ── STEPS ────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; max-width: 1000px; margin: 0 auto; }
.step { text-align: center; }
.step-num { width: 52px; height: 52px; background: var(--blue); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 800; margin: 0 auto 1rem; }
.step h3 { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; color: var(--blue); }
.step p { font-size: .9rem; color: var(--text-3); }

/* ── GRADE GRID ───────────────────────────────── */
.grade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; max-width: 900px; margin: 0 auto; }
.grade-card {
  background: #fff; border: 2px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1rem;
  text-align: center; text-decoration: none; color: var(--text);
  transition: all .18s ease; display: block;
}
.grade-card:hover { border-color: var(--blue); box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.grade-num { font-size: 2rem; font-weight: 900; color: var(--blue); line-height: 1; }
.grade-label { font-size: .75rem; color: var(--text-3); margin-bottom: .75rem; }
.grade-badges { display: flex; gap: .4rem; justify-content: center; margin-bottom: .5rem; }
.subject-badge { font-size: .7rem; font-weight: 700; padding: .15rem .5rem; border-radius: 4px; }
.subject-badge.math { background: #e8eaf6; color: #3949ab; }
.subject-badge.ela  { background: #fce4ec; color: #c2185b; }
.grade-count { font-size: .75rem; color: var(--text-3); }

/* ── FEATURES ─────────────────────────────────── */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; max-width: 1000px; margin: 0 auto; }
.feature { background: var(--bg); border-radius: var(--radius); padding: 1.5rem; }
.feature-icon { font-size: 2rem; margin-bottom: .75rem; }
.feature h3 { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; color: var(--blue); }
.feature p { font-size: .9rem; color: var(--text-3); }

/* ── CTA ──────────────────────────────────────── */
.cta-section { background: linear-gradient(135deg, var(--blue) 0%, #1565c0 100%); color: #fff; }
.cta-inner { text-align: center; max-width: 600px; margin: 0 auto; }
.cta-inner h2 { font-size: 2rem; font-weight: 800; margin-bottom: .75rem; }
.cta-inner p { font-size: 1.05rem; opacity: .85; margin-bottom: 2rem; }

/* ── PAGE HEADER ──────────────────────────────── */
.page-header { background: var(--blue); color: #fff; padding: 2.5rem 1.25rem; text-align: center; }
.page-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: .4rem; }
.page-header p { opacity: .85; font-size: 1rem; }

/* ── INFO BANNER ──────────────────────────────── */
.info-banner {
  background: #e8f4fd; border: 1px solid #90caf9; border-radius: 8px;
  padding: .85rem 1.25rem; margin-bottom: 1.5rem; font-size: .9rem; color: #1565c0;
}

/* ── TEST SELECT ──────────────────────────────── */
.select-layout { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; align-items: start; }
.select-panel { background: #fff; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.select-panel-title { font-size: 1rem; font-weight: 700; color: var(--blue); margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: .75rem; }
.grade-list { display: flex; flex-direction: column; gap: .4rem; }
.grade-option { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-radius: 8px; cursor: pointer; transition: background .12s; }
.grade-option:hover { background: var(--bg); }
.grade-option.selected { background: #e8eaf6; }
.grade-option input[type=radio] { display: none; }
.grade-option-label { font-size: .92rem; font-weight: 500; flex: 1; }
.grade-option-counts { display: flex; gap: .3rem; }
.chip { font-size: .65rem; font-weight: 700; padding: .1rem .4rem; border-radius: 3px; }
.chip.math { background: #e8eaf6; color: #3949ab; }
.chip.ela  { background: #fce4ec; color: #c2185b; }

.subject-cards { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.25rem; }
.subject-card { display: flex; align-items: center; gap: 1rem; padding: 1rem; border: 2px solid var(--border); border-radius: 10px; cursor: pointer; transition: all .15s; }
.subject-card input[type=radio] { display: none; }
.subject-card:hover { border-color: var(--blue-lt); }
.subject-card.selected { border-color: var(--blue); background: #f0f2ff; }
.subject-icon { font-size: 1.75rem; flex-shrink: 0; }
.subject-name { font-weight: 700; font-size: .95rem; color: var(--blue); margin-bottom: .2rem; }
.subject-desc { font-size: .8rem; color: var(--text-3); }

.test-info-box { background: var(--bg); border-radius: 8px; padding: 1rem; }
.test-info-box h3 { font-size: .9rem; font-weight: 700; color: var(--blue); margin-bottom: .75rem; }
.test-info-box ul { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.test-info-box li { font-size: .85rem; color: var(--text-2); }

/* ── TEST INTERFACE ───────────────────────────── */
.test-header {
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.5rem;
  position: sticky; top: 0; z-index: 50;
  gap: 1rem;
}
.test-header-left { display: flex; flex-direction: column; gap: .1rem; }
.test-title-label { font-weight: 700; font-size: .95rem; }
.test-q-count { font-size: .8rem; opacity: .8; }
.test-header-center { text-align: center; }
.timer-box { display: flex; align-items: center; gap: .4rem; background: rgba(255,255,255,.15); padding: .4rem .9rem; border-radius: 20px; }
.timer-icon { font-size: .9rem; }
#timer-display { font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.timer-warning { background: rgba(255,82,82,.4) !important; animation: pulse .8s infinite alternate; }
@keyframes pulse { to { background: rgba(255,82,82,.7) !important; } }
.test-header-right { display: flex; gap: .75rem; }
.test-header-right .btn-outline { color: #fff; border-color: rgba(255,255,255,.5); }
.test-header-right .btn-outline:hover { background: rgba(255,255,255,.15); }

.test-progress-bar { height: 4px; background: rgba(255,255,255,.2); position: sticky; top: 56px; z-index: 49; background: #e0e4ef; }
.test-progress-fill { height: 100%; background: var(--accent); transition: width .3s ease; }

.test-layout {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr;
  gap: 1.5rem; padding: 1.5rem 1.25rem;
}
.test-layout.has-passage { grid-template-columns: 1fr 1fr; }

.passage-panel {
  background: #fff; border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow); max-height: calc(100vh - 120px);
  overflow-y: auto; position: sticky; top: 80px;
}
.passage-header { margin-bottom: 1rem; }
.passage-type-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); }
.passage-panel strong { display: block; font-size: 1.05rem; font-weight: 700; color: var(--blue); margin-top: .25rem; }
.passage-body { font-size: .95rem; line-height: 1.9; color: var(--text-2); white-space: pre-wrap; }

.question-panel { background: #fff; border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow); }
.question-header { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.q-number { width: 34px; height: 34px; background: var(--blue); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .95rem; flex-shrink: 0; }
.q-domain { font-size: .82rem; color: var(--text-3); flex: 1; }
.flag-btn { background: none; border: 1.5px solid var(--border); border-radius: 6px; padding: .3rem .7rem; font-size: .8rem; cursor: pointer; color: var(--text-3); transition: all .15s; }
.flag-btn:hover { border-color: var(--accent); color: var(--accent); }
.flag-btn.flagged { background: #fff8e1; border-color: var(--accent); color: var(--accent); }

.question-text { font-size: 1.05rem; line-height: 1.75; margin-bottom: 1.5rem; color: var(--text); font-family: 'Nunito', sans-serif; font-weight: 600; }

.options-list { display: flex; flex-direction: column; gap: .65rem; margin-bottom: 2rem; }
.option-btn {
  display: flex; align-items: flex-start; gap: .85rem;
  padding: 1rem 1.1rem; border: 2px solid var(--border);
  border-radius: 10px; cursor: pointer; transition: all .15s;
  background: #fff; text-align: left; font-family: inherit; font-size: .95rem; width: 100%;
}
.option-btn:hover { border-color: var(--blue-lt); background: #f0f2ff; }
.option-btn.selected { border-color: var(--blue); background: #e8eaf6; }
.option-btn.selected .opt-letter-bubble { background: var(--blue); color: #fff; }
.opt-letter-bubble {
  width: 30px; height: 30px; border-radius: 50%;
  background: #f0f0f0; color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; flex-shrink: 0;
  transition: all .15s;
}
.opt-text { flex: 1; line-height: 1.55; padding-top: .15rem; }

.question-nav { display: flex; justify-content: space-between; }

/* ── REVIEW OVERLAY ───────────────────────────── */
.review-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.review-modal {
  background: #fff; border-radius: var(--radius); padding: 2rem;
  max-width: 700px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.review-modal-sm { max-width: 420px; }
.review-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.review-modal-header h2 { font-size: 1.3rem; font-weight: 800; color: var(--blue); }
.close-btn { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-3); line-height: 1; padding: .2rem .4rem; }
.review-intro { font-size: .9rem; color: var(--text-3); margin-bottom: 1.25rem; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: .5rem; margin-bottom: 1.5rem; }
.review-q-btn {
  width: 52px; height: 52px; border-radius: 8px; border: 2px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; cursor: pointer; background: #fff;
  transition: all .12s; color: var(--text-2);
}
.review-q-btn:hover { border-color: var(--blue); }
.review-q-btn.answered { border-color: var(--blue); background: #e8eaf6; color: var(--blue); }
.review-q-btn.flagged-q { border-color: var(--accent) !important; background: #fff8e1 !important; color: var(--accent) !important; }
.review-q-btn .flag-mark { font-size: .6rem; line-height: 1; }
.review-actions { display: flex; justify-content: flex-end; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ── RESULTS PAGE ─────────────────────────────── */
.results-page { padding: 2rem 1.25rem 4rem; }
.score-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; margin-bottom: 1.5rem; }
.score-card-header { color: #fff; padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.score-card-subject { font-weight: 700; font-size: 1rem; }
.score-card-date { font-size: .85rem; opacity: .85; }
.score-card-body { padding: 1.5rem; display: flex; align-items: center; gap: 2rem; }
.score-main { text-align: center; }
.score-big { font-size: 4rem; font-weight: 900; color: var(--blue); line-height: 1; }
.score-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); }
.score-divider { width: 1px; height: 80px; background: var(--border); }
.score-meta { flex: 1; }
.score-level-badge { display: inline-block; color: #fff; font-size: .9rem; font-weight: 700; padding: .4rem 1.2rem; border-radius: 20px; margin-bottom: .75rem; }
.score-raw { font-size: .95rem; color: var(--text-2); margin-bottom: .25rem; }
.score-time { font-size: .85rem; color: var(--text-3); }

.scale-bar-section { padding: 1.25rem 1.5rem 1.5rem; border-top: 1px solid var(--border); }
.scale-bar-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); margin-bottom: .75rem; }
.scale-bar-outer { display: flex; height: 28px; border-radius: 6px; overflow: visible; position: relative; margin-bottom: .5rem; }
.scale-segment { position: relative; display: flex; align-items: flex-end; }
.scale-segment:first-child { border-radius: 6px 0 0 6px; }
.scale-segment:last-child { border-radius: 0 6px 6px 0; }
.scale-seg-label { font-size: .65rem; text-align: center; position: absolute; bottom: -28px; left: 50%; transform: translateX(-50%); white-space: nowrap; color: var(--text-3); width: max-content; }
.scale-marker { position: absolute; top: -8px; transform: translateX(-50%); z-index: 10; pointer-events: none; }
.scale-marker-flag {
  background: var(--blue); color: #fff; font-size: .75rem; font-weight: 800;
  padding: .2rem .5rem; border-radius: 4px; white-space: nowrap;
  position: relative;
}
.scale-marker-flag::after {
  content: ''; position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--blue); border-bottom: none;
}
.scale-bar-nums {
  display: flex; justify-content: space-between;
  font-size: .72rem; color: var(--text-3); margin-top: 2rem;
}

.results-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }

/* ── Upsell Banner (Level 1 & 2) ─────────────────────────── */
.upsell-banner {
  background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
  border: 2px solid #ffb300;
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 2rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.upsell-icon { font-size: 2.5rem; line-height: 1; flex-shrink: 0; }
.upsell-body { flex: 1; }
.upsell-headline {
  font-size: 1.15rem;
  font-weight: 800;
  color: #e65100;
  margin-bottom: .5rem;
}
.upsell-sub {
  font-size: .95rem;
  color: #555;
  margin-bottom: 1.25rem;
  line-height: 1.55;
}
.upsell-offers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.upsell-card {
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  padding: 1rem 1rem 1.1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.upsell-card.upsell-featured {
  border-color: var(--blue);
  box-shadow: 0 4px 18px rgba(26,35,126,.13);
}
.upsell-card-badge {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .6rem;
  border-radius: 4px;
  width: fit-content;
  margin-bottom: .2rem;
  letter-spacing: .03em;
}
.upsell-card-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}
.upsell-card-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--blue);
}
.upsell-per {
  font-size: .8rem;
  font-weight: 500;
  color: #777;
}
.upsell-card-save {
  font-size: .78rem;
  color: #388e3c;
  font-weight: 600;
  margin-bottom: .6rem;
}
.upsell-cta { margin-top: auto; font-size: .9rem; }
.upsell-credits-note {
  font-size: .88rem;
  color: #555;
  background: #e8f5e9;
  border-radius: 8px;
  padding: .6rem .9rem;
  border-left: 3px solid #388e3c;
}
.upsell-credits-note a { color: var(--blue); font-weight: 600; }

@media (max-width: 600px) {
  .upsell-banner { flex-direction: column; }
  .upsell-offers { grid-template-columns: 1fr; }
}
/* ──────────────────────────────────────────────────────────── */

.results-section { background: #fff; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.results-section-title { font-size: 1.1rem; font-weight: 800; color: var(--blue); margin-bottom: 1.25rem; }

.domain-breakdown { display: flex; flex-direction: column; gap: .85rem; }
.domain-row { display: flex; align-items: center; gap: 1rem; }
.domain-name { flex: 0 0 200px; font-size: .88rem; color: var(--text-2); }
.domain-bar-wrap { flex: 1; display: flex; align-items: center; gap: .75rem; }
.domain-bar-track { flex: 1; height: 14px; background: #e0e4ef; border-radius: 7px; overflow: hidden; }
.domain-bar-fill { height: 100%; border-radius: 7px; transition: width .6s ease; }
.domain-pct { flex: 0 0 90px; font-size: .85rem; font-weight: 700; text-align: right; }
.pct-good { color: var(--green); }
.pct-ok   { color: var(--accent); }
.pct-bad  { color: var(--red); }

.review-filters { display: flex; gap: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.filter-btn { background: var(--bg); border: 1.5px solid var(--border); border-radius: 6px; padding: .4rem 1rem; font-size: .85rem; cursor: pointer; font-family: inherit; transition: all .15s; color: var(--text-2); font-weight: 500; }
.filter-btn:hover { border-color: var(--blue); color: var(--blue); }
.filter-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }

.question-reviews { display: flex; flex-direction: column; gap: 1.25rem; }
.q-review { border-radius: 10px; padding: 1.25rem; border: 2px solid var(--border); }
.q-correct { border-color: #c8e6c9; background: #f1f8f1; }
.q-wrong   { border-color: #ffcdd2; background: #fff5f5; }
.q-review-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.q-review-num { font-size: .8rem; font-weight: 700; color: var(--text-3); }
.q-review-domain { font-size: .8rem; color: var(--text-3); flex: 1; }
.q-review-standard { font-size: .75rem; background: #e8eaf6; color: var(--blue-lt); padding: .15rem .5rem; border-radius: 4px; font-weight: 600; }
.q-review-badge { font-size: .8rem; font-weight: 700; padding: .25rem .6rem; border-radius: 20px; }
.badge-correct { background: #c8e6c9; color: var(--green); }
.badge-wrong   { background: #ffcdd2; color: var(--red); }
.q-review-text { font-size: .95rem; font-weight: 600; color: var(--text); margin-bottom: 1rem; line-height: 1.6; }
.q-review-options { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.q-opt-row { display: flex; align-items: flex-start; gap: .6rem; padding: .5rem .75rem; border-radius: 7px; font-size: .88rem; background: #fff; border: 1.5px solid var(--border); }
.opt-correct { border-color: var(--green) !important; background: #f1f8f1 !important; }
.opt-wrong-chosen { border-color: var(--red) !important; background: #fff5f5 !important; }
.opt-letter { font-weight: 700; color: var(--text-3); flex-shrink: 0; }
.opt-text { flex: 1; }
.opt-tag { font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 3px; flex-shrink: 0; }
.correct-tag { background: #c8e6c9; color: var(--green); }
.wrong-tag   { background: #ffcdd2; color: var(--red); }
.skip-tag    { background: #e0e0e0; color: #666; }
.q-review-explanation { background: #fff9e6; border-left: 3px solid var(--accent); padding: .75rem 1rem; border-radius: 0 6px 6px 0; font-size: .88rem; line-height: 1.6; color: var(--text-2); }
.passage-toggle { margin-bottom: .75rem; }
.passage-toggle summary { cursor: pointer; font-size: .85rem; color: var(--blue); font-weight: 600; padding: .4rem; }
.passage-text-mini { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 1rem; margin-top: .5rem; font-size: .85rem; line-height: 1.8; color: var(--text-2); max-height: 300px; overflow-y: auto; white-space: pre-wrap; }

/* ── AUTH PAGE ────────────────────────────────── */
.auth-page { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { background: #fff; border-radius: var(--radius); padding: 2.5rem; box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; }
.auth-logo { font-size: 2.5rem; text-align: center; margin-bottom: .75rem; }
.auth-title { font-size: 1.6rem; font-weight: 800; text-align: center; color: var(--blue); margin-bottom: .4rem; }
.auth-sub { text-align: center; color: var(--text-3); font-size: .9rem; margin-bottom: 1.75rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-switch { text-align: center; font-size: .88rem; color: var(--text-3); margin-top: .5rem; }
.auth-switch a { color: var(--blue-lt); font-weight: 600; }

.alert { border-radius: 7px; padding: .85rem 1rem; font-size: .9rem; margin-bottom: 1rem; }
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group label { font-size: .85rem; font-weight: 600; color: var(--text-2); }
.req { color: var(--red); }
.form-input {
  border: 1.5px solid var(--border); border-radius: 8px; padding: .65rem .9rem;
  font-size: .95rem; font-family: inherit; color: var(--text);
  transition: border-color .15s; background: #fff;
}
.form-input:focus { outline: none; border-color: var(--blue-lt); box-shadow: 0 0 0 3px rgba(57,73,171,.12); }

/* ── DASHBOARD ────────────────────────────────── */
.dash-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.summary-card { background: #fff; border-radius: var(--radius); padding: 1.25rem; text-align: center; box-shadow: var(--shadow); }
.summary-num { font-size: 2.2rem; font-weight: 900; color: var(--blue); line-height: 1; }
.summary-label { font-size: .8rem; color: var(--text-3); margin-top: .25rem; }
.dash-section { background: #fff; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.dash-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.dash-section-header h2 { font-size: 1.1rem; font-weight: 800; color: var(--blue); }
.history-table-wrap { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.history-table th { background: var(--bg); text-align: left; padding: .65rem .75rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .3px; color: var(--text-3); border-bottom: 1px solid var(--border); }
.history-table td { padding: .75rem; border-bottom: 1px solid var(--border); color: var(--text-2); }
.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover td { background: var(--bg); }
.level-pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: .2rem .6rem; border-radius: 10px; color: #fff; }
.level-pill.level-1 { background: var(--red); }
.level-pill.level-2 { background: var(--accent); }
.level-pill.level-3 { background: var(--green); }
.level-pill.level-4 { background: #1565c0; }
.link-btn { font-size: .82rem; font-weight: 600; color: var(--blue-lt); margin-right: .5rem; }
.dash-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.dash-subject-card { background: #fff; border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.dash-subject-header { font-weight: 800; font-size: 1rem; padding-bottom: .75rem; margin-bottom: .75rem; border-bottom: 2px solid var(--border); }
.math-header { color: #3949ab; }
.ela-header  { color: #c2185b; }
.dash-subject-stat { display: flex; justify-content: space-between; font-size: .88rem; color: var(--text-2); padding: .3rem 0; }
.upgrade-banner { background: linear-gradient(135deg, #fff8e1, #fff3cd); border: 1.5px solid #f9a825; border-radius: var(--radius); padding: 1.25rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.upgrade-text p { font-size: .9rem; color: var(--text-3); margin-top: .25rem; }
.empty-state { text-align: center; padding: 4rem 1rem; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-state h2 { font-size: 1.4rem; font-weight: 800; color: var(--blue); margin-bottom: .5rem; }
.empty-state p { color: var(--text-3); margin-bottom: 1.5rem; }

/* ── PRICING ──────────────────────────────────── */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; max-width: 960px; margin: 0 auto 3rem; }
.pricing-card { background: #fff; border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); position: relative; border: 2px solid var(--border); }
.pricing-featured { border-color: var(--blue); box-shadow: 0 8px 40px rgba(26,35,126,.18); transform: scale(1.02); }
.pricing-badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--blue); color: #fff; font-size: .75rem; font-weight: 700; padding: .3rem 1rem; border-radius: 20px; white-space: nowrap; }
.pricing-tier { font-size: .8rem; text-transform: uppercase; letter-spacing: .8px; color: var(--text-3); font-weight: 700; margin-bottom: .5rem; }
.pricing-price { font-size: 2.5rem; font-weight: 900; color: var(--blue); margin-bottom: .5rem; line-height: 1; }
.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--text-3); }
.pricing-desc { font-size: .88rem; color: var(--text-3); margin-bottom: 1.5rem; }
.pricing-features { list-style: none; display: flex; flex-direction: column; gap: .55rem; margin-bottom: 1.75rem; }
.pricing-features li { font-size: .88rem; color: var(--text-2); }

.faq-section { max-width: 720px; margin: 0 auto; }
.faq-list { display: flex; flex-direction: column; gap: .75rem; margin-top: 1.5rem; }
.faq-item { background: #fff; border-radius: 8px; padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.faq-q { font-weight: 700; color: var(--blue); margin-bottom: .4rem; font-size: .95rem; }
.faq-a { font-size: .88rem; color: var(--text-3); line-height: 1.65; }

/* ── FOOTER ───────────────────────────────────── */
.footer { background: var(--blue); color: rgba(255,255,255,.85); padding: 2.5rem 1.25rem; margin-top: auto; }
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-brand { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.footer-brand .logo-text { color: #fff; }
.footer-tagline { font-size: .82rem; opacity: .7; margin-left: .25rem; }
.footer-links { display: flex; gap: 1.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,.75); font-size: .88rem; }
.footer-links a:hover { color: #fff; }
.footer-note { font-size: .78rem; opacity: .55; max-width: 600px; }

/* ── RESPONSIVE ───────────────────────────────── */
@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-card { display: none; }
  .hero-title { font-size: 2.1rem; }
  .select-layout { grid-template-columns: 1fr; }
  .test-layout.has-passage { grid-template-columns: 1fr; }
  .passage-panel { position: static; max-height: 300px; }
  .domain-name { flex: 0 0 130px; font-size: .8rem; }
  .score-card-body { flex-direction: column; text-align: center; }
  .score-divider { width: 60px; height: 1px; }
  .dash-split { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .test-header { flex-wrap: wrap; }
  .pricing-featured { transform: none; }
}

/* ── PER-TEST PRICING ─────────────────────────── */
.pricing-grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); max-width: 680px; }

.test-type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: .5rem; }
.test-type-card { border: 2px solid #e0e0e0; border-radius: var(--radius); padding: 1.25rem 1rem; background: #fff; display: flex; flex-direction: column; gap: .5rem; }
.test-type-featured { border-color: var(--primary); background: #f5f7ff; }
.test-type-header { font-weight: 700; color: #333; font-size: .95rem; }
.test-type-price { font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.test-type-features { list-style: none; padding: 0; margin: .25rem 0 .75rem; font-size: .85rem; color: #555; display: flex; flex-direction: column; gap: .3rem; }
.test-type-features li::before { content: "✅ "; }
.test-type-features li[style*="color:#aaa"]::before { content: "—  "; }

@media (max-width: 520px) {
  .test-type-cards { grid-template-columns: 1fr; }
}

/* ── BUNDLE CARDS (buy_test.html) ─────────────── */
.bundle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto 2rem;
}
.bundle-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.bundle-card:hover { box-shadow: 0 6px 28px rgba(26,35,126,.13); }
.bundle-featured {
  border-color: var(--blue);
  box-shadow: 0 8px 40px rgba(26,35,126,.18);
  transform: scale(1.03);
}
.bundle-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .5px;
  padding: .28rem 1rem;
  border-radius: 20px;
  white-space: nowrap;
  text-transform: uppercase;
}
.bundle-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-3);
  font-weight: 700;
  margin-bottom: .4rem;
  margin-top: .25rem;
}
.bundle-price {
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--blue);
  line-height: 1;
  margin-bottom: .3rem;
}
.bundle-per {
  font-size: .82rem;
  color: var(--text-3);
  margin-bottom: .4rem;
}
.bundle-saving {
  font-size: .82rem;
  font-weight: 600;
  color: #388e3c;
  margin-bottom: 1.25rem;
  min-height: 1.2em;
}
.bundle-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin: 0 0 1.75rem;
  flex: 1;
}
.bundle-features li {
  font-size: .87rem;
  color: var(--text-2);
  padding-left: 1.4rem;
  position: relative;
}
.bundle-features li::before {
  content: "✅";
  position: absolute;
  left: 0;
  font-size: .78rem;
}

@media (max-width: 768px) {
  .bundle-featured { transform: none; }
  .bundle-grid { grid-template-columns: 1fr; max-width: 420px; }
}
