/* 11+ Mock Test — styles */

:root {
  color-scheme: light;
  --page:           #f9f9f7;
  --surface-1:      #fcfcfb;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --grid:           #e1e0d9;
  --baseline:       #c3c2b7;
  --border:         rgba(11, 11, 11, 0.10);

  --series-1: #2a78d6;  /* Maths */
  --series-2: #eb6834;  /* English */
  --series-3: #1baf7a;  /* Verbal Reasoning */
  --series-4: #eda100;  /* Non-Verbal Reasoning */

  --status-good:     #0ca30c;
  --status-critical: #d03b3b;
  --good-text:       #006300;

  --accent:       #2a78d6;
  --accent-hover: #256abf;
  --accent-soft:  #cde2fb;

  --radius: 12px;
  --shadow: 0 1px 3px rgba(11, 11, 11, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page:           #0d0d0d;
    --surface-1:      #1a1a19;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --grid:           #2c2c2a;
    --baseline:       #383835;
    --border:         rgba(255, 255, 255, 0.10);

    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;

    --good-text:  #0ca30c;

    --accent:       #3987e5;
    --accent-hover: #5598e7;
    --accent-soft:  #184f95;

    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

/* ---------- header / nav ---------- */

header.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 16px;
  flex-wrap: wrap;
}

.brand {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand .plus { color: var(--accent); }

nav.tabs { display: flex; gap: 6px; }

.tab {
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- cards ---------- */

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 16px;
}

h1 { font-size: 1.5rem; margin-bottom: 8px; }
h2 { font-size: 1.15rem; margin-bottom: 12px; }
.sub { color: var(--text-secondary); font-size: 0.95rem; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text-primary); background: var(--page); }
.btn-danger { background: transparent; color: var(--status-critical); border: 1px solid var(--status-critical); }
.btn-danger:hover { background: var(--status-critical); color: #fff; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- welcome ---------- */

.welcome-hero { text-align: center; padding: 40px 22px; }
.welcome-hero .big-icon { font-size: 3rem; margin-bottom: 12px; }
.welcome-hero input {
  width: 100%;
  max-width: 320px;
  margin: 18px auto 6px;
  display: block;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--baseline);
  border-radius: 10px;
  background: var(--page);
  color: var(--text-primary);
}
.welcome-hero input:focus { outline: 2px solid var(--accent); border-color: transparent; }

/* ---------- question view ---------- */

.q-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--page);
}
.topic-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.q-timer {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}
.q-timer.warn { color: var(--status-critical); }

.q-text {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 18px;
  white-space: pre-line;
}

.difficulty { color: var(--text-muted); font-size: 0.8rem; letter-spacing: 0.05em; }

.options { display: grid; gap: 10px; }

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  padding: 13px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--page);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.option:hover:not(:disabled) { border-color: var(--accent); }
.option:disabled { cursor: default; }

.option .letter {
  flex: none;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--surface-1);
  border: 1px solid var(--baseline);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.option.correct {
  border-color: var(--status-good);
  background: color-mix(in srgb, var(--status-good) 10%, var(--surface-1));
}
.option.correct .letter { background: var(--status-good); border-color: var(--status-good); color: #fff; }

.option.wrong {
  border-color: var(--status-critical);
  background: color-mix(in srgb, var(--status-critical) 10%, var(--surface-1));
}
.option.wrong .letter { background: var(--status-critical); border-color: var(--status-critical); color: #fff; }

.feedback { margin-top: 18px; }
.verdict {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.verdict.good { color: var(--good-text); }
.verdict.bad { color: var(--status-critical); }

.explanation {
  color: var(--text-secondary);
  font-size: 0.95rem;
  background: var(--page);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
}

.practice-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.practice-controls select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
}
.session-score {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- mock test ---------- */

.mock-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.mock-countdown { font-variant-numeric: tabular-nums; }
.mock-countdown.warn { color: var(--status-critical); }

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--grid);
  overflow: hidden;
  margin-bottom: 18px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s;
}

.result-hero { text-align: center; padding: 8px 0 4px; }
.result-hero .hero-number {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.result-hero .hero-label { color: var(--text-secondary); margin-bottom: 4px; }

.review-item {
  padding: 14px 0;
  border-top: 1px solid var(--grid);
  font-size: 0.95rem;
}
.review-item .rq { font-weight: 600; margin-bottom: 4px; white-space: pre-line; }
.review-item .ra { color: var(--text-secondary); }
.review-item .mark { font-weight: 700; }
.review-item .mark.good { color: var(--good-text); }
.review-item .mark.bad { color: var(--status-critical); }

/* ---------- profile dashboard ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}
.stat-tile {
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.stat-tile .value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.stat-tile .label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* topic accuracy bar chart (HTML bars, direct-labeled) */
.bar-row { margin-bottom: 14px; }
.bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.88rem;
  margin-bottom: 5px;
}
.bar-head .name { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.bar-head .val { color: var(--text-secondary); font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-track {
  height: 12px;
  background: var(--grid);
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 0 4px 4px 0;
  min-width: 2px;
  transition: width 0.3s;
}

.list-plain { list-style: none; }
.list-plain li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--grid);
  font-size: 0.92rem;
}
.list-plain li:first-child { border-top: none; }
.list-plain .muted { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.empty-note { color: var(--text-muted); font-size: 0.92rem; padding: 6px 0; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--grid);
  font-size: 0.95rem;
  cursor: pointer;
}
.setting-row:first-of-type { border-top: none; }
.setting-row .name { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.setting-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
}

footer.foot {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 24px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.small { font-size: 0.82rem; }

/* ---------- level & XP ---------- */

.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.level-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.level-bar {
  width: 52px; height: 4px;
  background: var(--grid);
  border-radius: 999px;
  overflow: hidden;
  display: block;
}
.level-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.xp-chip {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-1));
  border-radius: 999px;
  padding: 2px 10px;
}

.level-card {
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.level-card .level-num { font-weight: 800; font-size: 1.2rem; margin-bottom: 8px; }
.level-track { height: 8px; background: var(--grid); border-radius: 999px; overflow: hidden; margin-bottom: 6px; }
.level-fill { height: 100%; background: var(--accent); border-radius: 999px; }

/* ---------- badges ---------- */

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.badge {
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.badge.locked { opacity: 0.5; }
.badge-icon { font-size: 1.5rem; }
.badge-name { font-weight: 700; font-size: 0.88rem; }
.badge-desc { font-size: 0.76rem; color: var(--text-secondary); }

.badge-toast {
  margin-top: 10px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-1));
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 0.9rem;
}
.badge-toast.pb { border-color: var(--status-good); background: color-mix(in srgb, var(--status-good) 10%, var(--surface-1)); }

/* ---------- mock gamification ---------- */

.mock-xp { color: var(--accent); font-weight: 700; }

.stars { font-size: 1.9rem; letter-spacing: 4px; margin: 4px 0 2px; }
.stars span { color: var(--grid); }
.stars span.on { color: var(--series-4); }
.stars-label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: normal;
  color: var(--text-secondary);
  font-weight: 600;
}
.stars-inline { color: var(--series-4); letter-spacing: 1px; }

.xp-breakdown {
  list-style: none;
  max-width: 340px;
  margin: 14px auto 4px;
  text-align: left;
}
.xp-breakdown li {
  display: flex;
  justify-content: space-between;
  padding: 6px 2px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--grid);
}
.xp-breakdown li:first-child { border-top: none; }
.xp-breakdown li.total { font-weight: 800; color: var(--text-primary); border-top: 2px solid var(--baseline); }

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 99;
}
.confetti-layer span {
  position: absolute;
  top: -14px;
  width: 9px; height: 14px;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(110vh) rotate(540deg); opacity: 0.7; }
}

/* ---------- login ---------- */

.login-box { max-width: 420px; margin-top: 8px; }
.login-box input {
  width: 100%;
  margin: 6px 0;
  padding: 11px 13px;
  font-size: 0.98rem;
  font-family: inherit;
  border: 1px solid var(--baseline);
  border-radius: 10px;
  background: var(--page);
  color: var(--text-primary);
}
.login-box input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.login-error { color: var(--status-critical); font-size: 0.88rem; font-weight: 600; margin: 4px 0; }
.demo-code {
  background: color-mix(in srgb, var(--series-4) 14%, var(--surface-1));
  border: 1px solid var(--series-4);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
  margin: 6px 0;
}

.wide-input {
  width: 100%;
  margin: 8px 0 2px;
  padding: 11px 13px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid var(--baseline);
  border-radius: 10px;
  background: var(--page);
  color: var(--text-primary);
}
.wide-input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.profile-list { display: grid; gap: 8px; max-width: 380px; margin: 14px auto; }
.profile-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  text-align: left;
  background: var(--page);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
}
.profile-item:hover { border-color: var(--accent); }

/* ---------- question feedback ---------- */

.qfb-row { display: flex; gap: 14px; margin-top: 12px; }
.qfb-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
}
.qfb-btn:hover { color: var(--text-primary); }
.qfb-box textarea {
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  border: 1px solid var(--baseline);
  border-radius: 8px;
  background: var(--page);
  color: var(--text-primary);
  resize: vertical;
}
.qfb-box textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.btn-small { padding: 7px 14px; font-size: 0.85rem; }

/* ---------- analysis ---------- */

.chart-wrap { margin-top: 6px; overflow-x: auto; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-wrap .ax { font-size: 11px; fill: var(--text-muted); font-family: inherit; }
.chart-wrap .last-label { font-size: 12px; font-weight: 700; fill: var(--text-secondary); font-family: inherit; }

.delta { font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.delta.good { color: var(--good-text); }
.delta.bad { color: var(--status-critical); }

.rec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--grid);
}
.rec-row:first-of-type { border-top: none; }
.rec-name { font-weight: 600; font-size: 0.95rem; }

/* ---------- policy ---------- */

.policy h3 { font-size: 1rem; margin: 14px 0 4px; }
.policy p { color: var(--text-secondary); font-size: 0.93rem; margin: 6px 0; }

/* ---------- print ---------- */

.print-sheet { display: none; }

@media print {
  .app, footer.foot { display: none !important; }
  body { background: #fff; color: #000; }

  .print-sheet {
    display: block;
    font-size: 12pt;
    color: #000;
    padding: 0;
  }
  .print-sheet h1 { font-size: 16pt; margin-bottom: 4pt; }
  .print-sheet h2 { font-size: 13pt; margin-bottom: 6pt; }
  .print-meta { color: #444; font-size: 10pt; margin-bottom: 14pt; }
  .print-q { break-inside: avoid; margin-bottom: 12pt; }
  .print-q-text { font-weight: 600; margin-bottom: 4pt; white-space: pre-line; }
  .print-topic { font-weight: 400; color: #555; font-size: 10pt; }
  .print-opts { list-style: none; padding-left: 14pt; }
  .print-opts li { margin: 2pt 0; }
  .print-answers { break-before: page; }
}

@media (max-width: 480px) {
  .card { padding: 16px; }
  .q-text { font-size: 1.05rem; }
  .result-hero .hero-number { font-size: 2.6rem; }
}
