/* ═══════════════════════════════════════════════════════════
   College Admissions Readiness Scorecard — Styles
   Mobile-first. Expand breakpoints with @media (min-width: 640px)
   ═══════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────── */
:root {
  --navy:        #0f172a;
  --navy-700:    #1e293b;
  --navy-600:    #334155;
  --navy-500:    #475569;
  --blue:        #3b82f6;
  --blue-light:  #eff6ff;
  --blue-dark:   #1d4ed8;
  --green:       #10b981;
  --green-light: #ecfdf5;
  --yellow:      #f59e0b;
  --yellow-light:#fffbeb;
  --red:         #ef4444;
  --red-light:   #fef2f2;
  --bg:          #f8fafc;
  --surface:     #ffffff;
  --border:      #e2e8f0;
  --border-hover:#cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted:  #94a3b8;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:   0 12px 32px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.06);
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --transition:  200ms ease;
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; font-family: inherit; border: none; background: none; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── App Shell ──────────────────────────────────────────── */
#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Screens ────────────────────────────────────────────── */
.screen {
  display: none;
  min-height: 100dvh;
  flex-direction: column;
}
.screen.active {
  display: flex;
}

/* Fade-in when a screen becomes active */
.screen.fade-in {
  animation: fadeInUp 280ms ease both;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.screen-inner {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ── Brand Logo ─────────────────────────────────────────── */
.brand-wordmark {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--blue);
  text-transform: uppercase;
}
.brand-wordmark-sm {
  font-size: 11px;
  margin-bottom: 4px;
}

/* ── Back Link ──────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 0;
  transition: color var(--transition);
  background: none;
  border: none;
}
.back-link:hover { color: var(--text-primary); }

/* ── Badge ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-light);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 16px;
}

/* ── Primary Button ─────────────────────────────────────── */
.primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 14px rgba(59,130,246,.35);
}
.primary-btn:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59,130,246,.45);
}
.primary-btn:active {
  transform: translateY(0);
}
.primary-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

/* Text button */
.text-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
  transition: color var(--transition);
}
.text-btn:hover { color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════
   WELCOME SCREEN
   ═══════════════════════════════════════════════════════════ */
.welcome-inner {
  justify-content: center;
  padding-top: 48px;
}
.welcome-body {
  text-align: center;
  margin-top: 32px;
}
.welcome-headline {
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--navy);
  margin-bottom: 16px;
  letter-spacing: -.02em;
}
.welcome-sub {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 auto 32px;
  line-height: 1.6;
}
.persona-prompt {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 16px;
}
.persona-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto;
}
.persona-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  text-align: center;
  min-height: 140px;
}
.persona-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.persona-card:active { transform: translateY(0); }
.persona-icon {
  font-size: 32px;
  line-height: 1;
}
.persona-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}
.persona-hint {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.welcome-footnote {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-top: auto;
  padding-top: 32px;
}

/* ═══════════════════════════════════════════════════════════
   GRADE SCREEN
   ═══════════════════════════════════════════════════════════ */
.grade-inner {
  padding-top: 32px;
}
.section-title {
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 800;
  color: var(--navy);
  margin-top: 32px;
  margin-bottom: 8px;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.section-sub {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}
.grade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.grade-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 28px 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  min-height: 110px;
  text-align: center;
}
.grade-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.grade-card:active { transform: translateY(0); }
.grade-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.02em;
}
.grade-word {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-600);
}
.grade-year {
  font-size: 12px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   QUESTION SCREEN
   ═══════════════════════════════════════════════════════════ */
.question-inner {
  padding-top: 20px;
}

/* Progress */
.progress-section {
  margin-bottom: 24px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.progress-pct {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
}
.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue) 0%, #6366f1 100%);
  border-radius: 100px;
  transition: width 400ms cubic-bezier(.4,0,.2,1);
  width: 0%;
}

/* Question wrap — overflow hidden for slide animations */
.question-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Question card */
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  box-shadow: var(--shadow-md);
}
.q-category-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-light);
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 16px;
}
.q-text {
  font-size: clamp(17px, 4vw, 21px);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.4;
  margin-bottom: 24px;
  letter-spacing: -.01em;
}

/* Answer options */
.q-answers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.answer-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  color: var(--navy-700);
  line-height: 1.45;
  transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
  width: 100%;
  cursor: pointer;
  min-height: 52px;
}
.answer-option:hover {
  border-color: var(--blue);
  background: var(--blue-light);
  transform: translateX(2px);
  box-shadow: var(--shadow-sm);
}
.answer-option:active {
  transform: translateX(0);
}
/* Points indicator dot */
.answer-dot {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 1px;
  transition: background var(--transition), color var(--transition);
}
.answer-option:hover .answer-dot {
  background: var(--blue);
  color: #fff;
}

/* Slide animations for question transitions */
@keyframes slideInFromRight {
  from { opacity: 0; transform: translateX(48px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInFromLeft {
  from { opacity: 0; transform: translateX(-48px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutToLeft {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-48px); }
}
@keyframes slideOutToRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(48px); }
}
.slide-in-right  { animation: slideInFromRight  260ms cubic-bezier(.4,0,.2,1) both; }
.slide-in-left   { animation: slideInFromLeft   260ms cubic-bezier(.4,0,.2,1) both; }
.slide-out-left  { animation: slideOutToLeft    220ms cubic-bezier(.4,0,.2,1) both; }
.slide-out-right { animation: slideOutToRight   220ms cubic-bezier(.4,0,.2,1) both; }

.question-footer {
  padding-top: 16px;
  min-height: 44px;
}

/* ═══════════════════════════════════════════════════════════
   EMAIL GATE SCREEN
   ═══════════════════════════════════════════════════════════ */
.gate-inner {
  justify-content: center;
  text-align: center;
  padding-top: 48px;
}

/* Score preview */
.gate-score-preview {
  margin-bottom: 32px;
}
.gate-score-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.gate-score-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 12px;
}
.gate-score-num {
  font-size: 80px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  transition: color var(--transition);
}
.gate-score-denom {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-muted);
}
.gate-score-bar-track {
  height: 8px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  max-width: 240px;
  margin: 0 auto 10px;
}
.gate-score-bar-fill {
  height: 100%;
  border-radius: 100px;
  width: 0%;
  transition: width 800ms cubic-bezier(.4,0,.2,1) 200ms;
}
.gate-tier-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Gate body */
.gate-body {
  max-width: 400px;
  margin: 0 auto;
}
.gate-headline {
  font-size: clamp(20px, 5vw, 26px);
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 10px;
  letter-spacing: -.01em;
}
.gate-sub {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.6;
}

/* Email form */
.email-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.email-field-wrap { position: relative; }
.email-input {
  width: 100%;
  padding: 15px 18px;
  font-size: 16px;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.email-input::placeholder { color: var(--text-muted); }
.email-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.email-input.input-error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}
.email-error {
  font-size: 13px;
  color: var(--red);
  font-weight: 500;
  text-align: center;
}

/* Spinner inside button */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.gate-footnote {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   RESULTS SCREEN
   ═══════════════════════════════════════════════════════════ */
.results-inner {
  padding-top: 32px;
}

/* Header */
.results-header {
  text-align: center;
  margin-bottom: 32px;
}
.results-heading {
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.02em;
  margin-top: 6px;
  margin-bottom: 6px;
}
.results-meta-line {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Overall score */
.overall-score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 32px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  margin-bottom: 32px;
  text-align: center;
}

/* Score ring */
.score-ring-wrap { }
.score-ring {
  width: 152px;
  height: 152px;
  border-radius: 50%;
  border: 8px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color 600ms ease;
}
.score-ring-num {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
  display: block;
  transition: color 600ms ease;
}
.score-ring-denom {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Tier info */
.tier-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.tier-message {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 320px;
  line-height: 1.55;
}

/* Score tier colors */
.tier-excellent .score-ring     { border-color: var(--green); }
.tier-excellent .score-ring-num { color: var(--green); }
.tier-excellent .tier-badge     { background: var(--green-light); color: var(--green); }

.tier-solid .score-ring     { border-color: var(--blue); }
.tier-solid .score-ring-num { color: var(--blue); }
.tier-solid .tier-badge     { background: var(--blue-light); color: var(--blue-dark); }

.tier-needs-work .score-ring     { border-color: var(--yellow); }
.tier-needs-work .score-ring-num { color: var(--yellow); }
.tier-needs-work .tier-badge     { background: var(--yellow-light); color: #92400e; }

.tier-getting-started .score-ring     { border-color: var(--red); }
.tier-getting-started .score-ring-num { color: var(--red); }
.tier-getting-started .tier-badge     { background: var(--red-light); color: #991b1b; }

/* Category breakdown */
.categories-block {
  margin-bottom: 32px;
}
.block-heading {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 16px;
  letter-spacing: -.01em;
}
.categories-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Individual category card */
.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 20px 24px;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 300ms ease both;
}
.cat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cat-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}
.cat-score-pct {
  font-size: 15px;
  font-weight: 700;
}
.cat-bar-track {
  height: 8px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 14px;
}
.cat-bar-fill {
  height: 100%;
  border-radius: 100px;
  width: 0%;
  transition: width 700ms cubic-bezier(.4,0,.2,1);
}

/* Category bar colors by score */
.cat-bar-fill.bar-green  { background: var(--green); }
.cat-bar-fill.bar-yellow { background: var(--yellow); }
.cat-bar-fill.bar-red    { background: var(--red); }

.cat-score-pct.score-green  { color: var(--green); }
.cat-score-pct.score-yellow { color: var(--yellow); }
.cat-score-pct.score-red    { color: var(--red); }

/* Recommendation inside category card */
.cat-rec {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 4px;
}
.cat-rec-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.5;
}
.cat-rec-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}
.cat-rec-link:hover {
  color: var(--blue-dark);
  border-bottom-color: var(--blue-dark);
}

/* Featured services chips */
.cat-featured-services {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.service-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--navy-700);
  text-decoration: none;
  transition: border-color var(--transition), background var(--transition);
}
.service-chip:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}
.service-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-light);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ── Results Footer ─────────────────────────────────────── */
.results-footer {
  border-top: 1px solid var(--border);
  padding-top: 32px;
  text-align: center;
}
.footer-main-cta {
  margin-bottom: 28px;
}
.footer-cta-prompt {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* Share buttons */
.share-block {
  margin-bottom: 24px;
}
.share-prompt {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.share-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.share-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 2px solid var(--navy);
  background: var(--navy);
  color: #fff;
  transition: background var(--transition), border-color var(--transition);
}
.share-btn:hover {
  background: var(--navy-700);
  border-color: var(--navy-700);
}
.share-btn-secondary {
  background: transparent;
  color: var(--navy);
}
.share-btn-secondary:hover {
  background: var(--navy);
  color: #fff;
}

.retake-link-wrap {
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Tablet / Desktop
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 640px) {
  .screen-inner {
    padding: 40px 32px 64px;
  }
  .welcome-inner { padding-top: 80px; }

  .question-card {
    padding: 36px 32px;
  }
  .q-text {
    font-size: 22px;
  }
  .answer-option {
    font-size: 16px;
    padding: 18px 22px;
  }
  .overall-score-block {
    flex-direction: row;
    text-align: left;
    gap: 32px;
    align-items: flex-start;
  }
  .score-ring { flex-shrink: 0; }
  .tier-badge { display: inline-block; }
}

@media (min-width: 900px) {
  .screen-inner { max-width: 640px; }
}

/* ── Loading state for submit button ────────────────────── */
.primary-btn.loading .btn-label { display: none; }
.primary-btn.loading .btn-spinner { display: block; }
