/* RocketServe CA Notary Training — mobile-first product styles */

:root {
  --ink: #16233b;
  --muted: #5b6b84;
  --line: #dbe2ee;
  --bg: #f5f7fb;
  --card: #ffffff;
  --brand: #1d4fd7;
  --brand-dark: #163ca6;
  --brand-soft: #e7edfd;
  --gold: #b07d1f;
  --gold-soft: #f7efdc;
  --good: #1e7d46;
  --good-soft: #e2f2e8;
  --bad: #bb3a2c;
  --bad-soft: #f9e6e3;
  --warn: #8a6410;
  --warn-soft: #f6eed6;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(22, 35, 59, 0.08), 0 4px 16px rgba(22, 35, 59, 0.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 "Inter", system-ui, -apple-system, sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3 { font-family: "Source Serif 4", Georgia, serif; line-height: 1.2; margin: 0 0 .5rem; text-wrap: balance; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.05rem; }
p { margin: .5rem 0; }
a { color: var(--brand); }
button { font: inherit; }

/* ---------- chrome ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .55rem max(1rem, env(safe-area-inset-left));
  background: #fff; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); }
.brand-rocket { font-size: 1.5rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1rem; }
.brand-text small { color: var(--muted); font-size: .72rem; letter-spacing: .04em; }
.topnav { display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; justify-content: flex-end; }
.topnav a, .topnav .linklike {
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: .88rem;
  padding: .55rem .6rem; border-radius: 8px; border: none; background: none; cursor: pointer;
}
.topnav a:hover, .topnav .linklike:hover { background: var(--brand-soft); color: var(--brand-dark); }

.view { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 1.1rem 1rem 3rem; }
.footer { border-top: 1px solid var(--line); background: #fff; padding: 1.2rem 1rem 1.6rem; text-align: center; font-size: .85rem; color: var(--muted); }
.footnote { max-width: 720px; margin: .5rem auto 0; font-size: .78rem; line-height: 1.5; }

/* ---------- primitives ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.15rem; margin: 0 0 1rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .7rem 1.25rem; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none; text-align: center;
  transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: #fff; color: var(--brand-dark); border-color: var(--brand); }
.btn-secondary:hover { background: var(--brand-soft); }
.btn-quiet { background: #fff; color: var(--muted); border-color: var(--line); }
.btn-quiet:hover { background: var(--bg); }
.btn-danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .8rem; }
.stack { display: flex; flex-direction: column; gap: .9rem; }

.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; }
.pill-cat { background: var(--brand-soft); color: var(--brand-dark); }
.pill-2026 { background: var(--gold-soft); color: var(--gold); }
.pill-pending { background: var(--warn-soft); color: var(--warn); }
.pill-good { background: var(--good-soft); color: var(--good); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }

.notice { border-radius: 10px; padding: .7rem .9rem; font-size: .9rem; margin: .6rem 0; }
.notice-info { background: var(--brand-soft); color: var(--brand-dark); }
.notice-warn { background: var(--warn-soft); color: var(--warn); }

.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; }
.field label { font-weight: 600; font-size: .88rem; }
.field input, .field select, .field textarea {
  font: inherit; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); min-height: 48px;
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .btn:focus-visible, .choice:focus-visible {
  outline: 3px solid rgba(29, 79, 215, 0.35); outline-offset: 1px;
}

.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 10px;
  font-size: .9rem; z-index: 50; max-width: min(92vw, 460px); text-align: center;
}

/* ---------- landing ---------- */
.hero { text-align: center; padding: 2.2rem 0 1.2rem; }
.hero .eyebrow { color: var(--gold); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-size: .75rem; }
.hero h1 { font-size: clamp(2rem, 6vw, 2.9rem); margin: .4rem 0; }
.hero .sub { color: var(--muted); max-width: 560px; margin: .4rem auto 1.2rem; font-size: 1.05rem; }
.hero .powered { color: var(--muted); font-size: .8rem; margin-top: 1rem; }
.hero .btn-row { justify-content: center; }
.steps-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; margin-top: 1.4rem; }
.steps-strip .card { margin: 0; padding: .9rem 1rem; text-align: left; }
.steps-strip .num { font-family: "Source Serif 4", serif; font-weight: 700; color: var(--brand); font-size: 1.2rem; }

/* ---------- dashboard / setup grids ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: .9rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.mode-tile {
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
  padding: .75rem .8rem; text-align: left; min-height: 72px;
}
.mode-tile.selected { border-color: var(--brand); background: var(--brand-soft); }
.mode-tile b { display: block; font-size: .95rem; }
.mode-tile span { color: var(--muted); font-size: .78rem; }
.count-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.count-btn {
  min-width: 64px; min-height: 52px; border-radius: 10px; border: 1.5px solid var(--line);
  background: #fff; font-weight: 700; font-size: 1.05rem; cursor: pointer;
}
.count-btn.selected { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }

/* ---------- quiz player ---------- */
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; flex-wrap: wrap; }
.progressbar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: .3rem 0 1rem; }
.progressbar > div { height: 100%; background: var(--brand); border-radius: 999px; transition: width .2s; }
.qtext { font-size: 1.12rem; font-weight: 600; line-height: 1.5; }
.badges { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.choices { display: flex; flex-direction: column; gap: .6rem; margin-top: .9rem; }
.choice {
  display: flex; gap: .7rem; align-items: flex-start; width: 100%; text-align: left;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
  padding: .8rem .9rem; font-size: 1rem; line-height: 1.45; min-height: 52px;
}
.choice .key {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
  background: var(--bg); color: var(--muted); text-transform: uppercase;
}
.choice:hover { border-color: var(--brand); }
.choice.selected { border-color: var(--brand); background: var(--brand-soft); }
.choice.correct { border-color: var(--good); background: var(--good-soft); }
.choice.correct .key { background: var(--good); color: #fff; }
.choice.incorrect { border-color: var(--bad); background: var(--bad-soft); }
.choice.incorrect .key { background: var(--bad); color: #fff; }
.choice[disabled] { cursor: default; }
.feedback { border-radius: 10px; padding: .9rem 1rem; margin-top: .9rem; }
.feedback.good { background: var(--good-soft); }
.feedback.bad { background: var(--bad-soft); }
.feedback .verdict { font-weight: 700; }
.memory-aid { background: var(--gold-soft); border-radius: 10px; padding: .7rem .9rem; margin-top: .6rem; font-size: .95rem; }
.citation { color: var(--muted); font-size: .8rem; margin-top: .5rem; }
.quiz-nav {
  display: flex; gap: .6rem; margin-top: 1.1rem;
  position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: .8rem 0 .4rem;
}
.quiz-nav .btn { flex: 1; }

/* ---------- results ---------- */
.score-hero { text-align: center; padding: 1.4rem 0 .6rem; }
.score-big { font-family: "Source Serif 4", serif; font-size: 3.2rem; font-weight: 700; line-height: 1; }
.score-pass { color: var(--good); } .score-fail { color: var(--bad); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; margin: 1rem 0; }
.stat-tile { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; text-align: center; }
.stat-tile b { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.stat-tile span { font-size: .75rem; color: var(--muted); }
.cat-bar { margin: .45rem 0; }
.cat-bar .lbl { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: .2rem; }
.cat-bar .track { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.cat-bar .fill { height: 100%; border-radius: 999px; background: var(--brand); }

/* ---------- journey ---------- */
.journey-step { display: flex; gap: .9rem; }
.journey-num {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; background: var(--brand-soft); color: var(--brand-dark);
}
.journey-step.complete .journey-num { background: var(--good); color: #fff; }
.journey-links { font-size: .85rem; display: flex; flex-direction: column; gap: .15rem; margin: .4rem 0; }
.journey-form { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .6rem; }
.journey-form .field { margin: 0; }
.journey-form .field.wide { grid-column: 1 / -1; }
.keyfacts { font-size: .85rem; color: var(--muted); padding-left: 1.1rem; margin: .4rem 0; }

/* ---------- flashcards ---------- */
.flashcard {
  border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow);
  padding: 1.4rem 1.2rem; min-height: 220px; display: flex; flex-direction: column; justify-content: center;
  text-align: center; cursor: pointer; font-size: 1.08rem;
}
.flashcard .hint { color: var(--muted); font-size: .78rem; margin-top: 1rem; }

@media (max-width: 480px) {
  .topnav a, .topnav .linklike { font-size: .8rem; padding: .5rem .45rem; }
  .journey-form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- simulation navigator ---------- */
.sim-nav { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 .8rem; }
.sim-dot {
  min-width: 40px; min-height: 40px; border-radius: 8px; border: 1.5px solid var(--line);
  background: #fff; font-weight: 600; font-size: .85rem; cursor: pointer; color: var(--muted);
}
.sim-dot.answered { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.sim-dot.current { outline: 3px solid rgba(29, 79, 215, 0.35); }
.source-details summary { cursor: pointer; font-size: .85rem; color: var(--muted); margin-top: .4rem; }

/* ---------- learning experience ---------- */
.lesson-block { border-left: 3px solid var(--line); padding: .5rem .9rem; margin: .7rem 0; border-radius: 0 8px 8px 0; }
.lesson-block-rule { border-left-color: var(--brand); background: var(--brand-soft); }
.lesson-block-memory { border-left-color: var(--gold); background: var(--gold-soft); }
.lesson-block-trap { border-left-color: var(--bad); background: var(--bad-soft); }
.lesson-block-source { border-left-color: var(--muted); }
.lesson-block-platform { border-left-color: var(--good); background: var(--good-soft); }
