/* NC SP-PH Exam Prep — shared styles */
:root {
  --navy: #0d2b45;
  --blue: #1d6fb8;
  --blue-dark: #155a96;
  --accent: #f5a623;
  --green: #2e9e5b;
  --red: #d2493b;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #647184;
  --border: #e2e8f0;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(13, 43, 69, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--blue); }

/* Header / nav */
header.site {
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.brand .badge {
  background: var(--accent);
  color: var(--navy);
  border-radius: 6px;
  padding: 0.1rem 0.45rem;
  font-size: 0.8rem;
  font-weight: 800;
}
nav.main a {
  color: #cfe0ef;
  text-decoration: none;
  margin-left: 1.1rem;
  font-size: 0.95rem;
  font-weight: 500;
}
nav.main a:hover, nav.main a.active { color: #fff; }

/* Layout */
.wrap { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1.25rem; }
.narrow { max-width: 780px; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
  padding: 3rem 1.25rem;
  text-align: center;
}
.hero h1 { font-size: 2.2rem; margin: 0 0 0.5rem; }
.hero p { font-size: 1.15rem; max-width: 680px; margin: 0.5rem auto 1.5rem; color: #e4eef7; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--navy);
  font-weight: 700;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.secondary { background: #fff; color: var(--blue-dark); border: 1px solid var(--border); }
.btn.block { display: block; width: 100%; text-align: center; }

/* Cards */
.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; color: var(--navy); }

/* Tables */
table.facts { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.facts th, table.facts td { text-align: left; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--border); }
table.facts th { background: #eef3f8; color: var(--navy); width: 38%; }
table.facts tr:last-child td { border-bottom: none; }

/* Quiz */
.quiz-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.quiz-bar select, .quiz-bar button { padding: 0.5rem 0.75rem; border-radius: 8px; border: 1px solid var(--border); font-size: 0.95rem; }
.progress { font-weight: 600; color: var(--muted); }
.qcard { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.topic-tag { display: inline-block; background: #eef3f8; color: var(--blue-dark); font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.75rem; }
.qtext { font-size: 1.15rem; font-weight: 600; margin: 0 0 1rem; }
.options { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.option {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  cursor: pointer;
  background: #fff;
  transition: background 0.1s ease, border-color 0.1s ease;
}
.option:hover { border-color: var(--blue); background: #f7fafd; }
.option.correct { background: #e6f6ec; border-color: var(--green); }
.option.wrong { background: #fbeae8; border-color: var(--red); }
.option.disabled { cursor: default; pointer-events: none; }
.explain {
  margin-top: 1.1rem;
  padding: 1rem;
  border-left: 4px solid var(--blue);
  background: #f1f7fc;
  border-radius: 0 8px 8px 0;
  display: none;
}
.explain.show { display: block; }
.explain .ref { font-weight: 700; color: var(--blue-dark); }
.nav-buttons { display: flex; justify-content: space-between; margin-top: 1.25rem; gap: 0.75rem; }
.score-box { text-align: center; padding: 2rem; }
.score-box .big { font-size: 3rem; font-weight: 800; color: var(--navy); }
.pass { color: var(--green); }
.fail { color: var(--red); }

/* Access banner (free/paid) */
.access-banner { border-radius: 8px; padding: 0.7rem 1rem; margin-bottom: 1rem; font-size: 0.95rem; }
.access-banner:empty { display: none; }
.access-banner.locked { background: #fff7e8; border: 1px solid #f3dca5; border-left: 4px solid var(--accent); }
.access-banner.unlocked { background: #e6f6ec; border: 1px solid #b6e3c6; border-left: 4px solid var(--green); }
.access-banner a { font-weight: 700; }

/* Pricing */
.price-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.price-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.price-card.featured { border: 2px solid var(--accent); }
.price-card h3 { margin-top: 0; color: var(--navy); }
.price-tag { font-size: 2.4rem; font-weight: 800; color: var(--navy); }
.price-tag .old { font-size: 1.1rem; color: var(--muted); text-decoration: line-through; margin-right: 0.4rem; font-weight: 600; }
.price-card ul { list-style: none; padding: 0; }
.price-card li { padding-left: 1.5rem; position: relative; margin-bottom: 0.5rem; }
.price-card li::before { content: "\2713"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.price-card li.no::before { content: "\2014"; color: var(--muted); }

/* Timer */
.timer { font-weight: 800; color: var(--navy); background: #eef3f8; padding: 0.3rem 0.75rem; border-radius: 8px; font-variant-numeric: tabular-nums; }
.timer.warn { color: #fff; background: var(--red); }

/* Progress / stats */
#statsCard h2 { color: var(--navy); }
.stat-row { display: flex; align-items: center; gap: 0.6rem; margin: 0.4rem 0; font-size: 0.9rem; }
.stat-name { flex: 0 0 44%; }
.stat-pct { flex: 0 0 92px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { flex: 1; background: #eef1f5; border-radius: 6px; height: 14px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--green); transition: width 0.3s ease; }
.bar.weak > span { background: var(--accent); }
.weak-flag { color: var(--red); font-weight: 800; }

/* Miss review */
.review-list { text-align: left; margin-top: 1.25rem; }
.review-list h3 { color: var(--navy); }
.review-item { border-left: 3px solid var(--red); background: #fbeae8; padding: 0.6rem 0.85rem; border-radius: 0 6px 6px 0; margin-bottom: 0.5rem; font-size: 0.9rem; }
.review-item .ok { color: var(--green); font-weight: 600; margin-top: 0.25rem; }
.review-item .ref { color: var(--blue-dark); font-weight: 700; margin-top: 0.15rem; }

/* Study guide */
.topic { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.topic h3 { color: var(--navy); margin-top: 0; }
.ref-pill { display: inline-block; background: var(--navy); color: #fff; font-size: 0.8rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 6px; margin: 0.15rem 0.25rem 0.15rem 0; }

/* Flashcards */
.flashcard { position: relative; min-height: 230px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; padding: 1.5rem; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.flashcard .flash-cat { position: absolute; top: 0.6rem; left: 0.9rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--blue-dark); }
.flash-face { font-size: 1.35rem; font-weight: 600; color: var(--navy); }
.flash-back { display: none; font-size: 1.15rem; font-weight: 500; color: var(--text); border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 1rem; }
.flashcard.show-back .flash-back { display: block; }
.flashcard.show-back .flash-front { color: var(--muted); font-size: 1.1rem; }
.flash-hint { position: absolute; bottom: 0.7rem; left: 0; right: 0; font-size: 0.8rem; color: var(--muted); }
.flashcard.done { background: #eef6f0; }

/* Worked-example calculations */
.formula { font-family: "Consolas", "Courier New", monospace; background: #0d2b45; color: #e4eef7; padding: 0.8rem 1rem; border-radius: 8px; margin: 0.75rem 0; font-size: 0.95rem; overflow-x: auto; }
.formula .res { color: #ffd479; font-weight: 700; }
.worked { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--blue); border-radius: 0 8px 8px 0; padding: 1rem 1.25rem; margin: 1.25rem 0; box-shadow: var(--shadow); }
.worked h3 { margin-top: 0; color: var(--navy); }
.worked ol { margin: 0.5rem 0; padding-left: 1.25rem; }
.worked ol li { margin-bottom: 0.5rem; }
.answer-pill { display: inline-block; background: var(--green); color: #fff; font-weight: 700; padding: 0.3rem 0.8rem; border-radius: 20px; margin-top: 0.5rem; }
.lesson-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; font-size: 0.95rem; }

/* Print-friendly tab template */
@media print {
  header.site, footer.site, .no-print { display: none !important; }
  body { background: #fff; }
  .tab-print { page-break-inside: avoid; }
}

/* Callouts */
.callout { background: #fff7e8; border: 1px solid #f3dca5; border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0; padding: 1rem 1.25rem; margin: 1.25rem 0; }

/* Footer */
footer.site { background: var(--navy); color: #aebfcf; margin-top: 3rem; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }
footer.site a { color: #cfe0ef; text-decoration: none; margin-right: 1rem; font-size: 0.9rem; }
footer.site .disclaimer { font-size: 0.8rem; color: #7f93a8; max-width: 100%; margin-top: 0.75rem; }

h1, h2 { color: var(--navy); }
.lead { font-size: 1.1rem; color: var(--muted); }
ul.checks { list-style: none; padding: 0; }
ul.checks li { padding-left: 1.6rem; position: relative; margin-bottom: 0.5rem; }
ul.checks li::before { content: "\2713"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
