/* eloRezo+iA · artema.elorezo.fr — palette à confirmer */
:root {
  --bg: #f7f6fb;
  --surface: #ffffff;
  --text: #2b2d33;
  --muted: #5f6370;
  --line: #e3e0ec;
  --violet: #7B2CBF;
  --violet-dark: #5f1f97;
  --rose: #E0457B;
  --rose-text: #b8285c;
  --ok: #1d7a46;
  --ok-bg: #e5f5ec;
  --ko: #b42318;
  --ko-bg: #fdecea;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(43, 45, 51, .08);
  --font: Calibri, Carlito, "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
a { color: var(--violet); }
a:hover { color: var(--rose-text); }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--violet); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* Bandeau */
.banner {
  background: linear-gradient(90deg, var(--violet), var(--rose));
  color: #fff;
  text-align: center;
  font-size: .9rem;
  padding: 8px 16px;
  line-height: 1.35;
}

/* Barre haute */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; min-height: 52px; gap: 12px; }
.brand { display: flex; align-items: center; font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand img { display: block; height: 40px; width: auto; max-width: 180px; }
.brand-txt b { color: var(--violet); }
.topbar nav { display: flex; gap: 14px; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: .95rem; padding: 4px 2px; }
.topbar nav a:hover { color: var(--violet); }

/* Hero + effet quantique */
.hero { position: relative; overflow: hidden; padding: 48px 0 56px; }
.hero .wrap { position: relative; z-index: 1; }
.kicker { color: var(--rose-text); font-weight: 700; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 12px; }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); max-width: 16ch; }
.lead { font-size: 1.15rem; max-width: 46ch; color: var(--muted); margin: 0 0 .6em; }
#ecran-accueil .btn { margin-top: 18px; }

/* Défi (accueil) */
.defi { position: relative; max-width: 640px; border: 2px solid rgba(123, 44, 191, .25); background: rgba(255, 255, 255, .92); backdrop-filter: blur(4px); }
.defi::before { content: ""; position: absolute; inset: -2px; border-radius: inherit; padding: 2px; background: linear-gradient(135deg, var(--violet), var(--rose)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.defi-badge { display: inline-flex; gap: 6px; align-items: center; margin: 0 0 14px; padding: 6px 14px; border-radius: 999px; background: linear-gradient(90deg, var(--violet), var(--rose)); color: #fff; font-weight: 700; font-size: .9rem; letter-spacing: .03em; text-transform: uppercase; }
.defi h1 { max-width: 20ch; }
.defi-stats { list-style: none; margin: 18px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.defi-stats li { background: #f3f0f8; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.defi-stats strong { font-size: 1.6rem; color: var(--violet); line-height: 1.1; }
.defi-stats span { color: var(--muted); font-size: .9rem; }
.btn-xl { font-size: 1.15rem; padding: 16px 34px; box-shadow: 0 8px 22px rgba(123, 44, 191, .35); }

/* Accroche chat */
.teaser { display: flex; flex-direction: column; align-items: center; margin-top: 36px; text-decoration: none; color: inherit; max-width: 640px; }
.teaser-arrow { font-size: 3.2rem; line-height: 1; font-weight: 700; color: var(--rose); animation: bob 1.6s ease-in-out infinite; }
.teaser-card { display: block; margin-top: 8px; padding: 22px; border-radius: var(--radius); background: linear-gradient(135deg, var(--violet), var(--rose)); color: #fff; box-shadow: var(--shadow); transition: transform .15s; }
.teaser:hover .teaser-card { transform: translateY(-2px); }
.teaser-kicker { display: block; text-transform: uppercase; font-size: .8rem; font-weight: 700; letter-spacing: .06em; opacity: .85; }
.teaser-title { display: block; font-size: 1.45rem; font-weight: 700; line-height: 1.25; margin: 6px 0 10px; }
.teaser-title em { font-style: normal; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.teaser-text { display: block; opacity: .95; }
.teaser-cta { display: inline-block; margin-top: 14px; font-weight: 700; background: #fff; color: var(--violet-dark); border-radius: 999px; padding: 8px 18px; }
@keyframes bob { 50% { transform: translateY(8px); } }

.quantum { position: absolute; right: -90px; top: 10px; width: 360px; height: 360px; opacity: .55; pointer-events: none; }
.orbit { position: absolute; inset: 0; border: 1.5px solid rgba(123, 44, 191, .35); border-radius: 50%; animation: spin 18s linear infinite; }
.orbit i { position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--rose); box-shadow: 0 0 12px var(--rose); }
.o1 { transform: rotateX(70deg); }
.o2 { inset: 30px; border-color: rgba(224, 69, 123, .35); animation-duration: 12s; animation-direction: reverse; }
.o2 i { background: var(--violet); box-shadow: 0 0 12px var(--violet); }
.o3 { inset: 70px; animation-duration: 8s; }
.core { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px; border-radius: 50%; background: radial-gradient(circle, #fff 0, var(--violet) 60%, transparent 70%); animation: pulse 3s ease-in-out infinite; }
.p { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--violet); opacity: .5; animation: float 7s ease-in-out infinite; }
.p1 { left: 10%; top: 20%; } .p2 { left: 80%; top: 15%; animation-delay: -2s; background: var(--rose); }
.p3 { left: 25%; top: 85%; animation-delay: -4s; } .p4 { left: 90%; top: 70%; animation-delay: -1s; background: var(--rose); }
.p5 { left: 5%; top: 55%; animation-delay: -3s; } .p6 { left: 60%; top: 95%; animation-delay: -5s; }
@keyframes spin { to { rotate: 360deg; } }
@keyframes pulse { 50% { transform: scale(1.35); opacity: .7; } }
@keyframes float { 50% { transform: translate(8px, -14px); opacity: .9; } }

/* Boutons */
.btn {
  font: inherit; font-weight: 700; font-size: 1rem;
  border: 2px solid transparent; border-radius: 999px;
  padding: 12px 26px; cursor: pointer; min-height: 48px;
  transition: background .15s, transform .15s;
}
.btn-primary { background: var(--violet); color: #fff; }
.btn-primary:hover { background: var(--violet-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: #a99bb8; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--violet); border-color: var(--violet); }
.btn-ghost:hover { background: rgba(123, 44, 191, .07); }

/* Cartes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }

/* Quiz */
.quiz-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.bloc { margin: 0; font-weight: 700; color: var(--violet); text-transform: uppercase; font-size: .85rem; letter-spacing: .05em; }
.meta { margin: 0; color: var(--muted); font-size: .9rem; display: flex; gap: 14px; }
.timer { font-variant-numeric: tabular-nums; opacity: .85; }
.progressbar { height: 4px; background: var(--line); border-radius: 4px; margin: 10px 0 18px; overflow: hidden; }
.progressbar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--violet), var(--rose)); transition: width .3s; }
.question { font-size: 1.35rem; outline: none; }
.choices { display: grid; gap: 10px; margin: 16px 0; }
.choice {
  font: inherit; text-align: left; width: 100%;
  background: var(--surface); color: var(--text);
  border: 2px solid var(--line); border-radius: 10px;
  padding: 12px 14px; cursor: pointer; min-height: 48px;
  display: flex; gap: 10px; align-items: flex-start;
}
.choice .letter { font-weight: 700; color: var(--violet); min-width: 1.3em; }
.choice:hover:not(:disabled) { border-color: var(--violet); }
.choice:disabled { cursor: default; }
.choice.is-ok { border-color: var(--ok); background: var(--ok-bg); }
.choice.is-ko { border-color: var(--ko); background: var(--ko-bg); }
.choice.is-ok .letter { color: var(--ok); }
.choice.is-ko .letter { color: var(--ko); }
.feedback:empty { display: none; }
.feedback { border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.feedback.ok { background: var(--ok-bg); color: #145732; }
.feedback.ko { background: var(--ko-bg); color: #8a1b12; }
.feedback strong { display: block; }

/* Résultat */
#res-titre { outline: none; }
.score { font-size: 3.2rem; font-weight: 700; margin: 0; color: var(--violet); line-height: 1.1; }
.score small { font-size: 1.4rem; color: var(--muted); }
.res-message { font-size: 1.15rem; margin: 14px 0 22px; }
.record-form fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0; }
.record-form legend { font-weight: 700; padding: 0 6px; }
.fields { display: grid; gap: 12px; grid-template-columns: 1fr; }
.fields label { display: flex; flex-direction: column; font-size: .95rem; gap: 4px; }
.opt { color: var(--muted); font-weight: 400; }
input, textarea {
  font: inherit; color: var(--text); background: #fff;
  border: 1.5px solid #c9c4d6; border-radius: 8px; padding: 10px 12px; width: 100%;
}
input:focus, textarea:focus { border-color: var(--violet); }
input[aria-invalid="true"] { border-color: var(--ko); }
.hint { color: var(--muted); font-size: .875rem; margin: 10px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.status { margin: 10px 0 0; min-height: 1.5em; font-size: .95rem; }
.status.ok { color: var(--ok); }
.status.ko { color: var(--ko); }
.error { color: var(--ko); }

/* Sections */
section[id] { scroll-margin-top: 56px; }
.section { padding: 48px 0; }
.section-alt { background: linear-gradient(180deg, #f1ecf8, var(--bg)); }
.section h2 { font-size: 1.7rem; }
.sub { color: var(--muted); margin: 0 0 18px; }

/* Records */
.records-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: .95rem; }
.records-table th, .records-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.records-table th { background: #f1ecf8; color: var(--violet-dark); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
.records-table td.num, .records-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.records-table tr:last-child td { border-bottom: 0; }
.records-table tr.top1 td:first-child { color: var(--rose-text); font-weight: 700; }
.col-soc { display: none; }

/* Chat */
.chat { padding: 0; overflow: hidden; }
.chat-log { max-height: 440px; min-height: 180px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; }
.msg p { margin: 0 0 .5em; }
.msg p:last-child { margin-bottom: 0; }
.msg-bot { background: #f3f0f8; align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-user { background: var(--violet); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-err { background: var(--ko-bg); color: #8a1b12; align-self: flex-start; }
.msg-typing { color: var(--muted); font-style: italic; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.suggestion {
  font: inherit; font-size: .9rem; cursor: pointer;
  background: #fff; color: var(--violet-dark);
  border: 1.5px solid rgba(123, 44, 191, .4); border-radius: 999px; padding: 6px 12px;
}
.suggestion:hover:not(:disabled) { background: rgba(123, 44, 191, .07); }
.suggestion:disabled { opacity: .5; cursor: not-allowed; }
.chat-form { border-top: 1px solid var(--line); padding: 12px 16px 16px; }
.chat-form textarea { resize: vertical; min-height: 60px; }
.chat-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.disclaimer { color: var(--muted); font-size: .875rem; margin-top: 12px; }

/* Pied de page */
.footer { background: #26232e; color: #e9e6f0; padding: 32px 0; font-size: .95rem; }
.footer a { color: #f3a5c1; }
.footer a:hover { color: #fff; }
.footer-title { font-weight: 700; font-size: 1.05rem; margin: 0 0 6px; }
.footer-credit { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.footer-credit img { flex: none; width: 96px; height: 120px; object-fit: cover; object-position: 20% 15%; border-radius: 12px; border: 2px solid #f3a5c1; }
.footer-sub { margin: 0; color: #bdb8c9; }
.footer-artema { background: rgba(255, 255, 255, .07); border-left: 4px solid var(--rose); border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; }
.footer-artema p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 14px; }
.rgpd { color: #bdb8c9; font-size: .85rem; margin: 0; max-width: 70ch; }

/* Tablette et plus */
@media (min-width: 640px) {
  .card { padding: 28px; }
  .fields { grid-template-columns: 2fr 1fr; }
  .fields .wide { grid-column: 1 / -1; }
  .col-soc { display: table-cell; }
  .defi-stats { grid-template-columns: repeat(4, 1fr); }
  .quantum { right: -40px; top: 0; width: 420px; height: 420px; opacity: .7; }
  .hero { padding: 72px 0 80px; }
}
@media (min-width: 900px) {
  .quantum { right: 4%; }
}
