/* ParaPrep brand fonts (Brief 29). One import here propagates type site-wide,
   matching the token approach below. Space Grotesk = display, Inter = body,
   Space Mono = doses / stats / labels. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&family=Space+Mono:wght@400;700&display=swap");

:root {
  /* ===== ParaPrep brand tokens (Brief 29), the moodboard palette ===== */
  --signal: #2C5CFF;        /* PRIMARY, Signal Blue */
  --signal-600: #1E45D6;    /* hover / pressed / primary text on light */
  --mint: #19E3A6;          /* Vital Mint, fills + large accents + gradient only */
  --mint-ink: #097A52;      /* AA-safe success green for small text/borders on light */
  --mint-soft: #E9FCF5;     /* pale mint surface (correct-answer background) */
  --coral: #FF4757;         /* Pulse Coral, vibrant accent / red-box, used sparingly */
  --coral-ink: #CC2436;     /* AA-safe error red for small text/borders on light */
  --coral-soft: #FFF0F1;    /* pale coral surface */
  --navy: #0B1221;          /* deep ink */
  --paper: #F5F7FC;         /* cool app background */
  --grad: linear-gradient(120deg, #2C5CFF 0%, #4A7BFF 45%, #19E3A6 100%); /* signature "pulse" */
  --grad-dark: linear-gradient(125deg, #15205E 0%, #0B1221 65%);
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* ===== Legacy token names, remapped to the brand so all 27 pages re-skin
     via token values, with no class/layout changes (see Brief 29). ===== */
  --bg: var(--paper);
  --surface: #ffffff;
  --ink: var(--navy);
  --muted: #5B6678;
  --line: #E4E9F2;
  --teal: var(--signal);            /* primary (was teal) */
  --teal-dark: var(--signal-600);   /* primary-dark / nav + link text */
  --teal-soft: #E7EDFF;             /* primary soft tint */
  --amber: #9a6510;                 /* warning text, darkened from #b7791f to clear WCAG AA */
  --amber-bg: #fdf6e7;
  --green: var(--mint-ink);         /* success text/border (AA-safe) */
  --red: var(--coral-ink);          /* error text/border (AA-safe) */
  --shadow: 0 1px 2px rgba(11,18,33,.06), 0 8px 24px rgba(11,18,33,.08);
  --radius: 12px;
  --amber-border: #f0e3c4;
  --purple: #6b46c1;
  --purple-bg: #efe7fb;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Headings + the wordmark in the display face (Brief 29). Additive: only sets
   the family, so existing per-element sizes/spacing are untouched. */
h1, h2, h3, h4, h5, .brand h1, .view-title, .section-head, .dash-hero h2 {
  font-family: var(--font-display);
}
.mono { font-family: var(--font-mono); }

/* ---- Header ---- */
.site-header {
  display: flex; align-items: center; gap: 1.5rem;
  padding: .85rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: .7rem; }
/* ParaPrep mark: the white "pulse spike" over the signature gradient.
   The ✚ glyph in markup is hidden (font-size:0) so the mark upgrades on all
   25 page headers via this one rule, with no HTML changes. */
.logo {
  width: 40px; height: 40px; border-radius: 11px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none'%3E%3Cpath d='M4 21h6l3-10 5 19 3-13 2 4h8' stroke='%23ffffff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 26px 26px no-repeat,
    var(--grad);
  display: grid; place-items: center;
  font-size: 0; line-height: 0; color: transparent;
  box-shadow: 0 2px 8px rgba(44,92,255,.28);
}
.brand h1 { font-size: 1.15rem; margin: 0; letter-spacing: -.01em; }
.tagline { margin: 0; font-size: .78rem; color: var(--muted); }

.main-nav { display: flex; gap: .35rem; margin-left: auto; flex-wrap: wrap; }
.main-nav a {
  text-decoration: none; color: var(--muted); font-weight: 600;
  font-size: .9rem; padding: .45rem .8rem; border-radius: 8px;
}
.main-nav a:hover { background: var(--teal-soft); color: var(--teal-dark); }
.main-nav a.active { background: var(--teal); color: #fff; }

.level-toggle { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.level-toggle button {
  border: 0; background: var(--surface); color: var(--muted);
  font-weight: 700; font-size: .82rem; padding: .45rem .85rem; cursor: pointer;
  min-height: 40px;
}
.level-toggle button.active { background: var(--teal-dark); color: #fff; }
/* Edition toggle (2026 current / 2014 legacy) reuses .level-toggle */
.edition-toggle button { display: inline-flex; align-items: center; gap: .3rem; }
.edition-toggle .edition-tag {
  font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); background: var(--teal-soft, #e3f0ef); border-radius: 999px; padding: .04rem .35rem;
}
.edition-toggle button.active .edition-tag { color: #fff; background: rgba(255, 255, 255, .22); }
/* Checklist view header: title left, edition switch right */
.checklist-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.checklist-head .view-title { margin: 0; }

/* ---- Disclaimer ---- */
.disclaimer-bar {
  background: var(--amber-bg); color: var(--amber);
  font-size: .82rem; padding: .55rem 1.5rem; text-align: center;
  border-bottom: 1px solid #f0e3c4;
}

/* ---- Layout ---- */
main { max-width: 1000px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
h2.view-title { font-size: 1.5rem; margin: 0 0 .25rem; letter-spacing: -.02em; }
.view-sub { color: var(--muted); margin: 0 0 1.5rem; font-size: .95rem; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 1rem; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: .9rem; }

/* Home feature cards */
.feature-card { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; text-decoration: none; color: inherit; display: block; }
.feature-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(20,50,55,.12); }
.feature-card .icon { font-size: 1.6rem; }
.hero {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff; border-radius: var(--radius); padding: 2rem; margin-bottom: 2rem;
}
.hero h2 { margin: 0 0 .5rem; font-size: 1.7rem; }
.hero p { margin: 0; opacity: .92; max-width: 60ch; }
.pill { display:inline-block; background: rgba(255,255,255,.18); padding:.2rem .6rem; border-radius:999px; font-size:.78rem; margin-top:1rem;}

/* Notes */
.topic-block { margin-bottom: 1.8rem; }
.topic-block > h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--teal-dark); border-bottom: 2px solid var(--teal-soft); padding-bottom: .3rem; }
.note { background: var(--surface); border:1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin-top: 1rem; box-shadow: var(--shadow); }
.note h4 { margin: 0 0 .5rem; }
.note pre { white-space: pre-wrap; font-family: inherit; margin: 0; color: var(--ink); font-size: .92rem; }
.level-badge { font-size: .7rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; background: var(--teal-soft); color: var(--teal-dark); margin-left: .5rem; vertical-align: middle; }

/* Deep-link target: a note opened from a competency link briefly highlights
   (free sample-notes view and the paid library both use this, Brief 16). */
.note.note-flash { animation: noteFlash 2.2s ease-out 1; outline: none; }
.note.note-flash:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
@keyframes noteFlash {
  0%   { box-shadow: 0 0 0 3px var(--teal); background: var(--teal-soft); }
  100% { box-shadow: var(--shadow); background: var(--surface); }
}
@media (prefers-reduced-motion: reduce) {
  .note.note-flash { animation: none; box-shadow: 0 0 0 2px var(--teal); }
}

/* Drug table */
.search-box { width: 100%; padding: .7rem 1rem; border:1px solid var(--line); border-radius: 9px; font-size: 1rem; margin-bottom: 1rem; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.drug-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.drug-table th { background: var(--teal-dark); color:#fff; text-align: left; padding: .7rem .9rem; font-size: .82rem; }
.drug-table td { padding: .7rem .9rem; border-top: 1px solid var(--line); font-size: .88rem; vertical-align: top; }
.drug-table tr:hover td { background: #f8fbfb; }

/* Quiz */
.quiz-card { background: var(--surface); border:1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); max-width: 680px; }
.q-progress { color: var(--muted); font-size: .82rem; margin-bottom: .5rem; }
.q-text { font-size: 1.12rem; font-weight: 600; margin: 0 0 1.1rem; }
.option { display:block; width:100%; text-align:left; padding: .8rem 1rem; margin-bottom: .6rem; border:1px solid var(--line); border-radius: 9px; background:#fff; cursor:pointer; font-size:.95rem; transition: background .1s; }
.option:hover { background: var(--teal-soft); }
.option.correct { background: #e6f5ec; border-color: var(--green); }
.option.wrong { background: #fbe9e7; border-color: var(--red); }
.option:disabled { cursor: default; }
.explain { margin-top: 1rem; padding: .9rem 1rem; background: var(--teal-soft); border-radius: 9px; font-size: .9rem; }
.btn { background: var(--teal); color:#fff; border:0; padding:.7rem 1.3rem; border-radius:9px; font-weight:700; cursor:pointer; font-size:.92rem; }
.btn:hover { background: var(--teal-dark); }
.btn.secondary { background: var(--surface); color: var(--teal-dark); border:1px solid var(--line); }
.score-big { font-size: 2.4rem; font-weight: 800; color: var(--teal-dark); }

/* Checklist */
.check-row { display:flex; align-items:flex-start; gap:.7rem; padding:.85rem .9rem; border:1px solid var(--line); border-radius:9px; background:var(--surface); margin-bottom:.5rem; box-shadow: var(--shadow); }
.check-row input { width:24px; height:24px; margin-top:1px; accent-color: var(--teal); cursor:pointer; }
.check-row label { cursor:pointer; }
.check-area { font-size:.7rem; text-transform:uppercase; letter-spacing:.05em; color: var(--muted); display:block; }

/* Competency → study-note links (Brief 16). Shared by the free Standards view
   (app.js) and the paid checklist tool (checklist.js): the competency text is a
   link to its note, with a per-row tag for "has note / coming soon / upgrade". */
.cl-item { flex: 1 1 auto; min-width: 0; line-height: 1.4; }
.cl-item-link, .cl-item-text { display: inline; }
.cl-item-link { color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--teal-soft); cursor: pointer; }
.cl-item-link:hover, .cl-item-link:focus-visible { color: var(--teal-dark); border-bottom-color: var(--teal); }
.cl-item-link.upgrade { color: var(--amber); border-bottom-color: #f0e3c4; }
.cl-item-link.upgrade:hover, .cl-item-link.upgrade:focus-visible { color: var(--amber); border-bottom-color: var(--amber); }
.cl-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .4rem; }
.cl-note { font-size: .7rem; font-weight: 700; border-radius: 999px; padding: .12rem .55rem; letter-spacing: .01em; white-space: nowrap; }
.cl-note.has { color: var(--teal-dark); background: var(--teal-soft); }
.cl-note.locked { color: var(--amber); background: var(--amber-bg); }
.cl-note.soon { color: var(--muted); background: #f1f5f6; font-weight: 600; }
.cl-note-extra { font-weight: 600; opacity: .85; }
.cl-coverage { margin: 0 0 1.4rem; font-size: .82rem; color: var(--muted); }
.cl-coverage strong { color: var(--teal-dark); }

.progress-wrap { background: var(--surface); border:1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top:.5rem; }
.bar > span { display:block; height:100%; background: var(--green); width:0; transition: width .3s; }

/* Screen-reader-only utility (visually hidden, still announced). */
.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;
}

/* Visible keyboard focus (site-wide). Mouse users keep the default look via
   :focus-visible; only keyboard/AT focus shows the ring. */
a:focus-visible, button:focus-visible, .btn:focus-visible, .option:focus-visible,
.main-nav a:focus-visible, .choice:focus-visible, .deck-card:focus-visible,
.grade-btn:focus-visible, .nav-cell:focus-visible, .footer-rich a:focus-visible,
.lp-footer-links a:focus-visible, .checkout-banner button:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--teal-dark); outline-offset: 2px;
}

/* Footer */
.site-footer { max-width:1000px; margin: 0 auto; padding: 1.5rem; color: var(--muted); font-size: .78rem; display:flex; justify-content: space-between; gap:1rem; flex-wrap: wrap; border-top:1px solid var(--line); }

@media (max-width: 620px) {
  .main-nav { order: 3; width: 100%; margin-left: 0; }
  .level-toggle { margin-left: auto; }
}
