/* EdgeMed EM v0.1.0 — minimal, clean, medical-professional look.
   Color palette: deep teal (trust) + warm gold (premium) + clinical white.
*/

:root {
  --bg: #f6f8fa;
  --card: #ffffff;
  --ink: #0e1a23;
  --ink-soft: #4a5b68;
  --line: #e1e6ea;
  --teal: #0f6b6b;
  --teal-dark: #0a4f4f;
  --gold: #c8a14a;
  --green: #2f8f56;
  --green-soft: #e6f4ea;
  --red: #b9384a;
  --red-soft: #fbe9ec;
  --shadow: 0 2px 12px rgba(15, 26, 35, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top bar */
.topbar {
  background: var(--teal);
  color: #fff;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  background: var(--gold);
  color: var(--teal-dark);
  font-weight: 800;
  font-size: 18px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 8px;
  letter-spacing: 0.5px;
}
.brand-text h1 { font-size: 18px; font-weight: 700; letter-spacing: 0.2px; }
.brand-text p { font-size: 12px; opacity: 0.85; }
.stats { font-size: 13px; opacity: 0.9; }
.stats .sep { margin: 0 8px; opacity: 0.5; }

/* Card */
main {
  flex: 1;
  padding: 28px;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
}
.question-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 32px;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.topic-chip {
  background: var(--teal);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.difficulty {
  color: var(--ink-soft);
  font-size: 12px;
}
.stem {
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 16px;
  color: var(--ink);
}
.lead-in {
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 20px;
}
.options { list-style: none; }
.options li {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
  background: #fff;
}
.options li:hover {
  border-color: var(--teal);
  background: #f4fafa;
}
.options li.selected {
  border-color: var(--teal);
  background: #e8f3f3;
}
.options li .letter {
  font-weight: 700;
  color: var(--teal);
  min-width: 22px;
}
.options li.revealed-correct {
  border-color: var(--green);
  background: var(--green-soft);
}
.options li.revealed-wrong {
  border-color: var(--red);
  background: var(--red-soft);
  opacity: 0.7;
}
.options li.revealed-correct .letter { color: var(--green); }
.options li.revealed-wrong .letter { color: var(--red); }

.controls {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
button {
  font: inherit;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 8px;
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
  cursor: pointer;
  transition: all 0.15s;
}
button:hover:not(:disabled) { background: var(--teal-dark); border-color: var(--teal-dark); }
button:disabled { background: #d0d6db; border-color: #d0d6db; cursor: not-allowed; }
#next-btn { background: #fff; color: var(--teal); }
#next-btn:hover { background: #f0f7f7; }

/* Reveal block */
.reveal-block {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.reveal-block h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--teal-dark);
  margin-bottom: 12px;
}
.explanations { list-style: none; margin-bottom: 22px; }
.explanations li {
  padding: 10px 14px;
  border-left: 3px solid var(--line);
  margin-bottom: 8px;
  font-size: 14.5px;
}
.explanations li.correct {
  border-left-color: var(--green);
  background: var(--green-soft);
}
.explanations li.wrong {
  border-left-color: var(--red);
  background: var(--red-soft);
}
.explanations .letter { font-weight: 700; margin-right: 6px; }
.teaching {
  background: #fcf8ee;
  border-left: 3px solid var(--gold);
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: 12px;
}
.reference {
  font-size: 12px;
  color: var(--ink-soft);
  font-style: italic;
}

footer {
  padding: 14px 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-soft);
  background: #fff;
}

/* Topbar nav links — used on /, /test, /review */
.topbar-link {
  color: #fff;
  opacity: 0.85;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.topbar-link:hover { opacity: 1; text-decoration: underline; }

/* Question image (ECG strips, X-rays etc.) */
.question-image { margin: 18px 0; }
.qfig {
  margin: 0;
  text-align: center;
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.qfig img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
}
.qfig figcaption {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 10px;
  font-style: italic;
  line-height: 1.5;
}
.qfig figcaption .credit {
  font-style: normal;
  opacity: 0.7;
}

/* ===== Quota banner & paywall (v0.7.0) ============================ */

.quota-banner {
  padding: 10px 28px;
  font-size: 13px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: #fcf8ee;
  color: var(--ink);
}
.quota-banner.warn  { background: #fbe9ec; color: var(--red); border-bottom-color: var(--red); }
.quota-banner.calm  { background: #fcf8ee; color: var(--ink); }
.quota-banner.muted { background: #f0f7f7; color: var(--teal-dark); }
.quota-banner a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  margin-left: 6px;
}

/* Paywall overlay */
.paywall-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 26, 35, 0.55);
  display: grid;
  place-items: center;
  z-index: 1000;
}
.paywall-overlay[hidden] { display: none !important; }
.paywall-card {
  background: var(--card);
  border-radius: 14px;
  padding: 32px 36px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
  text-align: center;
}
.paywall-card h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 10px;
}
.paywall-card p {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 18px;
}
.paywall-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 18px 0 16px;
}
.paywall-actions .btn-primary {
  background: var(--teal);
  color: #fff;
  border: 1px solid var(--teal);
  padding: 11px 22px;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
}
.paywall-actions .btn-primary:hover { background: var(--teal-dark); }
.paywall-actions .btn-primary.big { font-size: 15px; padding: 12px 26px; }
.paywall-actions .btn-secondary {
  background: #fff;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 11px 22px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
}
.paywall-actions .btn-secondary:hover { background: #f4f7f9; color: var(--ink); }
.paywall-pricing {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 14px;
  margin-bottom: 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
