/* ============================================================
   RCIS Practice Test — Design System (Phase 0)
   Clean medical theme · Blue/White · Mobile-first
   ============================================================ */

:root {
  --blue-900: #0b3d91;
  --blue-700: #1457c4;
  --blue-600: #1d6fe0;
  --blue-500: #2b85f0;
  --blue-100: #e8f1ff;
  --blue-50:  #f4f8ff;
  --teal:     #0fb6b0;
  --green:    #1aa260;
  --green-bg: #e6f7ee;
  --red:      #d6342c;
  --red-bg:   #fdeceb;
  --amber:    #e6a700;
  --ink-900:  #10233f;
  --ink-700:  #33455f;
  --ink-500:  #5b6b82;
  --line:     #e2e8f2;
  --white:    #ffffff;
  --bg:       #f7faff;
  --shadow-sm: 0 1px 3px rgba(16,35,63,.08);
  --shadow-md: 0 6px 20px rgba(16,35,63,.10);
  --radius:   14px;
  --radius-sm: 9px;
  --maxw:     1080px;
  --font:     -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink-700);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
}

h1, h2, h3, h4 { color: var(--ink-900); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 2.1rem; letter-spacing: -.02em; }
h2 { font-size: 1.55rem; letter-spacing: -.01em; margin-top: 1.4em; }
h3 { font-size: 1.2rem; margin-top: 1.2em; }
p  { margin: 0 0 1em; }
a  { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.15rem; color: var(--blue-900);
  text-decoration: none; letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--blue-600), var(--teal));
  display: grid; place-items: center; color: #fff; font-size: 18px;
}
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 8px 14px; border-radius: 8px;
  color: var(--ink-700); font-weight: 600; font-size: .96rem;
}
.nav-links a:hover { background: var(--blue-50); text-decoration: none; }
.nav-links a.active { color: var(--blue-700); background: var(--blue-100); }
.nav-cta {
  background: var(--blue-600); color: #fff !important; padding: 9px 18px !important;
}
.nav-cta:hover { background: var(--blue-700); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: 8px; width: 42px; height: 40px; font-size: 20px; cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 10px; font-weight: 700; font-size: 1rem;
  border: none; cursor: pointer; text-decoration: none; transition: transform .05s, background .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--blue-700); color: #fff; }
.btn-lg { padding: 16px 34px; font-size: 1.08rem; }
.btn-ghost { background: var(--white); color: var(--blue-700); border: 1.5px solid var(--blue-100); }
.btn-ghost:hover { background: var(--blue-50); color: var(--blue-700); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--blue-50) 0%, #fff 60%);
  border-bottom: 1px solid var(--line);
  padding: 64px 0 56px;
}
.hero h1 { font-size: 2.6rem; max-width: 16ch; }
.hero p.lead { font-size: 1.22rem; color: var(--ink-500); max-width: 56ch; margin-bottom: 1.6em; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.eyebrow {
  display: inline-block; font-weight: 700; font-size: .8rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--blue-600); background: var(--blue-100);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 16px;
}

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.section { padding: 56px 0; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 36px; }
.section-head p { color: var(--ink-500); font-size: 1.08rem; }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s;
  display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card .icon {
  width: 46px; height: 46px; border-radius: 11px; background: var(--blue-100);
  display: grid; place-items: center; font-size: 22px; margin-bottom: 14px;
}
.card h3 { margin-top: 0; }
.card p { color: var(--ink-500); font-size: .98rem; }
.card .card-foot { margin-top: auto; padding-top: 14px; }
.card-link { font-weight: 700; }
.card .meta { font-size: .85rem; color: var(--ink-500); font-weight: 600; }

.tag {
  display: inline-block; font-size: .76rem; font-weight: 700; padding: 3px 10px;
  border-radius: 999px; background: var(--green-bg); color: var(--green); margin-bottom: 10px;
}

/* ---------- Stats strip ---------- */
.stats { display: flex; gap: 40px; flex-wrap: wrap; }
.stat b { display: block; font-size: 1.9rem; color: var(--blue-700); line-height: 1; }
.stat span { font-size: .9rem; color: var(--ink-500); }

/* ---------- Article (SEO pages) ---------- */
.article { background: #fff; }
.article-body { font-size: 1.06rem; }
.article-body h2 { border-top: 1px solid var(--line); padding-top: 1.2em; }
.article-body ul, .article-body ol { padding-left: 1.3em; margin-bottom: 1.2em; }
.article-body li { margin-bottom: .5em; }
.breadcrumb { font-size: .88rem; color: var(--ink-500); margin-bottom: 18px; }
.breadcrumb a { color: var(--ink-500); }
.callout {
  background: var(--blue-50); border-left: 4px solid var(--blue-600);
  padding: 16px 20px; border-radius: 8px; margin: 24px 0;
}
.callout.cta-box { text-align: center; border-left: none; border: 1px solid var(--blue-100); padding: 28px; }
table.data { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: .96rem; }
table.data th, table.data td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
table.data th { background: var(--blue-50); color: var(--ink-900); }
.toc {
  background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 10px;
  padding: 18px 22px; margin-bottom: 28px;
}
.toc strong { display: block; margin-bottom: 8px; color: var(--ink-900); }
.toc ul { margin: 0; padding-left: 1.2em; }

/* ---------- Phase 3 layout polish ---------- */
.quiz-card {
  position: relative; overflow: hidden;
}
.quiz-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--blue-600), var(--teal));
}
.q-timer {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 800;
  background: var(--blue-100); color: var(--blue-700); padding: 4px 12px; border-radius: 999px;
}
.q-score { background: var(--green-bg); color: var(--green); padding: 4px 12px; border-radius: 999px; font-weight: 800; }
.dot { color: var(--ink-500); margin: 0 2px; }
.option { position: relative; }
.option.selected { box-shadow: 0 0 0 2px var(--blue-100); }
.option .key { transition: transform .12s; }
.option:hover:not(:disabled) .key { transform: scale(1.08); }
.option.correct { animation: pop .25s ease; }
@keyframes pop { 0% { transform: scale(.98); } 60% { transform: scale(1.01); } 100% { transform: scale(1); } }
.quiz-config { position: relative; overflow: hidden; }
.quiz-config::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--blue-600), var(--teal)); }
.bank-grid .card { transition: transform .18s, box-shadow .18s, border-color .18s; }
.bank-grid .card:hover { border-color: var(--blue-500); }
.topic-emoji { font-size: 1.6rem; }

/* ---------- Quiz / MCQ engine ---------- */
.quiz-shell { max-width: 740px; margin: 0 auto; }
.quiz-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.progress-track { height: 8px; background: var(--blue-100); border-radius: 999px; overflow: hidden; margin-bottom: 22px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--blue-600), var(--teal)); width: 0; transition: width .3s; }
.q-counter { font-weight: 700; color: var(--ink-900); }
.q-score { font-weight: 700; color: var(--green); }

.quiz-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow-sm);
}
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; min-height: 28px; }
.pill { display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 3px 10px; border-radius: 999px; }
.pill-easy   { background: var(--green-bg); color: var(--green); }
.pill-medium { background: var(--blue-100); color: var(--blue-700); }
.pill-hard   { background: var(--red-bg); color: var(--red); }
.bookmark-btn { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 1.5rem; line-height: 1; color: var(--amber); padding: 0 4px; }
.bookmark-btn.on { color: var(--amber); }
.q-text { font-size: 1.25rem; font-weight: 700; color: var(--ink-900); margin-bottom: 22px; }
.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  padding: 15px 18px; border: 1.5px solid var(--line); border-radius: 11px;
  background: #fff; cursor: pointer; font-size: 1.02rem; color: var(--ink-700);
  font-family: inherit; transition: border-color .12s, background .12s;
}
.option:hover:not(:disabled) { border-color: var(--blue-500); background: var(--blue-50); }
.option .key {
  flex: none; width: 28px; height: 28px; border-radius: 7px; background: var(--blue-100);
  color: var(--blue-700); font-weight: 800; display: grid; place-items: center; font-size: .9rem;
}
.option.correct { border-color: var(--green); background: var(--green-bg); }
.option.correct .key { background: var(--green); color: #fff; }
.option.incorrect { border-color: var(--red); background: var(--red-bg); }
.option.incorrect .key { background: var(--red); color: #fff; }
.option.selected { border-color: var(--blue-600); background: var(--blue-50); }
.option:disabled { cursor: default; }

.explanation {
  margin-top: 18px; padding: 16px 18px; border-radius: 10px;
  background: var(--blue-50); border: 1px solid var(--blue-100); display: none;
}
.explanation.show { display: block; }
.explanation .verdict { font-weight: 800; margin-bottom: 4px; }
.explanation.is-correct .verdict { color: var(--green); }
.explanation.is-wrong .verdict { color: var(--red); }

.quiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }

.quiz-config {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-sm); max-width: 560px; margin: 0 auto;
}
.config-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); gap: 16px; }
.config-row:last-of-type { border-bottom: none; }
.config-row label { font-weight: 600; color: var(--ink-900); }
.config-row .hint { display: block; font-weight: 400; font-size: .85rem; color: var(--ink-500); }
.switch select, .switch input {
  font-family: inherit; font-size: .95rem; padding: 8px 12px; border-radius: 8px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink-900);
}

/* ---------- Results ---------- */
.results { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 30px; box-shadow: var(--shadow-sm); }
.score-ring {
  width: 150px; height: 150px; border-radius: 50%; margin: 0 auto 22px;
  display: grid; place-items: center; background: conic-gradient(var(--green) var(--pct,0%), var(--blue-100) 0);
}
.score-ring .inner {
  width: 120px; height: 120px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; flex-direction: column;
}
.score-ring b { font-size: 2.3rem; color: var(--ink-900); line-height: 1; }
.score-ring span { font-size: .8rem; color: var(--ink-500); }
.result-stats { display: flex; justify-content: center; gap: 30px; margin: 22px 0 28px; flex-wrap: wrap; }
.result-stats .s b { display: block; font-size: 1.5rem; color: var(--ink-900); }
.result-stats .s span { font-size: .85rem; color: var(--ink-500); }

/* ---------- Dashboard stat cards (progress) ---------- */
.mini-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin: 22px 0; }
.mini-stat { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 16px; text-align: center; }
.mini-stat b { display: block; font-size: 1.5rem; color: var(--blue-700); }
.mini-stat span { font-size: .82rem; color: var(--ink-500); }

/* ---------- Retention widgets ---------- */
.continue-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: linear-gradient(135deg, var(--blue-50), #fff); border: 1px solid var(--blue-100);
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 24px; flex-wrap: wrap;
}
.streak-badge {
  display: inline-flex; align-items: center; gap: 6px; background: #fff6e6; color: #9a6700;
  border: 1px solid #ffe3a3; padding: 6px 14px; border-radius: 999px; font-size: .9rem; font-weight: 600;
}
.goal-ring {
  width: 78px; height: 78px; border-radius: 50%;
  background: conic-gradient(var(--green) var(--pct,0%), var(--blue-100) 0);
  display: grid; place-items: center; flex: none;
}
.goal-ring .inner { width: 60px; height: 60px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; }
.goal-ring b { font-size: 1.05rem; color: var(--ink-900); line-height: 1; }
.goal-ring span { font-size: .62rem; color: var(--ink-500); }
.goal-card { display: flex; align-items: center; gap: 16px; }
.weak-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 24px 0; box-shadow: var(--shadow-sm); }
.weak-list { display: flex; flex-direction: column; gap: 8px; }
.weak-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none;
  color: var(--ink-900); font-weight: 600;
}
.weak-item:hover { border-color: var(--blue-500); background: var(--blue-50); text-decoration: none; }
.weak-acc { color: var(--red); font-weight: 800; }

/* ---------- Cross-exam / related links ---------- */
.related-block { background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: var(--radius); padding: 22px; margin: 30px 0; }
.related-block h3 { margin-top: 0; }
.related-links { display: flex; flex-wrap: wrap; gap: 10px; }
.related-links a {
  display: inline-block; background: #fff; border: 1px solid var(--blue-100); border-radius: 999px;
  padding: 8px 16px; font-size: .92rem; font-weight: 600; color: var(--blue-700);
}
.related-links a:hover { background: var(--blue-600); color: #fff; text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-900); color: #c7d3e6; padding: 48px 0 28px; margin-top: 60px; }
.site-footer a { color: #c7d3e6; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; margin-bottom: 30px; }
.site-footer h4 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; font-size: .94rem; }
.footer-brand { font-weight: 800; color: #fff; font-size: 1.15rem; margin-bottom: 10px; }
.footer-bottom { border-top: 1px solid #1e3553; padding-top: 18px; font-size: .85rem; color: #8aa0bf; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.disclaimer { font-size: .82rem; color: #7f95b4; max-width: 60ch; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
.muted { color: var(--ink-500); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid-3 { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  h1 { font-size: 1.8rem; }
  .hero { padding: 44px 0 40px; }
  .hero h1 { font-size: 2rem; }
  .hero p.lead { font-size: 1.08rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: 1fr 1fr; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line); flex-direction: column;
    padding: 10px 16px; gap: 2px; box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  .nav-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr; }
  .quiz-card { padding: 22px; }
  .q-text { font-size: 1.12rem; }
}
