/* Premier Casper Prep -- Practice Suite visual system.
   Re-skinned from the original Casper teal onto the shared Premier Exam Prep
   brand (mirrors premier-exam-prep/src/styles/tokens.css): deep navy ink, a
   cyan accent, a warm signal color, and Inter type. White cards on a soft cool
   background, one focused task on screen at a time, a prominent countdown. */

:root {
  /* ---- Premier brand tokens (source of truth, shared with the umbrella site) ---- */
  --brand: #003c68;            /* deep navy: primary actions, headings, body ink */
  --brand-deep: #002742;       /* navy hover/press */
  --accent: #1ca4c7;           /* cyan: accents, pills, tags, timer, progress */
  --accent-soft: rgba(28, 164, 199, 0.14);
  --ink: #003c68;
  --ink-soft: #4a6984;
  --warm: #f08a1d;             /* signature orange: brand box + break accent */
  --warm-ink: #9a6c10;         /* warm text on light surfaces */
  --success: #2f6f57;
  --error: #a53224;
  --bg: #edf4f8;               /* soft cool page background */
  --panel: #ffffff;
  --panel-strong: #f7fbff;
  --white: #ffffff;
  --line: rgba(0, 60, 104, 0.14);
  --shadow: 0 10px 30px rgba(0, 60, 104, 0.10);
  --focus-ring: 0 0 0 3px rgba(28, 164, 199, 0.30);
  --radius: 16px;
  --btn-radius: 12px;
  --maxw: 820px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* ---- Back-compat aliases: existing rules keep working, now in brand colors.
     The --teal* names predate the rebrand and now resolve to the Premier accent/navy. ---- */
  --teal: var(--accent);
  --teal-dark: var(--brand);
  --teal-soft: var(--accent-soft);
  --slate: var(--ink-soft);
  --amber: var(--warm-ink);
  --red: var(--error);
  --green: var(--success);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- App header / progress ---------- */
.appbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
/* Brand lockup: "Premier [Casper] Prep" — the same wordmark the Premier site
   header uses, with the exam name in the signature warm box. */
.brand { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 0; text-decoration: none; }
.brand .logo { height: 34px; width: auto; display: block; }
.brand-wm {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  font-weight: 300;
  font-style: italic;
  font-size: 18px;
  letter-spacing: 0.035em;
  color: var(--brand);
  white-space: nowrap;
}
.brand-box {
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--warm);
  padding: 1px 7px;
  border-radius: 6px;
}
.brand-prep {
  font-style: normal;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--ink-soft);
}
.appbar .meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--slate);
  font-size: 14px;
}
.pill {
  background: var(--teal-soft);
  color: var(--teal-dark);
  border-radius: 999px;
  padding: 5px 12px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

/* progress segments under the bar */
.progress {
  display: flex;
  gap: 4px;
  padding: 10px 22px 0;
  background: var(--white);
}
.progress .seg {
  height: 5px;
  flex: 1;
  border-radius: 3px;
  background: var(--line);
}
.progress .seg.done { background: var(--teal); }
.progress .seg.current { background: var(--teal); opacity: 0.55; }
.progress-wrap { background: var(--white); border-bottom: 1px solid var(--line); padding-bottom: 12px; }

/* ---------- Main canvas ---------- */
.main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 38px 20px 80px;
}
.stage { width: 100%; max-width: var(--maxw); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 38px;
}

h1 { font-size: 30px; line-height: 1.25; margin: 0 0 12px; }
h2 { font-size: 22px; margin: 0 0 10px; }
h3 { font-size: 16px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--slate); margin: 0 0 8px; }
p { margin: 0 0 14px; }
.lead { font-size: 18px; color: var(--slate); }
.muted { color: var(--slate); }
.small { font-size: 14px; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: var(--btn-radius);
  background: var(--brand);
  color: #fff;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn:hover { background: var(--brand-deep); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--teal-dark); border: 1.5px solid var(--line); }
.btn.ghost:hover { background: var(--teal-soft); }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #9c2c20; }
.btn.lg { font-size: 18px; padding: 15px 34px; }
.actions { display: flex; gap: 12px; align-items: center; margin-top: 26px; }
.actions .spacer { margin-left: auto; }

/* ---------- Timer ---------- */
.timer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 20px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  padding: 8px 16px;
  border-radius: 10px;
}
.timer.warn { color: var(--amber); background: #fbf0dd; }
.timer.crit { color: var(--red); background: #fae6e3; }
.timer .ring {
  width: 14px; height: 14px; border-radius: 50%;
  border: 3px solid currentColor; border-right-color: transparent;
  animation: spin 1.1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Home / test grid ---------- */
.hero { text-align: center; padding: 18px 0 28px; }
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 10px;
}

/* Umbrella footer: ties the suite back to Premier Exam Prep. */
.site-foot {
  text-align: center;
  padding: 28px 20px 48px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}
.site-foot .foot-brand { font-weight: 700; color: var(--brand); }
.site-foot a { color: var(--brand); font-weight: 600; text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.site-foot .sep { margin: 0 9px; color: #9aacba; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.test-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.test-card:hover { border-color: var(--teal); box-shadow: var(--shadow); }
.test-card:active { transform: translateY(1px); }
.test-card .n { font-size: 13px; font-weight: 700; color: var(--teal); letter-spacing: 0.5px; }
.test-card .t { font-size: 18px; font-weight: 700; margin: 4px 0 6px; }
.test-card .d { font-size: 14px; color: var(--slate); }
.test-card .badge { display:inline-block; margin-top:12px; font-size:12px; color:var(--slate); }
.test-card.done-mark { border-left: 4px solid var(--green); }

/* ---------- Context / scenario ---------- */
.context-card {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 48px 44px;
  text-align: center;
  font-size: 21px;
  line-height: 1.55;
}
.context-card .label { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: #9fb3c0; margin-bottom: 14px; }

.scene-meta { display:flex; gap:8px; flex-wrap:wrap; margin-bottom: 16px; }
.tag { font-size:12px; background: var(--teal-soft); color: var(--teal-dark); padding:4px 10px; border-radius:999px; font-weight:600; }
.tag.kind { background:#eef2f7; color: var(--slate); }

/* video prompt */
.videobox {
  background: #0c1116;
  border-radius: 12px;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #c7d2dc;
  text-align: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.videobox .play {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.5);
  display:flex; align-items:center; justify-content:center;
  font-size: 24px; color:#fff; cursor:pointer; margin-bottom: 14px;
}
.videobox .play:hover { background: rgba(255,255,255,0.22); }
video.preview { width: 100%; border-radius: 12px; background:#000; }

/* word-based scenario */
.word-prompt {
  font-size: 19px;
  line-height: 1.7;
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 10px;
  padding: 24px 26px;
}

/* scripted scene presented as readable text (when no video clip exists) */
.dialogue {
  font-size: 18px;
  line-height: 1.7;
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 10px;
  padding: 22px 26px;
}
.dialogue .dl { margin: 0 0 13px; }
.dialogue .dl:last-child { margin-bottom: 0; }
.dialogue .who { font-weight: 700; color: var(--ink); }
.dialogue .sd { color: var(--slate); font-style: italic; margin: 0 0 13px; }
.dialogue .sd:last-child { margin-bottom: 0; }

/* script transcript (collapsible helper) */
.script { margin-top: 16px; }
.script summary { cursor: pointer; color: var(--teal-dark); font-weight: 600; font-size: 14px; }
.script .line { margin: 8px 0; }
.script .who { font-weight: 700; color: var(--ink); }
.script .sd { color: var(--slate); font-style: italic; }

/* ---------- Questions ---------- */
.qblock { margin-bottom: 22px; }
.qnum { font-size: 13px; font-weight: 700; color: var(--teal); letter-spacing: 0.5px; }
.qtext { font-size: 18px; font-weight: 600; margin: 4px 0 12px; }
textarea {
  width: 100%;
  min-height: 150px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.6;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  resize: vertical;
  color: var(--ink);
}
textarea:focus { outline: none; border-color: var(--teal); }
.wordcount { font-size: 13px; color: var(--slate); text-align: right; margin-top: 4px; }

/* text inputs (student identity on the intro screen, admin token) */
.field { margin: 0 0 14px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.field input {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--teal); }

/* ---------- Reflection ---------- */
.center-screen { text-align:center; padding: 30px 0; }
.bigtimer {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 64px;
  color: var(--teal-dark);
  margin: 10px 0 6px;
}

/* ---------- Break ---------- */
.break-card { text-align:center; }
.break-card .bigtimer { color: var(--warm); }

/* ---------- Review ---------- */
.review-item { border:1px solid var(--line); border-radius:12px; padding:22px 24px; margin-bottom:16px; background:#fff; }
.review-item .rhead { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.answer-box { background:#f7fafa; border:1px solid var(--line); border-radius:8px; padding:12px 14px; white-space:pre-wrap; font-size:15px; }
.answer-box.empty { color: var(--slate); font-style: italic; }
.cue { background: var(--teal-soft); border-radius:8px; padding:12px 14px; margin-top:10px; font-size:15px; }
.cue .h { font-weight:700; color: var(--teal-dark); display:block; margin-bottom:4px; }
.watch { background:#fbf0dd; border-radius:8px; padding:12px 14px; margin-top:8px; font-size:15px; }
.watch .h { font-weight:700; color: var(--amber); display:block; margin-bottom:4px; }
.recorded-video { width:100%; max-width:360px; border-radius:8px; background:#000; margin-top:6px; }

/* ---------- helpers ---------- */
.notice { background:#fff7ed; border:1px solid #f3d9b5; color:#7a521a; border-radius:10px; padding:12px 16px; font-size:14px; margin-bottom:18px; }
.kvlist { list-style:none; padding:0; margin:0 0 14px; }
.kvlist li { padding:9px 0; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; gap:12px; }
.kvlist li:last-child { border-bottom:0; }
.kvlist .k { color: var(--slate); }
.kvlist .v { font-weight:600; }
hr.soft { border:0; border-top:1px solid var(--line); margin: 22px 0; }
.recdot { width:12px;height:12px;border-radius:50%;background:var(--red);display:inline-block;margin-right:8px;animation:pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.3;} }

/* ============================================================
   Dashboard shell -- mirrors the mcat/preview student dashboard
   (navy gradient sidebar, Practice/Performance nav, soft content
   area, white cards), rendered in the Premier Casper brand tokens.
   ============================================================ */
.dash { display: flex; min-height: 100vh; }

.sidebar {
  width: 256px;
  flex-shrink: 0;
  color: #fff;
  background: linear-gradient(165deg, var(--brand) 0%, var(--brand-deep) 100%);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.sidebar .side-head { padding: 22px 18px; border-bottom: 1px solid rgba(255,255,255,0.12); text-align: center; }
.sidebar .side-logo { display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem; }
.sidebar .side-logo img { height: 30px; width: auto; display: block; }
.sidebar .side-wm {
  display: inline-flex; align-items: baseline; gap: 0.3rem;
  font-weight: 300; font-style: italic; font-size: 17px; letter-spacing: 0.03em; color: #fff; white-space: nowrap;
}
.sidebar .side-wm .brand-box { font-style: normal; }
.sidebar .side-sub { margin-top: 8px; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.6); }
.sidebar nav { padding: 14px 0; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  margin: 0 12px; width: calc(100% - 24px);
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px;
  background: transparent; border: 0; cursor: pointer; text-align: left;
  color: rgba(255,255,255,0.78); font-family: inherit; font-size: 15px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.13); color: #fff; }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.sidebar .side-foot { margin-top: auto; padding: 18px; font-size: 12px; color: rgba(255,255,255,0.5); }
.sidebar .side-foot a { color: rgba(255,255,255,0.82); text-decoration: none; }
.sidebar .side-foot a:hover { text-decoration: underline; }

.dash-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-topbar {
  background: var(--white); border-bottom: 1px solid var(--line);
  padding: 12px 24px; display: flex; align-items: center; justify-content: space-between;
}
.dash-topbar .home-link { color: var(--ink-soft); display: inline-flex; }
.dash-topbar .home-link svg { width: 20px; height: 20px; }
.dash-topbar .home-link:hover { color: var(--accent); }
.dash-topbar .who { font-size: 14px; color: var(--ink-soft); }
.dash-content { flex: 1; padding: 26px 26px 64px; }
.dash-inner { max-width: 1040px; margin: 0 auto; }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 24px 26px; }
.dash-head { margin-bottom: 22px; display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; }
.dash-head .eyebrow { color: var(--accent); margin-bottom: 6px; }
.dash-head h1 { font-size: 26px; margin: 0 0 6px; color: var(--brand); }
.dash-head p { margin: 0; color: var(--ink-soft); font-size: 15px; max-width: 62ch; }

.progress-meter { min-width: 220px; }
.progress-meter .pm-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.progress-meter .pm-bar { height: 12px; border-radius: 999px; background: #d7e6ee; overflow: hidden; }
.progress-meter .pm-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--brand)); transition: width 0.5s; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); }
.stat .st-top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.stat .st-top svg { width: 18px; height: 18px; color: var(--accent); }
.stat .st-num { margin-top: 8px; font-size: 26px; font-weight: 800; color: var(--brand); }

.dash-section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.dash-section-head h2 { margin: 0; font-size: 18px; color: var(--brand); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tcard { background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; transition: box-shadow 0.15s, transform 0.05s; }
.tcard:hover { box-shadow: 0 16px 38px rgba(0,60,104,0.16); }
.tcard .tc-body { padding: 18px 18px 16px; flex: 1; }
.tcard .tc-ey { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.tcard .tc-tag { font-size: 13px; font-weight: 600; color: var(--accent); }
.tcard .tc-done { display: inline-flex; align-items: center; gap: 4px; background: rgba(47,111,87,0.12); color: var(--success); font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.tcard .tc-done svg { width: 13px; height: 13px; }
.tcard h3 { font-size: 17px; margin: 0; color: var(--brand); text-transform: none; letter-spacing: 0; }
.tcard .tc-meta { display: flex; gap: 16px; margin-top: 10px; color: var(--ink-soft); font-size: 13.5px; }
.tcard .tc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.tcard .tc-meta svg { width: 15px; height: 15px; }
.tcard .tc-foot { border-top: 1px solid var(--line); background: var(--panel-strong); padding: 12px 16px; display: flex; gap: 10px; }
.tcard .tc-start { flex: 1; }
.btn.sm { font-size: 14px; padding: 9px 16px; }
.btn.outline { background: #fff; color: var(--accent); border: 1.5px solid var(--accent-soft); }
.btn.outline:hover { background: var(--accent-soft); }

/* Performance view */
.perf-item { background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 14px; }
.perf-item .pf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.perf-item .pf-title { font-size: 17px; font-weight: 700; color: var(--brand); }
.perf-item .pf-date { font-size: 13px; color: var(--ink-soft); }
.perf-score { display: inline-flex; align-items: baseline; gap: 4px; background: var(--accent-soft); color: var(--brand); border-radius: 10px; padding: 6px 12px; font-weight: 800; }
.perf-empty { color: var(--ink-soft); font-style: italic; margin: 0; }
.feedback-block { margin-top: 12px; }
.feedback-block .fb-label { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.feedback-block .fb-text { white-space: pre-wrap; color: var(--ink); }

@media (max-width: 860px) {
  .dash { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; }
  .sidebar .side-head { border-bottom: 0; padding: 12px 16px; text-align: left; }
  .sidebar .side-sub { display: none; }
  .sidebar nav { flex-direction: row; padding: 0 10px; margin-left: auto; }
  .sidebar .side-foot { display: none; }
  .stat-row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .card { padding: 24px 20px; }
  .context-card { padding: 36px 24px; font-size: 19px; }
  .appbar .meta .pill:nth-child(2) { display:none; }
  .nav-item span { display: none; }
}
