:root {
  color-scheme: light dark;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;

  --blue: #1B4D8C;
  --yellow: #F2B705;
  --red: #C81E1E;
  --green: #1E7A34;
  --bg: #F5F5F0;
  --ink: #10151F;
  --muted: #5b6472;
  --card-bg: #fff;
  --border: #d8dde5;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #E3E1D6;
  color: var(--ink);
}

header {
  background: var(--blue);
  padding: 1rem 1.2rem;
}

header h1 {
  max-width: 480px;
  margin-inline: auto;
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}

header .tagline {
  max-width: 480px;
  margin: 0.2rem auto 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

main {
  display: block;
  max-width: 480px;
  margin-inline: auto;
  padding: 1.2rem;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(16, 21, 31, 0.05);
}

h2 {
  font-weight: 800;
}

button {
  font: inherit;
  font-size: 1.1rem;
  padding: 0.6rem 1rem;
  margin: 0.25rem;
  min-height: 44px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--ink);
}

.btn-back,
.btn-back-practice {
  background: none;
  border: none;
  color: var(--muted);
  font-weight: 600;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 600;
}

.btn-secondary {
  background: var(--card-bg);
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 600;
}

/* Tile buttons: menu, hạng B/C1 — colored left border marks the mode */
#menu:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tile {
  display: block;
  width: 100%;
  text-align: left;
  font-weight: 600;
  font-size: 1.15rem;
  padding: 1.1rem 1.2rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  border-left-width: 6px;
  background: var(--card-bg);
  box-shadow: 0 1px 2px rgba(16, 21, 31, 0.06);
}

.tile-blue { border-left-color: var(--blue); }
.tile-yellow { border-left-color: var(--yellow); }
.tile-red { border-left-color: var(--red); }

.menu-stats {
  margin: 0.8rem 0.2rem 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

#view-theory-menu .tile {
  margin: 0.25rem 0;
}

.ghep-columns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.ghep-columns > div {
  flex: 1 1 140px;
  min-width: 0;
}

/* Station lists: numbered sequence, quiet left rule instead of a bare bullet */
ol, ul {
  list-style: none;
  padding-left: 0;
  counter-reset: item;
}

#list-bo-chuan li,
#list-selected li {
  counter-increment: item;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.3rem;
  border-left: 3px solid var(--blue);
  background: var(--card-bg);
  border-radius: 2px;
}

#list-bo-chuan li::before,
#list-selected li::before {
  content: counter(item) '. ';
  font-weight: 600;
  color: var(--blue);
}

#list-stations li {
  padding: 0.25rem 0;
}

#status {
  min-height: 1.5em;
  font-weight: 600;
  color: var(--muted);
}

#theory-questions > li,
#practice-questions > li,
#review-questions > li {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

#theory-questions label {
  display: block;
  margin: 0.25rem 0;
}

/* Practice/review cards: bookmark star + click-to-reveal choice buttons,
   as opposed to the timed exam's plain radio list above. */
.star-btn {
  float: right;
  border: none;
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.1rem 0.3rem;
  color: var(--yellow);
}

.choice-btn {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0.25rem 0;
  font-size: 1rem;
}

.choice-correct {
  background: #e4f3e7;
  border-color: var(--green);
  color: var(--green);
  font-weight: 600;
}

.choice-wrong {
  background: #fbe6e6;
  border-color: var(--red);
  color: var(--red);
}

#practice-topics {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#practice-topics .tile {
  font-size: 1rem;
  padding: 0.8rem 1rem;
}

/* Sticky countdown — colour shifts like a traffic light as time runs out */
#theory-timer {
  font-weight: 800;
  font-size: 1.1rem;
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 0.5rem 0;
  z-index: 1;
  color: var(--blue);
}

#theory-timer.time-warn { color: #a86e00; }
#theory-timer.time-danger { color: var(--red); }

#theory-questions img,
#practice-questions img,
#review-questions img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.5rem 0;
}

/* Result badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
  font-weight: 800;
  color: #fff;
}

.badge-pass { background: var(--green); }
.badge-fail { background: var(--red); }

#theory-result-summary {
  font-size: 1.1rem;
}
