/* ENEM Pro (nume de lucru) — brand propriu, distinct de Estuda Ai: dark, direct, pentru elevi.
 * Paletă: slate-900 fundal, cyan accent, verde/roșu doar pe feedback de răspuns. */
:root {
  --bg: #0f172a;
  --card: #1e293b;
  --card-2: #273449;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #22d3ee;
  --accent-ink: #062a30;
  --ok: #34d399;
  --bad: #f87171;
  --warn: #fbbf24;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Sora', system-ui, -apple-system, sans-serif;
  min-height: 100dvh;
}
#app { max-width: 680px; margin: 0 auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }

h1 { font-size: 1.5rem; font-weight: 800; margin: 8px 0 4px; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 16px 0 8px; }
p { line-height: 1.55; }
.muted { color: var(--muted); font-size: 0.9rem; }
.brand { color: var(--accent); font-weight: 800; letter-spacing: 0.02em; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
  border: 1px solid #31415c;
}
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

button, .btn {
  font: inherit;
  border: 0;
  border-radius: 12px;
  padding: 13px 18px;
  font-weight: 600;
  cursor: pointer;
  background: var(--card-2);
  color: var(--text);
  min-height: 48px;
}
button.primary { background: var(--accent); color: var(--accent-ink); font-weight: 800; }
button.ghost { background: transparent; border: 1px solid #31415c; }
button:disabled { opacity: 0.5; cursor: default; }
button.full { width: 100%; }

input, select {
  font: inherit;
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid #31415c;
  background: var(--card);
  color: var(--text);
  margin: 6px 0;
}

/* Alternativa de răspuns (A–E) */
.alt {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid #31415c;
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
  color: var(--text);
}
.alt .letter {
  flex: 0 0 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card-2); font-weight: 800;
}
.alt.selected { border-color: var(--accent); }
.alt.correct { border-color: var(--ok); background: rgba(52, 211, 153, 0.08); }
.alt.wrong { border-color: var(--bad); background: rgba(248, 113, 113, 0.08); }
.alt img { max-width: 100%; border-radius: 8px; }

/* Enunțul: markdown simplu randat — imaginile la lățimea cardului */
.stem img { max-width: 100%; border-radius: 10px; margin: 8px 0; background: #fff; }
.stem { overflow-wrap: break-word; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card-2); border-radius: 999px;
  padding: 6px 12px; font-size: 0.85rem; font-weight: 600;
}
.chip.accent { background: rgba(34, 211, 238, 0.14); color: var(--accent); }
.chip.streak { background: rgba(251, 191, 36, 0.14); color: var(--warn); }

.feedback-ok { color: var(--ok); font-weight: 800; }
.feedback-bad { color: var(--bad); font-weight: 800; }

.bar { height: 8px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }

.timer { font-variant-numeric: tabular-nums; font-weight: 800; }
.timer.low { color: var(--bad); }

.topnav { display: flex; align-items: center; gap: 10px; padding: 4px 0 10px; }
.topnav button { min-height: 40px; padding: 8px 12px; }

.chat { display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 10px 14px; border-radius: 12px; max-width: 85%; line-height: 1.45; }
.msg.child { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
.msg.tutor { align-self: flex-start; background: var(--card-2); }

.error { color: var(--bad); font-size: 0.9rem; margin: 8px 0; }
.disclaimer { font-size: 0.78rem; color: var(--muted); }

/* --- Modo cinema: întrebarea „se desenează", explicația se dezvăluie pas cu pas.
 * Doar CSS: stagger prin --i per element; tap oriunde (skipOnTap) sare la final. --- */
@keyframes rv-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rv-wipe { from { opacity: 0; clip-path: inset(0 0 100% 0); } to { opacity: 1; clip-path: inset(0 0 -1% 0); } }
.cine .rv { animation: rv-in 0.5s ease-out both; animation-delay: calc(var(--i, 0) * 0.55s); }
.cine .rv.wipe { animation-name: rv-wipe; animation-duration: 0.9s; }
.cine.skip .rv { animation-duration: 0s; animation-delay: 0s; }
@media (prefers-reduced-motion: reduce) {
  .cine .rv { animation: none; }
}

/* Pașii rezolvării (playerul de explicație) */
.passos { list-style: none; margin: 8px 0; padding: 0; }
.passos li {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--card-2); border-radius: 10px;
  padding: 10px 12px; margin: 8px 0; line-height: 1.5;
}
.passo-n {
  flex: 0 0 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(34, 211, 238, 0.14); color: var(--accent);
  font-weight: 800; font-size: 0.85rem;
}
