/* ==============================================================================================
   THE STUDENT DASHBOARD

   Two verbs, made large: take a class, take an exam. Everything else on these screens is either
   the route into one of those two or the record of what happened afterwards.

   The old dashboard offered five navigation tabs, five "learning modes" per topic (three of which
   led to gated screens), and a subject page that hid every topic behind a collapsed accordion. A
   student had to learn the interface before they could learn any medicine.
   ============================================================================================== */

/* ---------------------------------------------------------------- home */

.dash { display: grid; gap: 26px; }
.dash-welcome h1 { margin: 4px 0 0; font-size: 30px; line-height: 1.2; }
.dash-welcome .eyebrow { margin: 0; }

.dash-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-action {
  display: grid; gap: 8px; align-content: start;
  padding: 30px 28px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm); text-decoration: none; color: var(--ink);
  transition: border-color .14s ease, transform .1s ease, box-shadow .14s ease;
}
.dash-action:hover { border-color: var(--accent, var(--brand)); transform: translateY(-2px); box-shadow: var(--shadow); }
.dash-action.learn { --accent: var(--brand); }
.dash-action.exam  { --accent: #2d6ae2; }
.dash-action-icon {
  display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 6px;
  border-radius: 14px; background: var(--surface-soft); color: var(--accent);
}
.dash-action-icon svg { width: 24px; height: 24px; }
.dash-action h2 { margin: 0; font-size: 22px; }
.dash-action p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.dash-action-go {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  font-weight: 700; font-size: 14px; color: var(--accent);
}
.dash-action-go svg { width: 16px; height: 16px; }

.resume-card {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 18px 22px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--ink);
}
.resume-card:hover { border-color: var(--brand-2); }
.resume-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.resume-icon svg { width: 22px; height: 22px; }
.resume-card small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.resume-card strong { display: block; font-size: 17px; margin: 2px 0; }
.resume-card > div > span { font-size: 13px; color: var(--muted); }

.dash-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.dash-stats article {
  padding: 18px; border-radius: var(--radius-md); text-align: center;
  background: var(--surface); border: 1px solid var(--line);
}
.dash-stats strong { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.dash-stats span { font-size: 12px; color: var(--muted); }

.dash-recent { display: grid; gap: 12px; }
.dash-recent-head { display: flex; justify-content: space-between; align-items: baseline; }
.dash-recent-head h2 { margin: 0; font-size: 19px; }
.dash-recent-head a { font-size: 13px; color: var(--brand); }
.dash-empty { margin: 0; padding: 22px; border-radius: var(--radius-md); background: var(--surface-soft); color: var(--muted); font-size: 14px; }

.dash-result-list { display: grid; gap: 8px; }
.dash-result-list a, .dash-result-list .dash-result-row {
  display: grid; grid-template-columns: 62px minmax(0, 1fr) 18px; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: var(--radius-md); text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
}
.dash-result-list a:hover { border-color: var(--brand-2); }
.dash-result-list svg { width: 18px; height: 18px; color: var(--faint); }
.dash-result-score {
  display: grid; place-items: center; padding: 8px 0; border-radius: 10px;
  font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums;
}
.dash-result-score.good { background: var(--brand-soft); color: var(--brand); }
.dash-result-score.ok   { background: var(--surface-warm); color: var(--warning); }
.dash-result-score.low  { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.dash-result-copy strong { display: block; font-size: 15px; }
.dash-result-copy small { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- choose a subject */

.step-heading .eyebrow { color: var(--brand); }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: 8px; }
.back-link:hover { color: var(--brand); }
.back-link svg { width: 14px; height: 14px; transform: rotate(180deg); }

.pick-subject-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.pick-subject {
  display: grid; gap: 8px; align-content: start;
  padding: 26px 24px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--ink);
  transition: border-color .14s ease, transform .1s ease;
}
.pick-subject:hover { border-color: var(--accent); transform: translateY(-2px); }
.pick-subject-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.pick-subject-icon svg { width: 24px; height: 24px; }
.pick-subject h2 { margin: 6px 0 0; font-size: 19px; }
.pick-subject > p { margin: 0; font-size: 13px; color: var(--muted); }
.pick-subject-progress { display: grid; gap: 5px; margin-top: 8px; }
.pick-subject-progress span { font-size: 11px; color: var(--faint); }
.pick-subject-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-weight: 700; font-size: 13px; color: var(--accent); }
.pick-subject-go svg { width: 15px; height: 15px; }
.pick-subject.exam-pick { gap: 10px; }
.pick-subject.exam-pick .button { width: 100%; justify-content: center; margin-top: 6px; }

.exam-resume {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 16px 20px; border-radius: var(--radius-md); text-decoration: none; color: var(--ink);
  background: var(--surface-warm); border: 1.5px solid var(--warning);
}
.exam-resume svg { width: 22px; height: 22px; color: var(--warning); }
.exam-resume strong { display: block; font-size: 15px; }
.exam-resume span { font-size: 13px; color: var(--muted); }
.exam-foot-note {
  display: flex; align-items: flex-start; gap: 10px; margin: 0;
  font-size: 12px; color: var(--muted); line-height: 1.5;
}
.exam-foot-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }

/* ---------------------------------------------------------------- choose a topic */

.subject-page { display: grid; gap: 18px; }
.topic-filter {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--line);
}
.topic-filter svg { width: 18px; height: 18px; color: var(--faint); }
.topic-filter input { border: 0; background: none; font: inherit; font-size: 15px; color: var(--ink); outline: none; width: 100%; }

.topic-groups { display: grid; gap: 22px; }
.topic-group[hidden] { display: none; }
.topic-group-title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.topic-group-title span {
  padding: 1px 8px; border-radius: 999px; background: var(--surface-soft);
  font-size: 11px; letter-spacing: 0; color: var(--faint);
}
.topic-rows { display: grid; gap: 6px; }
.topic-row2 {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 4px 6px 4px 14px; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--line);
}
.topic-row2[hidden] { display: none; }
.topic-row2:hover { border-color: var(--brand-2); }
.topic-row2-main { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 8px; padding: 12px 0; text-decoration: none; color: var(--ink); min-width: 0; }
.topic-row2-mark { font-size: 11px; font-weight: 800; color: var(--brand); text-align: center; }
.topic-row2-mark svg { width: 16px; height: 16px; }
.topic-row2-title { font-size: 15px; overflow-wrap: break-word; }
.topic-row2.done .topic-row2-title { color: var(--muted); }
.topic-row2-start { flex: none; white-space: nowrap; }
.topic-no-match { padding: 22px; border-radius: var(--radius-md); background: var(--surface-soft); color: var(--muted); text-align: center; }

/* ---------------------------------------------------------------- start the class */

.topic-start { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.topic-start-main {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) 24px; align-items: center; gap: 18px;
  padding: 26px 28px; border-radius: var(--radius-lg); text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--brand); box-shadow: var(--shadow-sm);
}
.topic-start-main:hover { background: var(--brand-soft); }
.topic-start-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: var(--brand); color: var(--surface); }
.topic-start-icon svg { width: 26px; height: 26px; }
.topic-start-main h2 { margin: 0 0 4px; font-size: 21px; }
.topic-start-main p { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.topic-start-go svg { width: 24px; height: 24px; color: var(--brand); }
.topic-start-side {
  display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 12px;
  align-content: center; padding: 22px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.topic-start-side:hover { border-color: var(--brand-2); }
.topic-start-side svg { width: 22px; height: 22px; color: var(--warning); }
.topic-start-side strong { display: block; font-size: 15px; }
.topic-start-side span { font-size: 12px; color: var(--muted); }
.topic-start-side small { grid-column: 1 / -1; font-size: 11px; color: var(--faint); }

/* ---------------------------------------------------------------- the result screen */

.result-hero {
  display: grid; justify-items: center; text-align: center; gap: 6px;
  padding: 40px 28px; border-radius: var(--radius-lg); margin-bottom: 22px;
  background: var(--surface); border: 1.5px solid var(--line);
}
.result-hero.good { border-color: var(--brand); background: var(--brand-soft); }
.result-hero.ok   { border-color: var(--warning); background: var(--surface-warm); }
.result-hero.low  { border-color: var(--danger); }
.result-hero h1 { margin: 0; font-size: 62px; line-height: 1; font-variant-numeric: tabular-nums; }
.result-tally { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; margin: 14px 0 6px; }
.result-tally .tally { display: grid; font-size: 12px; color: var(--muted); }
.result-tally .tally strong { font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }
.result-tally .correct strong { color: var(--brand); }
.result-tally .incorrect strong { color: var(--danger); }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.result-scroll-hint { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- narrow screens */

@media (max-width: 860px) {
  .dash-actions { grid-template-columns: 1fr; }
  .topic-start { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .dash-welcome h1 { font-size: 24px; }
  .dash-action { padding: 22px 20px; }
  .dash-action h2 { font-size: 19px; }
  .dash-stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .dash-stats article { padding: 14px 8px; }
  .dash-stats strong { font-size: 21px; }
  .dash-stats span { font-size: 11px; }
  .resume-card { grid-template-columns: 40px minmax(0, 1fr); }
  .resume-card .button { grid-column: 1 / -1; justify-content: center; }
  .topic-row2 { grid-template-columns: minmax(0, 1fr); padding: 12px 14px; gap: 8px; }
  .topic-row2-main { padding: 0; grid-template-columns: 34px minmax(0, 1fr); }
  .topic-row2-start { width: 100%; justify-content: center; }
  .topic-start-main { grid-template-columns: 44px minmax(0, 1fr); padding: 22px 18px; }
  .topic-start-go { display: none; }
  .result-hero { padding: 30px 18px; }
  .result-hero h1 { font-size: 48px; }
  .result-actions .button { width: 100%; justify-content: center; }
}

/* ==============================================================================================
   THE CLASSFORMED WORDMARK

   The product name is rendered in its own blue wherever it appears — in the logo lock-up and in
   running prose — so a reader picks it out of a sentence without having to parse it. The blue is
   a token with a light and a dark value, because #1d4ed8 is unreadable on the dark surface.
   ============================================================================================== */

.brand,
.mobile-logo,
.public-brand,
.student-brand { color: var(--ink); }

/* The mark is part of the lock-up, so it takes the blue rather than staying teal beside the word. */
.brand .brand-mark,
.mobile-logo .brand-mark,
.public-brand .brand-mark { color: var(--brandname); }

/* The sign-in and recovery pages set the lock-up on a deep teal artwork panel that stays dark in
   both themes. "Black" is unreadable there, so this one surface inverts the whole lock-up and
   lifts "for" to a light blue. #8ab4ff — the dark-theme token — was tried first and rejected:
   it measures 2.86:1 against the light end of that gradient, under the 3.0 floor for large bold
   text. #a8c8ff holds 3.52:1 at the light end and 5.25:1 at the dark end. */
.auth-brand { color: #fff; }
.auth-brand .brand-mark { color: #fff; }
.auth-brand .brand-word .brand-for { color: #a8c8ff; }

/* The "Medical School" descender under the wordmark stays quiet — it is not part of the name. */
.student-brand small { color: var(--muted); }

/* The name inside a sentence. Weight carries it as much as hue, so it still reads as a name for
   anyone who cannot separate the blue from the surrounding text. */
.brandname {
  color: var(--ink);
  font-weight: 700;
  font-style: normal;
}

/* The name is the compound Class-for-med. "for" is the hinge, so it takes the blue and the two
   halves take --ink — the theme's version of black, since #000 disappears on the dark surface.
   Weight still carries the name for anyone who cannot separate the hue from the running text. */
.brand-word { white-space: nowrap; }
.brand-word .brand-for { color: var(--brandname); }

/* Results page (exam-based) */
.results-page { display: grid; gap: 18px; }
.results-page .bar-list { display: grid; gap: 16px; padding: 6px 4px; }
.results-page .bar-row-top, .results-page .bar-row-top strong { font-size: 14px; }
