/* Kid-friendly, high-contrast, large-text UI. No framework. */
/* "Brightspark" warm-gold theme — palette tokens below. */
:root {
  --spark: #f59e0b;         /* amber-500: brand gold. Pairs with --ink text for AAA contrast. */
  --spark-dark: #b45309;    /* amber-700: button hover */
  --green: #16a34a;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --amber: #d97706;
  --ink: #1c1917;           /* stone-900: warm near-black (was cool slate). Header bg + body text. */
  --muted: #78716c;         /* stone-500: warm grey (was cool slate). */
  --card: #ffffff;
  --bg: #fffbeb;            /* amber-50: very subtle cream page bg. */
  --line: #e7e5e4;          /* stone-200: warm border. */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.5;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px;
  background: var(--ink);   /* dark header — strong differentiator from indigo competitors */
  color: #fff;
}
.app-header .logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
}
.app-header nav a {
  color: #fde68a;   /* amber-200: gold-tinted nav link on dark header */
  text-decoration: none;
  margin-left: 18px;
  font-weight: 600;
}
.app-header nav a:hover { color: #fff; text-decoration: underline; }

.app {
  max-width: 760px;
  margin: 24px auto;
  padding: 0 16px;
}
.app-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 24px 16px 40px;
}

.notice {
  max-width: 760px;
  margin: 12px auto 0;
  padding: 10px 16px;
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: 8px;
  color: #854d0e;
  font-size: 0.95rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  margin-bottom: 18px;
}

h1 { font-size: 1.8rem; margin: 0 0 8px; }
h2 { font-size: 1.3rem; margin: 0 0 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* Buttons */
.btn {
  font: inherit;
  font-weight: 700;
  padding: 14px 22px;
  border-radius: 12px;
  border: none;
  background: var(--spark);
  color: var(--ink);   /* black text on gold button — 7:1 contrast (AAA), reads punchy */
  cursor: pointer;
  transition: transform 0.05s, background 0.15s;
}
.btn:hover { background: var(--spark-dark); color: #fff; }   /* deeper gold + white text on hover */
.btn:active { transform: scale(0.98); }
.btn.big { font-size: 1.25rem; padding: 18px 34px; }
.btn.secondary { background: #e2e8f0; color: var(--ink); }
.btn.secondary:hover { background: #cbd5e1; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* Quiz */
.quiz-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 12px;
}
.question {
  font-size: 1.45rem;
  font-weight: 600;
  margin: 12px 0 22px;
}
.choices { display: grid; gap: 12px; }
.choice {
  text-align: left;
  font: inherit;
  background: #fafaf9;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  cursor: pointer;
  display: flex;
  gap: 14px;
  align-items: center;
}
.choice:hover { border-color: var(--spark); background: #fef3c7; }   /* amber-100 tint */
.choice .key {
  font-weight: 800;
  background: var(--spark);
  color: var(--ink);   /* black on gold */
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: none;
}
.choice.correct { border-color: var(--green); background: var(--green-bg); }
.choice.wrong { border-color: var(--red); background: var(--red-bg); }
.choice.picked { border-color: var(--spark); background: #fef3c7; }
.choice[disabled] { cursor: default; }

.numeric-entry { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.numeric-entry input {
  font: inherit;
  font-size: 1.3rem;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  width: 200px;
}
.numeric-entry input:focus { outline: none; border-color: var(--spark); }

/* Feedback */
.feedback { margin-top: 20px; border-radius: 12px; padding: 18px; }
.feedback.good { background: var(--green-bg); border: 1px solid #86efac; }
.feedback.bad { background: var(--red-bg); border: 1px solid #fca5a5; }
.feedback.ok { background: #fef9c3; border: 1px solid #fde047; }
.feedback h3 { margin: 0 0 8px; }
.feedback .why { font-weight: 600; }
.steps { margin: 12px 0 0; padding-left: 22px; }
.steps li { margin: 4px 0; }
.concept {
  margin-top: 14px;
  background: #fef3c7;   /* amber-100 callout tint */
  border-left: 4px solid var(--spark);
  padding: 10px 14px;
  border-radius: 6px;
}

/* Progress / dots / badges */
.progress {
  position: relative;
  background: #e2e8f0;
  border-radius: 999px;
  height: 22px;
  overflow: hidden;
}
.progress-fill {
  background: var(--green);
  height: 100%;
  transition: width 0.4s;
}
.progress-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
}
.level-dots { display: inline-flex; gap: 5px; }
.level-dots .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #cbd5e1;
}
.level-dots .dot.on { background: var(--amber); }

.badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.badge.mastered { background: #fef3c7; color: #92400e; }
.badge.strong { background: #dbeafe; color: #1e40af; }
.badge.learning { background: #f1f5f9; color: var(--muted); }
.badge.new { background: #f1f5f9; color: var(--muted); }
.badge.good { background: var(--green-bg); color: var(--green); }
.badge.bad { background: var(--red-bg); color: var(--red); }

/* Topic grid */
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.topic-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.topic-tile h3 { margin: 0 0 6px; font-size: 1.05rem; }
.topic-tile .row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 8px 0;
}

/* Dashboard table */
table.dash { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.dash th, table.dash td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
table.dash th { color: var(--muted); font-weight: 700; }
.mistake-list { font-size: 0.88rem; color: var(--muted); }
.pace-flag { color: var(--amber); font-weight: 700; }
.stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 18px;
}
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.stat .big { font-size: 1.6rem; font-weight: 800; color: var(--spark); }
.stat .lbl { color: var(--muted); font-size: 0.85rem; }

/* Non-Verbal Reasoning figures */
.nvr-row {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  margin: 12px 0;
}
.nvr-grid { display: inline-grid; gap: 10px; margin: 12px 0; }
.nvr-fig { vertical-align: middle; }
.nvr-op { font-size: 1.6rem; font-weight: 800; color: var(--muted); }
.choices .nvr-fig { width: 80px; height: 80px; }

/* Reading passage / cloze text inside a question */
.question .passage {
  font-weight: 400; font-size: 1.02rem; line-height: 1.6;
  background: #fafaf9; border-left: 4px solid var(--spark);
  padding: 12px 16px; border-radius: 8px; margin-bottom: 14px;
}

/* Subject grouping */
.subj-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.subj-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.subj-head h2 { margin: 0; }
.subj-chips {
  display: flex; gap: 8px 16px; flex-wrap: wrap;
  justify-content: center; margin: 10px 0;
}
.subj-chip { font-size: 0.9rem; }
table.dash tr.subj-row td { background: #f1f5f9; }

/* Engagement widget */
.engage .engage-top {
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
}
.engage-streak {
  display: flex; gap: 14px; align-items: center; flex: 1 1 220px;
}
.engage-streak .flame { font-size: 2.4rem; }
.engage-streak .big { font-size: 1.3rem; font-weight: 800; }
.engage-goal { flex: 1 1 220px; }
.engage-goal .lbl { margin-bottom: 6px; }
.badge-strip {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px;
}
.badge-chip {
  background: #fef3c7; color: var(--spark-dark);   /* amber-100 bg + amber-700 ink */
  border: 1px solid #fde68a; border-radius: 999px;   /* amber-200 border */
  padding: 5px 12px; font-size: 0.82rem; font-weight: 700;
}

/* Worksheets */
.ws-head { border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 14px; }
.ws-head h2 { margin: 0 0 4px; }
.ws-meta { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 8px; font-size: 0.95rem; }
.ws-item { margin: 0 0 18px; }
.ws-q { display: flex; gap: 8px; align-items: baseline; }
.ws-n { font-weight: 800; }
.ws-prompt { font-weight: 600; }
.ws-choices {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px;
  margin: 8px 0 0 22px;
}
.ws-choice { display: flex; gap: 8px; align-items: center; }
.ws-key {
  font-weight: 800; border: 1px solid var(--ink);
  border-radius: 6px; width: 24px; height: 24px;
  display: grid; place-items: center; flex: none; font-size: 0.85rem;
}
.ws-answerline { margin: 10px 0 0 22px; color: var(--muted); }
.answer-key .ws-key-row { padding: 4px 0; border-bottom: 1px solid var(--line); }

@media (max-width: 560px) {
  .topic-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .ws-choices { grid-template-columns: 1fr; }
  body { font-size: 17px; }
}

/* Landing page (marketing) */
.lp-main { max-width: 860px; }
.app-header nav a.lp-nav-cta {
  background: var(--spark); color: var(--ink); padding: 6px 14px;   /* gold pill on dark header */
  border-radius: 999px; margin-left: 18px;
}
.app-header nav a.lp-nav-cta:hover { text-decoration: none; opacity: 0.9; }
.lp-hero { padding: 40px 24px; }
.lp-hero h1 { font-size: 2.4rem; line-height: 1.15; }
.lp-sub { font-size: 1.2rem; color: var(--muted); max-width: 620px; margin: 12px auto 22px; }
.lp-fineprint { font-size: 0.85rem; margin-top: 14px; }
.lp-trust { margin: 0 0 18px; }
.lp-why ul, #how ul, #subjects + .card ul { line-height: 1.7; }
.lp-prices {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin: 18px 0 8px;
}
.lp-price {
  position: relative; border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; display: flex; flex-direction: column;
}
.lp-price h3 { margin: 0 0 4px; }
.lp-price ul { padding-left: 20px; margin: 10px 0 16px; line-height: 1.6; flex: 1; }
.lp-price .btn { margin-top: auto; text-align: center; }
.lp-price-best { border-color: var(--spark); box-shadow: 0 0 0 2px var(--spark) inset; }
.lp-amount { font-size: 2rem; font-weight: 800; color: var(--spark); }
.lp-amount .lp-once { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.lp-badge {
  position: absolute; top: -12px; right: 14px; background: var(--spark);
  color: var(--ink); font-size: 0.72rem; font-weight: 700; padding: 4px 10px;
  border-radius: 999px;
}
#faq details {
  border-bottom: 1px solid var(--line); padding: 10px 0;
}
#faq summary { font-weight: 700; cursor: pointer; }
#faq details p { color: var(--muted); margin: 8px 0 0; }
.lp-locked { padding: 6px 0 2px; }
.lp-upsell { border: 1px dashed var(--spark); }
.consent {
  display: flex; gap: 8px; align-items: flex-start;
  margin: 12px 0; font-size: 0.9rem; color: var(--muted);
}
.consent input { margin-top: 4px; }
@media (max-width: 700px) {
  .lp-prices { grid-template-columns: 1fr; }
  .lp-hero h1 { font-size: 1.9rem; }
}

/* Printing: only the worksheet + answer key, on clean white paper. */
@media print {
  .app-header, .app-footer, #notice, .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .app { max-width: none; margin: 0; padding: 0; }
  .card {
    border: none; box-shadow: none; border-radius: 0;
    padding: 0; margin: 0 0 12pt;
  }
  .worksheet, .answer-key { break-inside: auto; }
  .ws-item { break-inside: avoid; page-break-inside: avoid; }
  .answer-key { break-before: page; page-break-before: always; }
  /* Keep figure shading/colour when printing. */
  .nvr-fig, .ws-key, .progress {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .nvr-fig { border: 1px solid #999 !important; }
  a[href]:after { content: ""; }
}
