/* ── Neft Teacher — Spiral Review / MCAP Prep ──────────────────────────
   Self-contained styling. Consistent with the shared house palette
   (teal / navy / amber on cream) and dark-mode aware. ESOL-friendly:
   large fonts, generous spacing, high contrast, clear focus rings. */

:root {
  color-scheme: light dark;

  --navy: #12355b;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --teal-soft: #dff2ee;
  --amber: #f2c15b;
  --amber-soft: #fef7e0;
  --coral: #c2410c;

  --bg: #f6f7f2;
  --surface: #ffffff;
  --surface-soft: #eef4f3;
  --ink: #17202a;
  --muted: #5b6773;
  --line: #d8dfdc;

  --success: #0f7c4a;
  --success-bg: #e6f7ef;
  --error: #b64e2f;
  --error-bg: #fef0ec;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 18px 45px rgba(23, 32, 42, 0.12);
  --max-width: 880px;

  --font-display: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Calibri, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1620;
    --surface: #18222e;
    --surface-soft: #1f2c39;
    --ink: #eaf1f5;
    --muted: #a7b6c2;
    --line: #2b3a48;
    --teal: #2dd4bf;
    --teal-dark: #5eead4;
    --teal-soft: #14323a;
    --amber-soft: #2a2410;
    --success: #4ade80;
    --success-bg: #11321f;
    --error: #fca5a5;
    --error-bg: #3a1a14;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(
      135deg,
      rgba(15, 118, 110, 0.1),
      rgba(242, 193, 91, 0.08) 50%,
      rgba(194, 65, 12, 0.05)
    ),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.12rem;
  line-height: 1.55;
}

.shell {
  width: min(100% - 28px, var(--max-width));
  margin: 0 auto;
  padding: 28px 0 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

a {
  color: var(--teal-dark);
}

.breadcrumb {
  font-size: 0.95rem;
  color: var(--muted);
}

.breadcrumb a {
  font-weight: 800;
  text-decoration: none;
}

/* ── Hero ── */

.hero {
  padding: clamp(22px, 4vw, 38px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 6px solid var(--teal);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  line-height: 1.05;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  max-width: 60ch;
}

/* ── Cards / panels ── */

.panel {
  padding: clamp(20px, 4vw, 30px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.panel .sub {
  margin: 0 0 18px;
  color: var(--muted);
}

/* ── Controls ── */

.control-group {
  margin-bottom: 20px;
}

.control-group > .label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
  font-size: 1rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  min-height: 48px;
  padding: 10px 18px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface-soft);
  border: 2px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.chip:hover {
  border-color: var(--teal);
}

.chip[aria-pressed="true"] {
  background: var(--teal);
  border-color: var(--teal-dark);
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  .chip[aria-pressed="true"] {
    color: #0f1620;
  }
}

select {
  min-height: 48px;
  width: 100%;
  max-width: 420px;
  padding: 8px 14px;
  font-size: 1.05rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface-soft);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.hint {
  margin: 8px 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

/* ── Buttons ── */

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  min-height: 52px;
  padding: 12px 24px;
  font-size: 1.1rem;
  font-weight: 800;
  font-family: inherit;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    background 140ms ease,
    transform 140ms ease;
}

.btn-primary {
  background: var(--teal);
  border-color: var(--teal-dark);
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  .btn-primary {
    color: #0f1620;
  }
}

.btn-primary:hover {
  background: var(--teal-dark);
}

.btn-secondary {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--teal);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Progress + score ── */

.status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.status-bar .meta {
  font-weight: 800;
  font-size: 1rem;
}

.score-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-weight: 800;
  font-size: 1rem;
}

.progress-track {
  height: 12px;
  width: 100%;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  border-radius: 999px;
  transition: width 260ms ease;
}

/* ── Question card ── */

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tag {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  background: var(--amber-soft);
  color: var(--coral);
  border: 1px solid rgba(194, 65, 12, 0.25);
}

.tag.unit {
  background: var(--teal-soft);
  color: var(--teal-dark);
  border-color: rgba(15, 118, 110, 0.25);
}

.stem {
  margin: 0 0 6px;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 700;
  line-height: 1.35;
}

.read-aloud {
  margin: 0 0 18px;
  background: transparent;
  border: 2px solid var(--line);
  border-radius: 999px;
  min-height: 40px;
  padding: 6px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
}

.read-aloud:hover {
  border-color: var(--teal);
}

.choices {
  display: grid;
  gap: 12px;
}

.choice {
  width: 100%;
  text-align: left;
  min-height: 56px;
  padding: 14px 18px;
  font-size: 1.1rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface-soft);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    transform 120ms ease;
}

.choice .marker {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: var(--surface);
  border: 2px solid var(--line);
}

.choice:hover:not(:disabled) {
  border-color: var(--teal);
}

.choice.correct {
  border-color: var(--success);
  background: var(--success-bg);
}

.choice.correct .marker {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.choice.wrong {
  border-color: var(--error);
  background: var(--error-bg);
}

.choice.wrong .marker {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}

.choice:disabled {
  cursor: default;
}

/* ── Feedback ── */

.feedback {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  font-size: 1.05rem;
}

.feedback.good {
  background: var(--success-bg);
  border-color: var(--success);
}

.feedback.bad {
  background: var(--error-bg);
  border-color: var(--error);
}

.feedback .headline {
  font-weight: 800;
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.feedback .explanation {
  margin: 0;
}

/* ── Summary ── */

.summary-stat {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  font-weight: 800;
  color: var(--teal-dark);
  margin: 0;
}

.std-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.std-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.std-row .name {
  font-weight: 800;
}

.std-row .ratio {
  font-weight: 700;
  color: var(--muted);
}

.std-row.review {
  border-left: 5px solid var(--coral);
}

.std-row.solid {
  border-left: 5px solid var(--success);
}

.review-note {
  margin-top: 4px;
  font-size: 0.92rem;
  color: var(--muted);
}

.saved-note {
  margin-top: 16px;
  font-size: 0.95rem;
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.site-footer {
  margin-top: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Focus + motion ── */

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 6px;
}

.hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 1.06rem;
  }
  .btn,
  .chip {
    width: 100%;
  }
  .btn-row,
  .chip-row {
    flex-direction: column;
  }
}
