/* Shared styles for every page. Change the colours here to restyle the whole site. */
:root {
  --bg: #f6f8f5;
  --surface: #ffffff;
  --text: #1d2b24;
  --muted: #5b6b62;
  --border: #d5ddd7;
  --accent: #1f7a4d;
  --accent-text: #ffffff;
  --good-bg: #e3f4ea;
  --good: #166b3f;
  --bad-bg: #fbe7e6;
  --bad: #a52a22;
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
}

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* Header and footer */
.site-header { background: var(--accent); color: var(--accent-text); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.site-header a { color: inherit; text-decoration: none; }
.brand { font-weight: 700; font-size: 1.15rem; }
nav { display: flex; gap: 18px; }
nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.site-footer { margin-top: 48px; padding: 24px 0; color: var(--muted); font-size: 0.88rem; border-top: 1px solid var(--border); }

h1 { font-size: 1.9rem; line-height: 1.25; margin: 28px 0 8px; }
h2 { font-size: 1.3rem; margin: 36px 0 12px; }
.lead { font-size: 1.1rem; color: var(--muted); margin-top: 0; }
.muted { color: var(--muted); }
.warning { background: #fff4d6; border: 1px solid #e8c766; padding: 10px 14px; border-radius: var(--radius); }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-text);
  border: 0;
  border-radius: var(--radius);
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn.big { padding: 14px 26px; font-size: 1.1rem; }
.btn.secondary { background: var(--surface); color: var(--accent); border: 2px solid var(--accent); }
.btn:disabled { opacity: 0.4; cursor: default; }
.link-btn { background: none; border: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; padding: 6px; }

/* Cards and grid */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.card.unit, .card.soon { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; }
.card.unit:hover { border-color: var(--accent); }
.unit-letter { font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.card.soon { background: transparent; border-style: dashed; }

.hero { padding: 12px 0 8px; }

/* Practice filters */
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin: 20px 0 12px; }
.filters label { display: flex; flex-direction: column; font-size: 0.9rem; font-weight: 600; gap: 4px; min-width: 0; max-width: 100%; }
.filters select { font: inherit; font-weight: 400; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); width: 100%; }
.filters label:nth-child(2) { flex: 1 1 260px; min-width: 0; }
.filters label.check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 10px; }
.status-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.95rem; margin-bottom: 10px; gap: 12px; }
#score { font-weight: 700; color: var(--text); }

/* Question card */
.q-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 0.9rem; font-weight: 600; }
.stem { font-size: 1.1rem; margin: 14px 0; white-space: pre-line; }
.q-image { display: block; max-width: 100%; height: auto; margin: 12px auto; border-radius: 6px; }

.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  text-align: left; font: inherit; color: inherit;
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer;
}
.option:hover:not(:disabled) { border-color: var(--accent); }
.option:disabled { cursor: default; }
.option .letter { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-weight: 700; }
.option.is-key { border-color: var(--good); background: var(--good-bg); }
.option.is-key .letter { background: var(--good); color: #fff; }
.option.is-wrong { border-color: var(--bad); background: var(--bad-bg); }
.option.is-wrong .letter { background: var(--bad); color: #fff; }

.nr label { font-weight: 600; display: block; margin-bottom: 6px; }
.nr-row { display: flex; gap: 10px; }
.nr-row input { font: inherit; font-size: 1.2rem; padding: 8px 12px; width: 10em; border: 2px solid var(--border); border-radius: var(--radius); }

.feedback { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius); outline: none; }
.feedback.good { background: var(--good-bg); border-left: 5px solid var(--good); }
.feedback.bad { background: var(--bad-bg); border-left: 5px solid var(--bad); }
.fb-title { font-weight: 700; margin: 0 0 6px; }
.feedback.good .fb-title { color: var(--good); }
.feedback.bad .fb-title { color: var(--bad); }
#fb-rationale { margin: 0; white-space: pre-line; }

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

@media (max-width: 520px) {
  h1 { font-size: 1.55rem; }
  .filters label { flex: 1 1 100%; }
}

/* Yellow bar shown only on draft previews (see js/draft-banner.js) */
.draft-banner { background: #ffd84d; color: #3a2d00; text-align: center; font-weight: 700; font-size: 0.92rem; padding: 8px 16px; }
