/* Révisions STI2D — thème « Énergie néon » */
:root {
  --bg: #0b1530;
  --bg2: #0f1d40;
  --card: #13244d;
  --card2: #182c5c;
  --line: #24396f;
  --txt: #e8f0ff;
  --muted: #9fb3e0;
  --yellow: #ffd23f;
  --cyan: #2ee6d6;
  --pink: #ff7ab6;
  --violet: #9d8cff;
  --ok: #3df5a7;
  --warn: #ffd23f;
  --ko: #ff5c7a;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 110% -10%, rgba(46, 230, 214, .13), transparent 60%),
    radial-gradient(900px 500px at -20% 110%, rgba(255, 210, 63, .10), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%231c2f63' stroke-width='1.2'%3E%3Cpath d='M0 30h40l10 10h30M60 120V90l10-10V50M120 80H95l-8-8'/%3E%3Ccircle cx='80' cy='40' r='3'/%3E%3Ccircle cx='70' cy='50' r='3'/%3E%3Ccircle cx='87' cy='72' r='3'/%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed;
  color: var(--txt);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--cyan); }
.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 120px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap-row { flex-wrap: wrap; }
.spacer { flex: 1; }
.num { font-variant-numeric: tabular-nums; }

/* Boutons */
.btn {
  appearance: none; border: 0; cursor: pointer; border-radius: 14px; padding: 15px 20px; font-weight: 750;
  font-size: 17px; letter-spacing: .2px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s ease, box-shadow .2s ease, background .2s; min-height: 54px; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #ffe066, var(--yellow) 45%, #ffb703); color: #1a1300;
  box-shadow: 0 0 0 1px rgba(255, 210, 63, .5), 0 8px 24px rgba(255, 210, 63, .28);
}
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(255, 210, 63, .8), 0 10px 32px rgba(255, 210, 63, .45); }
.btn-cyan { background: linear-gradient(135deg, #63fff0, var(--cyan)); color: #00201d;
  box-shadow: 0 8px 24px rgba(46, 230, 214, .25); }
.btn-ghost { background: rgba(255, 255, 255, .04); color: var(--txt); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--cyan); }
.btn-small { min-height: 40px; padding: 8px 14px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; color: var(--muted); padding: 8px; cursor: pointer; font-size: 15px;
  text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: var(--txt); }

/* Cartes */
.card { background: linear-gradient(180deg, var(--card), #102047); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.card + .card { margin-top: 14px; }
h1, h2, h3 { margin: 0 0 10px; line-height: 1.2; }
h1 { font-size: 30px; font-weight: 850; letter-spacing: -.5px; }
h2 { font-size: 22px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 750; }

/* Logo / connexion */
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, #2a3f7a, #101d44); box-shadow: inset 0 0 0 1.5px rgba(255, 210, 63, .55),
  0 0 22px rgba(255, 210, 63, .35); }
.logo svg { width: 28px; height: 28px; filter: drop-shadow(0 0 6px rgba(255, 210, 63, .8)); }
.brand-title { font-weight: 850; font-size: 20px; letter-spacing: -.3px; }
.brand-title span { color: var(--yellow); }
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.login .hero { text-align: center; margin-bottom: 28px; }
.login .logo { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 24px; }
.login .logo svg { width: 50px; height: 50px; }
.login h1 { font-size: 34px; }
.login h1 span { color: var(--yellow); text-shadow: 0 0 18px rgba(255, 210, 63, .55); }
.code-input { width: 100%; text-align: center; font-size: 30px; letter-spacing: 6px; font-weight: 800;
  padding: 16px; border-radius: 16px; border: 0; background: #0a1630; box-shadow: inset 0 0 0 2px var(--line);
  text-transform: uppercase; font-variant-numeric: tabular-nums; outline: none; }
.code-input:focus { box-shadow: inset 0 0 0 2px var(--cyan), 0 0 0 4px rgba(46, 230, 214, .15); }
.err { color: var(--ko); font-weight: 650; min-height: 24px; margin: 10px 0; text-align: center; }

/* En-tête */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 13px;
  font-weight: 700; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.chip.y { color: var(--yellow); box-shadow: inset 0 0 0 1px rgba(255, 210, 63, .45); }
.chip.c { color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(46, 230, 214, .45); }

/* Menu */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 18px; }
.stat { background: rgba(255, 255, 255, .04); border-radius: 14px; padding: 12px; text-align: center;
  box-shadow: inset 0 0 0 1px var(--line); }
.stat b { display: block; font-size: 24px; font-weight: 850; color: var(--yellow); font-variant-numeric: tabular-nums; }
.stat.c b { color: var(--cyan); }
.stat.p b { color: var(--pink); }
.stat span { font-size: 12.5px; color: var(--muted); }
.theme { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; cursor: pointer;
  background: rgba(255, 255, 255, .035); box-shadow: inset 0 0 0 1.5px var(--line); transition: .15s;
  margin-bottom: 10px; position: relative; }
.theme:hover { background: rgba(255, 255, 255, .06); }
.theme.on { box-shadow: inset 0 0 0 2px var(--tc, var(--cyan)), 0 0 20px -4px var(--tc, var(--cyan));
  background: rgba(46, 230, 214, .06); }
.theme input { position: absolute; opacity: 0; pointer-events: none; }
.ticon { width: 46px; height: 46px; border-radius: 13px; flex: none; display: grid; place-items: center;
  background: color-mix(in srgb, var(--tc, var(--cyan)) 16%, transparent); color: var(--tc, var(--cyan)); }
.ticon svg { width: 26px; height: 26px; }
.tbody { flex: 1; min-width: 0; }
.ttitle { font-weight: 750; font-size: 16.5px; }
.tmeta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.check { width: 26px; height: 26px; border-radius: 8px; flex: none; box-shadow: inset 0 0 0 2px var(--line);
  display: grid; place-items: center; transition: .15s; }
.theme.on .check { background: var(--tc, var(--cyan)); box-shadow: none; }
.check svg { width: 16px; height: 16px; opacity: 0; color: #04122a; }
.theme.on .check svg { opacity: 1; }
.bar { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--tc, var(--cyan)), #fff8);
  box-shadow: 0 0 10px var(--tc, var(--cyan)); transition: width .6s ease; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(8, 15, 36, .92) 30%); z-index: 20; }
.dock .inner { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }

/* Question */
.progress { flex: 1; display: flex; gap: 4px; }
.progress i { flex: 1; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); transition: .3s; }
.progress i.done { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.progress i.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.progress i.ko { background: var(--ko); box-shadow: 0 0 8px rgba(255, 92, 122, .7); }
.progress i.cur { background: var(--yellow); box-shadow: 0 0 10px var(--yellow); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.qcount { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }
.iconbtn { width: 42px; height: 42px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 0 1.5px var(--line); display: grid; place-items: center; cursor: pointer; flex: none; color: var(--muted); }
.iconbtn:hover { color: var(--txt); }
.iconbtn svg { width: 20px; height: 20px; }
.qmeta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.lvl { display: inline-flex; gap: 3px; margin-left: 2px; }
.lvl i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.lvl i.on { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.enonce { font-size: 19px; font-weight: 600; line-height: 1.5; }
.consigne { color: var(--muted); font-size: 15px; margin-bottom: 6px; font-weight: 600; }
.soustitre { margin-top: 10px; font-weight: 750; color: var(--yellow); }
.chart-wrap { margin: 14px -4px 0; }
.chart-wrap svg { width: 100%; height: auto; display: block; border-radius: 14px; }
.answer-zone { margin-top: 16px; }
.inputrow { display: flex; align-items: stretch; background: #0a1630; border-radius: 16px; box-shadow: inset 0 0 0 2px var(--line);
  overflow: hidden; }
.inputrow:focus-within { box-shadow: inset 0 0 0 2px var(--cyan), 0 0 0 4px rgba(46, 230, 214, .15); }
.inputrow input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 26px; font-weight: 800;
  padding: 14px 16px; font-variant-numeric: tabular-nums; }
.inputrow .unit { display: grid; place-items: center; padding: 0 18px; font-weight: 800; color: var(--cyan); font-size: 19px;
  background: rgba(46, 230, 214, .08); }
.choices { display: grid; gap: 10px; }
.choices.grid { grid-template-columns: 1fr 1fr; }
.choices.vf { grid-template-columns: 1fr 1fr; }
.choice { appearance: none; border: 0; text-align: left; cursor: pointer; padding: 15px 16px; border-radius: 15px;
  background: rgba(255, 255, 255, .045); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 650; font-size: 16.5px;
  display: flex; gap: 12px; align-items: center; transition: .12s; min-height: 58px; color: var(--txt); }
.choice:hover:not([disabled]) { box-shadow: inset 0 0 0 2px var(--cyan); background: rgba(46, 230, 214, .06); }
.choice .k { width: 28px; height: 28px; border-radius: 9px; flex: none; display: grid; place-items: center; font-size: 13px;
  font-weight: 850; background: rgba(255, 255, 255, .07); color: var(--muted); }
.choices.grid .choice { justify-content: center; text-align: center; font-variant-numeric: tabular-nums; font-size: 18px; }
.choices.grid .choice .k { display: none; }
.choices.vf .choice { justify-content: center; font-size: 19px; font-weight: 800; min-height: 70px; }
.choices.vf .choice .k { display: none; }
.choice.good { box-shadow: inset 0 0 0 2.5px var(--ok), 0 0 18px -4px var(--ok); background: rgba(61, 245, 167, .09); }
.choice.bad { box-shadow: inset 0 0 0 2.5px var(--ko); background: rgba(255, 92, 122, .09); }
.choice[disabled] { cursor: default; }
.choice.dim { opacity: .5; }
.steps .choice { align-items: flex-start; font-weight: 550; }
.steps .choice .k { background: rgba(255, 210, 63, .12); color: var(--yellow); }
.qactions { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 8px; }
.timer { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; display: inline-flex; gap: 5px; align-items: center; }

/* Correction */
.verdict { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--radius); margin-top: 16px;
  animation: pop .35s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
.verdict .vi { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.verdict .vi svg { width: 28px; height: 28px; }
.verdict b { font-size: 21px; display: block; }
.verdict.juste { background: rgba(61, 245, 167, .1); box-shadow: inset 0 0 0 2px var(--ok), 0 0 30px -10px var(--ok); }
.verdict.juste .vi { background: var(--ok); color: #003320; }
.verdict.juste b { color: var(--ok); }
.verdict.remarque { background: rgba(255, 210, 63, .09); box-shadow: inset 0 0 0 2px var(--warn); }
.verdict.remarque .vi { background: var(--warn); color: #2a2000; }
.verdict.remarque b { color: var(--warn); }
.verdict.faux { background: rgba(255, 92, 122, .09); box-shadow: inset 0 0 0 2px var(--ko); }
.verdict.faux .vi { background: var(--ko); color: #2a0010; }
.verdict.faux b { color: var(--ko); }
.note { border-radius: 16px; padding: 14px 16px; margin-top: 12px; background: rgba(255, 255, 255, .04);
  box-shadow: inset 0 0 0 1px var(--line); }
.note h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; display: flex; gap: 6px; align-items: center; }
.note p { margin: 0; }
.note.cible { box-shadow: inset 3px 0 0 var(--yellow), inset 0 0 0 1px rgba(255, 210, 63, .3); background: rgba(255, 210, 63, .06); }
.note.cible h4 { color: var(--yellow); }
.note.conv { box-shadow: inset 3px 0 0 var(--pink), inset 0 0 0 1px rgba(255, 122, 182, .3); }
.note.conv h4 { color: var(--pink); }
.note.expl { box-shadow: inset 3px 0 0 var(--violet), inset 0 0 0 1px rgba(157, 140, 255, .3); }
.note.expl h4 { color: var(--violet); }
.note.rappel { box-shadow: inset 3px 0 0 var(--cyan), inset 0 0 0 1px rgba(46, 230, 214, .3); background: rgba(46, 230, 214, .05); }
.note.rappel h4 { color: var(--cyan); }
.formules { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.formules code { background: #0a1630; padding: 5px 9px; border-radius: 8px; font-family: inherit; font-weight: 700;
  font-size: 14.5px; box-shadow: inset 0 0 0 1px var(--line); color: var(--yellow); }
.levelup { margin-top: 12px; padding: 14px 16px; border-radius: 16px; text-align: center; font-weight: 800;
  background: linear-gradient(135deg, rgba(255, 210, 63, .18), rgba(46, 230, 214, .18));
  box-shadow: inset 0 0 0 1.5px var(--yellow), 0 0 30px -8px var(--yellow); animation: pop .5s .2s both cubic-bezier(.2, 1.4, .4, 1); }
.answers-recap { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin-top: 12px; font-size: 15.5px; }
.answers-recap dt { color: var(--muted); }
.answers-recap dd { margin: 0; font-weight: 750; }

/* Bilan */
.ring { width: 170px; height: 170px; margin: 6px auto 14px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .lbl b { font-size: 44px; font-weight: 900; line-height: 1; }
.ring .lbl span { color: var(--muted); font-size: 14px; }
.list { list-style: none; padding: 0; margin: 8px 0 0; }
.list li { padding: 8px 0 8px 26px; position: relative; border-top: 1px solid rgba(255, 255, 255, .05); }
.list li::before { content: ""; position: absolute; left: 4px; top: 15px; width: 10px; height: 10px; border-radius: 50%; }
.list.ok li::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.list.ko li::before { background: var(--ko); }
.list.up li::before { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.btn-col { display: grid; gap: 10px; margin-top: 18px; }

/* Modale */
.modal { position: fixed; inset: 0; background: rgba(3, 8, 22, .72); backdrop-filter: blur(4px); display: flex;
  align-items: flex-end; justify-content: center; z-index: 50; }
.modal .sheet { width: 100%; max-width: 560px; background: var(--bg2); border-radius: 22px 22px 0 0; padding: 20px 18px
  calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0, 0, 0, .5), inset 0 0 0 1px var(--line);
  max-height: 92vh; overflow: auto; animation: up .25s ease; }
@media (min-width: 700px) { .modal { align-items: center; } .modal .sheet { border-radius: 22px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.radio { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; cursor: pointer;
  box-shadow: inset 0 0 0 1.5px var(--line); margin-bottom: 8px; font-size: 15.5px; }
.radio input { accent-color: var(--cyan); width: 20px; height: 20px; }
.radio:has(input:checked) { box-shadow: inset 0 0 0 2px var(--cyan); background: rgba(46, 230, 214, .06); }
textarea { width: 100%; min-height: 96px; border-radius: 12px; border: 0; padding: 12px; background: #0a1630;
  box-shadow: inset 0 0 0 1.5px var(--line); outline: none; resize: vertical; font-size: 16px; }
textarea:focus { box-shadow: inset 0 0 0 2px var(--cyan); }
.warnbox { font-size: 13.5px; color: var(--yellow); background: rgba(255, 210, 63, .07); border-radius: 10px; padding: 9px 11px;
  margin: 10px 0; display: flex; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--card2); padding: 12px 18px;
  border-radius: 14px; box-shadow: var(--shadow), inset 0 0 0 1px var(--cyan); z-index: 60; font-weight: 650; animation: up .25s; }
.spark { position: fixed; pointer-events: none; z-index: 70; width: 8px; height: 8px; border-radius: 50%; }

@media (max-width: 380px) {
  body { font-size: 16px; }
  .choices.grid { grid-template-columns: 1fr; }
  .enonce { font-size: 17.5px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
