:root {
  --bg: #f1f0fa;
  --panel: #ffffff;
  --ink: #17143a;
  --muted: #5a5782;
  --line: #d9d7ee;
  --accent: #6b2bff;      /* violet néon : à régler sur les couleurs exactes du logo */
  --accent-ink: #ffffff;
  --glow: #00d6c2;        /* cyan : réservé à la tête de lecture */
  --danger: #b81d44;
  --radius: 12px;
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  padding: 0 16px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

a { color: var(--accent); }

/* ---------- En-tête ---------- */
.top, main, .foot { max-width: 720px; margin-inline: auto; }
.top { padding: 20px 0 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.mark {
  display: grid; place-items: center; width: 38px; height: 38px;
  background: var(--ink); color: #fff; border-radius: 10px;
  font-weight: 800; letter-spacing: -0.02em;
  box-shadow: 0 0 0 2px var(--accent), 0 0 16px rgba(107, 43, 255, 0.55);
}

.intro { padding: 20px 0 24px; }
.intro h1 {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 6.2vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  max-width: 16em;
  text-wrap: balance;
}
.intro p { margin: 0; color: var(--muted); max-width: 34em; }

/* ---------- Panneau ---------- */
.panel {
  background: var(--panel);
  border-radius: 18px;
  padding: 20px 18px 24px;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(23, 20, 58, 0.35);
}
@media (min-width: 640px) { .panel { padding: 28px 32px 32px; } }

/* ---------- Frise de montage ---------- */
.timeline { position: relative; margin: 0 0 28px; padding-top: 4px; }
.timeline ol {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  position: relative; z-index: 2;
}
.timeline li { display: grid; justify-items: center; gap: 6px; text-align: center; }
.kf {
  width: 14px; height: 14px; transform: rotate(45deg);
  background: var(--panel); border: 2px solid var(--line); border-radius: 3px;
  transition: background .2s, border-color .2s;
}
.kf-label { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.timeline li.done .kf { background: var(--accent); border-color: var(--accent); }
.timeline li.current .kf { background: var(--ink); border-color: var(--ink); }
.timeline li.current .kf-label { color: var(--ink); font-weight: 700; }
@media (max-width: 479px) {
  .timeline li:not(.current) .kf-label { visibility: hidden; }
}

.track {
  position: absolute; z-index: 1; left: 10%; right: 10%; top: 11px; height: 2px;
  background: var(--line);
}
.playhead {
  position: absolute; top: -9px; left: calc(var(--p, 0) * 100%);
  width: 2px; height: 20px; margin-left: -1px;
  background: var(--glow);
  box-shadow: 0 0 10px var(--glow);
  transition: left .35s cubic-bezier(.3, .7, .2, 1);
}
.playhead::before {
  content: ""; position: absolute; top: -5px; left: -4px;
  border: 5px solid transparent; border-top-color: var(--glow); border-bottom: 0;
}
.track { background: linear-gradient(to right, var(--accent) calc(var(--p) * 100%), var(--line) 0); }

/* ---------- Étapes ---------- */
.step[hidden] { display: none; }
.step h2 {
  margin: 0 0 20px; font-size: 1.6rem; line-height: 1.15; letter-spacing: -0.02em; font-weight: 800;
}
.step h2:focus { outline: none; }
.step h3 { margin: 28px 0 12px; font-size: 1.1rem; font-weight: 700; }
.lead { color: var(--muted); margin: -8px 0 20px; max-width: 38em; }

.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .grid .wide { grid-column: 1 / -1; }
}

.field { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.grid .field { margin-bottom: 0; }
label, legend { display: block; font-weight: 700; font-size: 0.98rem; margin-bottom: 6px; padding: 0; }
.opt { font-weight: 400; color: var(--muted); font-size: 0.88rem; margin-left: 4px; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; min-height: 48px;
}
textarea { resize: vertical; min-height: 96px; }
input::placeholder, textarea::placeholder { color: #8f8cb0; }
input:focus-visible, select:focus-visible, textarea:focus-visible,
.btn:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; border-color: var(--accent);
}
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }

.err { color: var(--danger); font-size: 0.9rem; margin: 6px 0 0; min-height: 0; }
.err:empty { display: none; }
.form-err { margin-top: 16px; font-weight: 500; }

/* ---------- Choix en pastilles ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { margin: 0; font-weight: 500; position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; flex-direction: column; justify-content: center;
  min-height: 46px; padding: 9px 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; transition: background .15s, border-color .15s, color .15s;
}
.chip small { font-size: 0.78rem; color: var(--muted); font-weight: 400; line-height: 1.2; }
.chip:hover span { border-color: var(--accent); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip input:checked + span small { color: #cfcdee; }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; margin: 12px 0 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.check span { flex: 1; }

.colors { display: flex; gap: 16px; flex-wrap: wrap; }
.color { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 0; }
.color input { width: 56px; height: 44px; border: 1.5px solid var(--line); border-radius: 10px; padding: 3px; background: #fff; cursor: pointer; }
.colors.off { opacity: .4; pointer-events: none; }

/* ---------- Fichiers ---------- */
.dropzone input[type="file"] {
  width: 100%; font: inherit; padding: 14px; border: 1.5px dashed var(--line);
  border-radius: var(--radius); background: #faf9ff; cursor: pointer;
}
.dropzone input[type="file"]::file-selector-button {
  font: inherit; font-weight: 700; margin-right: 12px; padding: 8px 14px;
  border: 0; border-radius: 999px; background: var(--ink); color: #fff; cursor: pointer;
}
.filelist { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.filelist li {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: #f6f5fd; border-radius: 10px; font-size: 0.93rem;
}
.filelist .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist .fsize { color: var(--muted); font-size: 0.85rem; }
.filelist .rm {
  font: inherit; border: 0; background: transparent; color: var(--danger);
  cursor: pointer; padding: 6px 8px; min-height: 36px; font-weight: 700;
}
.filelist li.bad { background: #fdeaf0; }
.total { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* ---------- Boutons ---------- */
.actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.btn {
  font: inherit; font-weight: 700; min-height: 50px; padding: 12px 24px;
  border-radius: 999px; border: 2px solid transparent; cursor: pointer;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); margin-left: auto; }
.btn.primary:hover { background: #5a1ee6; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn[hidden] { display: none; }

/* ---------- Envoi ---------- */
.progress { margin-top: 20px; }
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.fill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.progress p { margin: 8px 0 0; color: var(--muted); font-size: 0.93rem; }

/* ---------- Confirmation ---------- */
section.done {
  background: var(--panel); border-radius: 18px; padding: 32px 24px;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(23, 20, 58, 0.35);
}
section.done h2 { margin: 0 0 12px; font-size: 2rem; letter-spacing: -0.02em; }
section.done h2:focus { outline: none; }
section.done p { margin: 0 0 10px; }
.ref { color: var(--muted); font-size: 0.9rem; }
section.done[hidden], .panel[hidden], .progress[hidden] { display: none; }

.foot { padding: 28px 0 40px; color: var(--muted); font-size: 0.9rem; }

/* ---------- Page texte (confidentialité) ---------- */
.prose { background: var(--panel); border-radius: 18px; padding: 24px; max-width: 720px; }
.prose h1 { font-size: 2rem; margin: 0 0 16px; letter-spacing: -0.02em; }
.prose h2 { font-size: 1.2rem; margin: 24px 0 6px; }
.prose p, .prose li { max-width: 40em; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.legal-note { color: var(--muted); font-size: 0.88rem; margin: 16px 0 0; max-width: 42em; }

.prose .upd { color: var(--muted); font-size: .9rem; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 8px; }
