/* TExES 242 Prep — dark, phone-first, large touch targets. No external assets. */

:root {
  --bg: #10141f;
  --surface: #1a2032;
  --surface-2: #232b42;
  --text: #e8eaf0;
  --muted: #9aa3b8;
  --accent: #4da3ff;
  --good: #34c77b;
  --bad: #e5484d;
  --border: #2e3852;
}

* { box-sizing: border-box; }

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

[hidden] { display: none !important; }

header, main, footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 14px;
}

h1 { font-size: 1.25rem; margin: 8px 0 2px; }
.sub { color: var(--muted); margin: 0 0 10px; font-size: 0.9rem; }

nav { display: flex; gap: 8px; }

nav button {
  flex: 1;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  padding: 10px;
}

nav button.active {
  background: var(--accent);
  color: #0b1220;
  border-color: var(--accent);
}

.status { color: var(--muted); }

.hint { color: var(--muted); font-size: 0.9rem; margin-top: 0; }

/* ---------- buttons ---------- */
button.action {
  display: inline-block;
  min-height: 52px;
  padding: 12px 20px;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #0b1220;
}

button.action.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

button.action.danger {
  background: transparent;
  color: var(--bad);
  border: 1px solid var(--bad);
}

/* ---------- study cards ---------- */
.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  margin: 10px 0;
  overflow: hidden;
}

.card > button {
  display: block;
  width: 100%;
  min-height: 52px;
  text-align: left;
  padding: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  background: transparent;
  color: var(--text);
  border: none;
}

.card .card-body { display: none; padding: 0 14px 14px; }
.card.open .card-body { display: block; }

.card .terms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 10px;
}

.card .terms span {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.95rem;
}

.card .why { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* ---------- question views ---------- */
.qmeta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}

.chip {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.chip.timer {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--text);
  min-width: 108px;
  text-align: center;
}

.chip.timer.low { color: var(--bad); border-color: var(--bad); }

.chip.domain { color: var(--accent); }

.score-line { color: var(--muted); font-size: 0.9rem; }

.question {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin: 10px 0;
  white-space: pre-line;
}

.choices { display: flex; flex-direction: column; gap: 10px; }

.choices button {
  min-height: 52px;
  text-align: left;
  padding: 12px 14px;
  font-size: 1rem;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.choices button.selected { border-color: var(--accent); background: #1c3050; }

.choices button.correct {
  border-color: var(--good);
  background: #143726;
  color: #d7f5e5;
}

.choices button.wrong {
  border-color: var(--bad);
  background: #3b1a1e;
  color: #f5d8da;
}

.choices button:disabled { cursor: default; }

.rationale {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 0.95rem;
  white-space: pre-line;
}

.rationale h3 { margin: 0 0 6px; font-size: 0.9rem; color: var(--muted); }

.qnav { display: flex; gap: 10px; margin-top: 12px; }
.qnav button { flex: 1; }

/* ---------- exam answer grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
  margin: 12px 0;
}

.grid button {
  min-height: 44px;
  padding: 6px 0;
  font-size: 0.9rem;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.grid button.answered { color: var(--text); border-color: var(--accent); }
.grid button.here { outline: 2px solid var(--good); }

/* ---------- results ---------- */
.result-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin: 10px 0;
}

.result-summary .big { font-size: 1.6rem; font-weight: 800; }

table.breakdown {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 16px;
  font-size: 0.95rem;
}

table.breakdown th, table.breakdown td {
  border: 1px solid var(--border);
  padding: 8px;
  text-align: left;
}

table.breakdown th { background: var(--surface-2); }

.review-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px 14px;
  margin: 10px 0;
  font-size: 0.95rem;
}

.review-item .verdict { font-weight: 700; }
.review-item .verdict.bad { color: var(--bad); }
.review-item .verdict.good { color: var(--good); }

/* ---------- footer ---------- */
footer { padding-bottom: 28px; }

#progress-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }

#reset-progress { margin-top: 4px; }

@media (min-width: 760px) {
  header, main, footer { padding: 16px 0; }
}
