/* Regafy — thème « Chaleur & Or » (mockup docs/mockups/regafy-quiz-premium.html porté en prod).
   CSP style-src 'self' ; fontes self-host. Crème chaleureuse + violet/or, cartes 22px,
   barre d'action FIXE (bouton suivant toujours visible), confettis, séries 🔥. */

@font-face { font-family: 'Syne'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/assets/fonts/syne-latin-wght-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 100 1000; font-display: swap;
  src: url('/assets/fonts/dm-sans-latin-standard-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/assets/fonts/source-serif-4-latin-600.woff2') format('woff2'); }

:root {
  --cream: #faf6ef; --cream-2: #f3ecdf; --paper: #fffdf8;
  --ink: #1a1330; --ink-soft: #4a4160; --muted: #8d8499;
  --violet: #6d28d9; --violet-2: #8b5cf6; --violet-ghost: #f3efff;
  --gold: #d29922; --gold-2: #e3b341; --gold-soft: #fdf3d7;
  --green: #059669; --green-soft: #d9f2e5; --green-fg: #047857;
  --red: #c2410c; --red-soft: #ffe8dc;
  --g300: #d1d5db; --g500: #6b7280; --g900: #111827;
  --radius: 22px;
  --shadow: 0 24px 60px -18px rgba(58, 32, 108, .22), 0 4px 14px rgba(58, 32, 108, .08);
  --shadow-sm: 0 8px 22px -8px rgba(58, 32, 108, .18);
  --font-display: 'Syne', 'DM Sans', system-ui, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }
body {
  font-family: var(--font-sans); color: var(--ink); font-size: 16.5px; line-height: 1.6;
  min-height: 100vh; -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(139, 92, 246, .14), transparent 60%),
    radial-gradient(900px 480px at -10% 30%, rgba(227, 179, 65, .16), transparent 55%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 100%);
  background-attachment: fixed;
}
button, input { font-family: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--violet-2); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.hidden { display: none !important; }

/* ── Header glassy collant ── */
header.site {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(250, 246, 239, .78); border-bottom: 1px solid rgba(109, 40, 217, .08);
}
.brand { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: .01em;
  color: var(--ink); text-decoration: none; }
.brand .dot { background: linear-gradient(100deg, var(--violet), var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.byline { font-size: 12.5px; color: var(--muted); }
.byline a { color: var(--ink-soft); text-decoration: none; }
.byline a:hover { text-decoration: underline; }
.streak { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 15px;
  color: var(--red); background: #fff; border: 1px solid var(--cream-2); border-radius: 999px;
  padding: 6px 14px; box-shadow: var(--shadow-sm); }
.streak.pop { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { 40% { transform: scale(1.28) rotate(-3deg); } }

footer.site { text-align: center; font-size: 12.5px; color: var(--muted); padding: 10px 20px 34px; }
footer.site a { color: var(--ink-soft); }

main { max-width: 660px; margin: 0 auto; padding: 20px 20px 130px; }

/* ── Carte ── */
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 30px 32px; position: relative; border: 1px solid rgba(210, 153, 34, .14); }
@media (max-width: 560px) { .card { padding: 30px 22px; } main { padding-top: 24px; } }

.kicker { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase;
  background: linear-gradient(100deg, var(--violet), var(--gold)); -webkit-background-clip: text;
  background-clip: text; color: transparent; margin-bottom: 16px; }
h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(23px, 4.4vw, 29px);
  line-height: 1.18; color: var(--ink); margin-bottom: 12px; }
.lead { color: var(--ink-soft); margin-bottom: 18px; font-size: 15.5px; }
.lead em { font-family: var(--font-serif); font-style: italic; }

.meta-row { display: flex; flex-wrap: nowrap; gap: 6px; margin-bottom: 18px; }
@media (max-width: 480px) { .meta-row { flex-wrap: wrap; } }
.meta-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  color: var(--ink-soft); background: #fff; border: 1px solid var(--cream-2); border-radius: 999px;
  padding: 5px 10px; box-shadow: var(--shadow-sm); white-space: nowrap; }

/* ── Boutons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800;
  font-size: 16px; border-radius: 14px; padding: 15px 26px; border: 1.5px solid transparent;
  text-decoration: none; transition: transform .18s, box-shadow .18s, border-color .18s; }
.btn-primary { color: #fff; background: linear-gradient(100deg, var(--violet) 0%, var(--violet-2) 70%);
  box-shadow: 0 14px 30px -10px rgba(109, 40, 217, .5); border: none; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 40px -12px rgba(109, 40, 217, .58); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { border-color: var(--cream-2); color: var(--ink); background: #fff; font-weight: 700;
  font-size: 14.5px; padding: 11px 20px; border-radius: 12px; box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--violet-2); transform: translateY(-1px); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.fineprint { font-size: 12px; color: var(--muted); margin-top: 12px; text-align: center; }

/* ── HUD quiz ── */
.progress-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 7px; }
.progress-label { font-size: 12.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.progress-score { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--violet); }
.q-timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 15px; min-width: 46px;
  text-align: center; color: var(--ink-soft); background: #fff; border: 1px solid var(--cream-2);
  border-radius: 999px; padding: 4px 12px; box-shadow: var(--shadow-sm); }
.q-timer.warn { color: #fff; background: var(--red); border-color: var(--red); animation: timerPulse 1s infinite; }
@keyframes timerPulse { 50% { transform: scale(1.12); } }

.dots { display: flex; gap: 7px; margin-bottom: 14px; }
.dots .dot { flex: 1; height: 7px; border-radius: 999px; background: var(--cream-2); position: relative; overflow: hidden; }
.dots .dot.done { background: linear-gradient(90deg, var(--violet-2), var(--gold-2)); }
.dots .dot.now::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--violet-2) 0%, transparent 80%); animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.q-domain { display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--violet); background: var(--violet-ghost);
  border-radius: 8px; padding: 3px 10px; margin-bottom: 10px; }
h2.q-text { font-family: var(--font-display); font-weight: 700; font-size: 18.5px; line-height: 1.3;
  color: var(--ink); margin-bottom: 14px; }

.options { display: grid; gap: 9px; }
.opt { text-align: left; background: #fff; border: 2px solid var(--cream-2); border-radius: 14px;
  padding: 10px 14px; font-size: 14.5px; color: var(--ink); display: flex; gap: 14px;
  align-items: flex-start; transition: all .18s cubic-bezier(.4, 0, .2, 1); box-shadow: var(--shadow-sm); width: 100%; }
.opt:hover:not([disabled]) { border-color: var(--violet-2); transform: translateY(-2px);
  box-shadow: 0 14px 30px -10px rgba(109, 40, 217, .3); }
.opt .letter { flex: 0 0 26px; height: 26px; border-radius: 8px; background: var(--violet-ghost);
  color: var(--violet); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12.5px; margin-top: 1px; }
.opt.correct { border-color: var(--green); background: var(--green-soft); animation: pulseOk .5s; }
.opt.correct .letter { background: var(--green); color: #fff; }
.opt.wrong { border-color: var(--red); background: var(--red-soft); animation: shake .4s; }
.opt.wrong .letter { background: var(--red); color: #fff; }
.opt.dim { opacity: .5; }
.opt[disabled] { cursor: default; }
@keyframes pulseOk { 40% { transform: scale(1.02); } }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.explain { margin-top: 14px; border-radius: 14px; padding: 13px 16px; display: none;
  background: linear-gradient(135deg, var(--gold-soft), #fff 70%); border: 1px solid rgba(210, 153, 34, .3); }
.explain.show { display: block; animation: fadeUp .35s cubic-bezier(.4, 0, .2, 1); }
.explain .verdict { font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.explain .verdict.ok { color: var(--green); }
.explain .verdict.ko { color: var(--red); }
.explain p { font-size: 13.5px; color: var(--ink-soft); }
.explain .src { display: block; margin-top: 10px; font-family: var(--font-serif); font-style: italic;
  font-size: 13.5px; color: var(--muted); }
.explain .src::before { content: '— '; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Barre d'action FIXE : le bouton suivant TOUJOURS visible ── */
.next-row { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 14px 20px 18px;
  display: none; justify-content: center;
  background: linear-gradient(180deg, transparent, rgba(250, 246, 239, .96) 34%); }
.next-row.show { display: flex; }
.next-row .btn { max-width: 620px; width: 100%; animation: fadeUp .3s; }

/* ── Résultat ── */
.result-head { text-align: center; margin-bottom: 24px; }
.ring-wrap { position: relative; width: 160px; height: 160px; margin: 4px auto 18px; }
.ring-wrap svg { transform: rotate(-90deg); filter: drop-shadow(0 10px 22px rgba(109, 40, 217, .35)); }
.ring-bg { fill: none; stroke: var(--cream-2); stroke-width: 11; }
.ring-val { fill: none; stroke: url(#rgrad); stroke-width: 11; stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(.4, 0, .2, 1); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center .num { font-family: var(--font-display); font-weight: 800; font-size: 42px; color: var(--ink); line-height: 1; }
.ring-center .den { font-size: 13px; color: var(--muted); font-weight: 700; }
.level-badge { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display);
  font-weight: 800; font-size: 17px; border-radius: 999px; padding: 11px 24px; margin-bottom: 10px;
  box-shadow: var(--shadow-sm); animation: pop .6s .4s backwards; }
.level-badge.gold { background: linear-gradient(135deg, var(--gold-soft), #fff); border: 1.5px solid var(--gold-2); color: #8a6116; }
.level-badge.blue { background: var(--violet-ghost); border: 1.5px solid var(--violet-2); color: var(--violet); }
.level-badge.grey { background: #fff; border: 1.5px solid var(--cream-2); color: var(--ink-soft); }
.time-line { font-size: 15px; font-weight: 800; color: var(--ink-soft); margin: 2px 0 8px; }
.result-sub { color: var(--ink-soft); max-width: 46ch; margin: 0 auto; }

/* Confettis (score >= 8) */
.confetti { position: fixed; top: -12px; z-index: 40; width: 10px; height: 16px; border-radius: 3px;
  animation: fall linear forwards; pointer-events: none; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .2; } }

/* ── Classement ── */
.board { margin-top: 18px; border-radius: 16px; padding: 16px 18px; text-align: center;
  background: linear-gradient(135deg, var(--gold-soft), #fff 65%); border: 1.5px solid rgba(210, 153, 34, .35); }
.board h3 { font-family: var(--font-display); font-weight: 800; font-size: 16.5px; color: var(--ink); margin-bottom: 2px; }
.board-sub { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 10px; }
.board-form { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.board-form input { flex: 1 1 200px; max-width: 280px; border-radius: 12px; border: 2px solid var(--cream-2);
  background: #fff; color: var(--g900); font-size: 14.5px; padding: 9px 13px; }
.board-form input:focus { outline: 2px solid var(--violet-2); outline-offset: 1px; }
.ranks { margin-top: 10px; display: grid; gap: 6px; }
.rank-line { font-size: 16.5px; font-weight: 800; color: var(--ink); }
.rank-top { font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--gold); margin-top: 4px; }

/* ── Porte e-mail ── */
.gate { margin-top: 22px; border-radius: 18px; padding: 28px;
  background: linear-gradient(135deg, var(--violet-ghost), #fff 65%); border: 1.5px solid rgba(139, 92, 246, .35); }
.gate h3 { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--ink); margin-bottom: 6px; }
.gate .pitch { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 16px; }
.gate ul { list-style: none; margin: 0 0 16px; display: grid; gap: 7px; }
.gate li { font-size: 14px; color: var(--ink-soft); padding-left: 24px; position: relative; }
.gate li::before { content: '✓'; position: absolute; left: 2px; color: var(--gold); font-weight: 800; }
.gate input[type="email"] { width: 100%; border-radius: 14px; border: 2px solid var(--cream-2);
  background: #fff; color: var(--g900); font-size: 16px; padding: 14px 16px; margin-bottom: 12px; }
.gate input[type="email"]::placeholder { color: var(--g500); }
.gate input[type="email"]:focus { outline: 2px solid var(--violet-2); outline-offset: 1px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-soft);
  margin-bottom: 16px; cursor: pointer; }
.consent input { margin-top: 3px; accent-color: var(--violet); flex: 0 0 auto; width: 17px; height: 17px; cursor: pointer; }
.consent b { color: var(--ink); font-weight: 800; }
.gate .rgpd { font-size: 11.5px; color: var(--muted); margin-top: 12px; }
.gate .rgpd a { color: var(--ink-soft); text-decoration: underline; }
.gate-done { text-align: center; padding: 12px 0; display: none; }
.gate-done .big { font-size: 34px; margin-bottom: 8px; }
.gate-done h3 { margin-bottom: 6px; }
.gate-done p { font-size: 14px; color: var(--ink-soft); }
.form-msg { font-size: 13.5px; margin-top: 8px; min-height: 1.2em; }
.form-msg.ok { color: var(--green-fg); }
.form-msg.err { color: var(--red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.share-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.soft-cta { text-align: center; margin-top: 28px; padding-top: 22px; border-top: 1px dashed var(--cream-2); }
.soft-cta p { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.soft-cta a { color: var(--violet); font-weight: 700; text-decoration: none; font-size: 14.5px; }
.soft-cta a:hover { text-decoration: underline; }

/* ── Pages simples ── */
.prose h2 { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--ink); margin: 22px 0 8px; }
.prose p, .prose li { font-size: 15px; color: var(--ink-soft); }
.prose ul { margin: 8px 0 8px 20px; }

/* == Selecteur de langue == */
.site-right { display: flex; align-items: center; gap: 12px; }
.lang-switch { display: inline-flex; background: #fff; border: 1px solid var(--cream-2);
  border-radius: 999px; padding: 3px; box-shadow: var(--shadow-sm); }
.lang-switch button { border: none; background: transparent; color: var(--muted); font-weight: 800;
  font-size: 12.5px; letter-spacing: .04em; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.lang-switch button.active { background: linear-gradient(100deg, var(--violet), var(--violet-2)); color: #fff; }

/* == Header : marque + byline dessous, bouton theme == */
.brand-block { display: flex; flex-direction: column; line-height: 1.15; }
.brand-block .byline { font-size: 11px; margin-top: 0; }
.theme-btn { border: 1px solid var(--cream-2); background: #fff; border-radius: 999px;
  width: 32px; height: 32px; font-size: 15px; display: inline-flex; align-items: center;
  justify-content: center; box-shadow: var(--shadow-sm); padding: 0; }

/* == Mode sombre : classe html.dark (JS : choix memorise > systeme) == */
html.dark { color-scheme: dark;
  --cream: #17102b; --cream-2: #2b2050; --paper: #241b3e;
  --ink: #f3eeff; --ink-soft: #cec5e6; --muted: #9a90b8;
  --violet-ghost: #33255e; --gold-soft: #38290f;
  --green-soft: #11342a; --red-soft: #3d1c10;
  --g300: #4a4160; --g500: #9a90b8; --g900: #f3eeff;
  --shadow: 0 24px 60px -18px rgba(0, 0, 0, .55), 0 4px 14px rgba(0, 0, 0, .3);
  --shadow-sm: 0 8px 22px -8px rgba(0, 0, 0, .45);
}
html.dark body { background:
  radial-gradient(1100px 500px at 85% -10%, rgba(139, 92, 246, .2), transparent 60%),
  radial-gradient(900px 480px at -10% 30%, rgba(227, 179, 65, .12), transparent 55%),
  linear-gradient(180deg, var(--cream) 0%, #120c22 100%);
  background-attachment: fixed; }
html.dark header.site { background: rgba(23, 16, 43, .82); border-bottom-color: rgba(139, 92, 246, .15); }
html.dark .meta-chip, html.dark .streak, html.dark .q-timer, html.dark .btn-ghost,
html.dark .lang-switch, html.dark .theme-btn, html.dark .opt,
html.dark .board-form input, html.dark .gate input[type="email"] { background: #2b2050; border-color: #3a2c66; }
html.dark .opt .letter { background: #33255e; color: #c4b5fd; }
html.dark .opt.correct { background: #11342a; }
html.dark .opt.wrong { background: #3d1c10; }
html.dark .explain { background: linear-gradient(135deg, #2e2410, #241b3e 70%); border-color: rgba(210, 153, 34, .35); }
html.dark .board { background: linear-gradient(135deg, #2e2410, #241b3e 65%); border-color: rgba(210, 153, 34, .4); }
html.dark .gate { background: linear-gradient(135deg, #2a1f52, #241b3e 65%); border-color: rgba(139, 92, 246, .45); }
html.dark .level-badge.gold { background: linear-gradient(135deg, #2e2410, #241b3e); color: var(--gold-2); }
html.dark .level-badge.blue { background: #2a1f52; color: #c4b5fd; }
html.dark .level-badge.grey { background: #2b2050; color: var(--ink-soft); }
html.dark .explain .verdict.ok, html.dark .form-msg.ok { color: #34d399; }
html.dark .next-row { background: linear-gradient(180deg, transparent, rgba(23, 16, 43, .96) 34%); }
html.dark .ring-bg { stroke: #33255e; }

/* == Preuve sociale (intro) == */
.proof { text-align: center; font-weight: 800; font-size: 13.5px; margin-top: 12px;
  background: linear-gradient(100deg, var(--violet), var(--gold)); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
