/* On tire au sort — feuille de style principale */
:root {
  --ink: #151a34;
  --ink-2: #232a4d;
  --soft: #5a6178;
  --muted: #8b93a9;
  --line: #e5e8f1;
  --bg: #f6f7fb;
  --card: #ffffff;
  --accent: #ff7a59;
  --accent-2: #ffb457;
  --ok: #1f9d63;
  --err: #d9455f;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(21,26,52,.04), 0 12px 32px rgba(21,26,52,.07);
  --shadow-lg: 0 24px 60px rgba(21,26,52,.16);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
}

* { box-sizing: border-box; }

/* l'attribut hidden doit toujours gagner, même contre .btn { display: inline-flex } */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; }

img, svg { max-width: 100%; }

.wrap { width: min(1080px, 100% - 40px); margin-inline: auto; }

/* ─────────────────────────────────────────── barre haute */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px max(20px, calc((100% - 1080px) / 2));
  background: rgba(246,247,251,.86);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid rgba(21,26,52,.06);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-weight: 700; font-size: 16px; letter-spacing: -.01em;
}
.brand-mark { width: 26px; height: 26px; flex: none; }
.topnav { display: flex; gap: 22px; }
.topnav a { color: var(--soft); text-decoration: none; font-size: 14px; font-weight: 500; }
.topnav a:hover { color: var(--ink); }

/* ─────────────────────────────────────────── héros */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 12% -10%, #2c3566 0%, #151a34 46%, #0e1226 100%);
  color: #fff;
  padding: 72px 0 88px;
  margin-bottom: -46px;
}
.hero-glow {
  position: absolute; inset: auto -10% -40% 40%;
  height: 520px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255,122,89,.5), transparent 70%),
              radial-gradient(closest-side, rgba(255,180,87,.28), transparent 72%);
  transform: translateY(30%);
  filter: blur(8px);
}
.hero-inner { position: relative; }
.eyebrow {
  margin: 0 0 18px; font-size: 12px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent-2);
}
.hero h1 {
  margin: 0; font-size: clamp(34px, 5.6vw, 62px); line-height: 1.05;
  letter-spacing: -.022em; max-width: 16ch;
}
.hero h1 em {
  font-style: italic;
  background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede {
  margin: 22px 0 0; max-width: 50ch;
  font-size: clamp(16px, 1.9vw, 19px); color: #c8cee4; line-height: 1.61;
}
.hero-points {
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  margin: 26px 0 0; padding: 0; list-style: none;
  font-size: 14px; color: #aeb6d2;
}
.hero-points li { display: flex; align-items: center; gap: 8px; }
.hero-points li::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.btn-hero { margin-top: 32px; }

/* ─────────────────────────────────────────── boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font: inherit; font-weight: 650; font-size: 15px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  padding: 12px 20px; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(255,122,89,.45); outline-offset: 2px; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #24150b; box-shadow: 0 10px 26px rgba(255,122,89,.32);
}
.btn-primary:hover { box-shadow: 0 14px 32px rgba(255,122,89,.42); }
.btn-primary[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-ghost {
  background: #fff; color: var(--ink); border-color: var(--line);
}
.btn-ghost:hover { background: #f2f4fa; }
.btn-soft {
  background: #eef1f9; color: var(--ink-2); border-color: transparent;
}
.btn-soft:hover { background: #e4e8f4; }
.btn-lg { padding: 16px 30px; font-size: 16.5px; border-radius: 13px; }
.btn-hero {
  background: #fff; color: var(--ink);
  padding: 15px 28px; font-size: 16px; border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.28);
}
.btn-hero:hover { transform: translateY(-1px); }

/* ─────────────────────────────────────────── panneaux */
.panel {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: clamp(20px, 3.4vw, 34px);
  margin-bottom: 26px;
  scroll-margin-top: 90px;
}
#organiser { position: relative; z-index: 2; }
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 22px;
}
.panel-head h2 { margin: 0; font-size: clamp(22px, 2.6vw, 28px); }
.hint { margin: 6px 0 0; color: var(--soft); font-size: 14px; line-height: 1.55; max-width: 62ch; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─────────────────────────────────────────── champs */
.field { margin-bottom: 16px; }
.field label {
  display: block; margin-bottom: 7px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
}
.opt { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="email"], textarea, select {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  background: #fbfcfe; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 13px; transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: #a7aec1; }
input:focus, textarea:focus, select:focus {
  outline: none; background: #fff;
  border-color: rgba(255,122,89,.65);
  box-shadow: 0 0 0 4px rgba(255,122,89,.13);
}
textarea { resize: vertical; min-height: 78px; }

/* ─────────────────────────────────────────── groupes */
.groupes { display: grid; gap: 14px; margin: 22px 0 16px; }
.groupe {
  border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, #fdfdff, #fafbff);
  padding: 14px 16px 16px;
}
.groupe-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.groupe-tag {
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: rgba(255,122,89,.1);
  padding: 5px 9px; border-radius: 7px; white-space: nowrap;
}
.groupe-head input {
  border: 1px solid var(--line); background: #fff; padding: 8px 10px;
  font-weight: 600; font-size: 14.5px;
}
.groupe-head input:hover { background: #f9fafd; border-color: #d8deeb; }
.icon-btn {
  margin-left: auto; flex: none;
  width: 36px; height: 36px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 16px; line-height: 1;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: #fdeaee; color: var(--err); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.participants { display: grid; gap: 9px; }
.participant {
  display: grid; grid-template-columns: 1.2fr 1.4fr auto; gap: 9px; align-items: center;
  padding-top: 9px; border-top: 1px solid #eef0f7;
}
.participant:first-child { padding-top: 0; border-top: none; }
.participant input { background: #fff; }
.add-parti { margin-top: 10px; }
.add-parti button {
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  background: transparent; border: 1px dashed #cfd6e6; border-radius: 9px;
  padding: 8px 14px; cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
.add-parti button:hover { border-color: var(--accent); color: var(--accent); background: rgba(255,122,89,.05); }

.add-row { margin: 4px 0 22px; }

/* ─────────────────────────────────────────── interrupteur */
.options { border-top: 1px solid var(--line); padding-top: 20px; }
.switch { display: flex; align-items: flex-start; gap: 13px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-ui {
  position: relative; flex: none; width: 44px; height: 26px; border-radius: 99px;
  background: #d7dcea; transition: background .18s ease; margin-top: 1px;
}
.switch-ui::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(21,26,52,.28); transition: transform .18s ease;
}
.switch input:checked + .switch-ui { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid rgba(255,122,89,.4); outline-offset: 2px; }
.switch-txt strong { display: block; font-size: 14.5px; font-weight: 650; }
.switch-txt small { color: var(--muted); font-size: 13px; }

/* ─────────────────────────────────────────── lancement */
.launch {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 24px;
}
.counter { margin: 0; color: var(--muted); font-size: 13.5px; }
.alerte {
  margin: 16px 0 0; padding: 12px 14px; border-radius: 10px;
  background: #fdecef; color: #a5283d; border: 1px solid #f8d3da; font-size: 14px;
}
.avertissement {
  margin: 0 0 18px; padding: 12px 14px; border-radius: 10px;
  background: #fff6e6; color: #8a5a12; border: 1px solid #ffe6bd; font-size: 14px;
}

/* ─────────────────────────────────────────── résultats */
.resultats { width: 100%; border-collapse: collapse; font-size: 15px; }
.resultats th {
  text-align: left; font-size: 12px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--soft); font-weight: 700; padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
}
.resultats th:nth-child(2) { width: 44px; }
.resultats td { padding: 12px; border-bottom: 1px solid #f0f2f8; vertical-align: middle; }
.resultats tbody tr:last-child td { border-bottom: none; }
.resultats tbody tr:hover { background: #fafbff; }
.res-qui { font-weight: 650; }
.res-vers {
  font-family: var(--serif); font-size: 16.5px; font-weight: 700;
  color: var(--ink); background: linear-gradient(135deg, rgba(255,122,89,.14), rgba(255,180,87,.16));
  border-radius: 8px; padding: 3px 10px; display: inline-block;
}
.res-flag {
  display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: #b8762a;
  background: #fff3de; border-radius: 5px; padding: 2px 6px; vertical-align: 1px;
}
.fleche { color: var(--accent); text-align: center; font-size: 16px; }

.tableau-bloc { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 26px; }

.mail {
  border-top: 1px solid var(--line); padding-top: 24px;
}
.mail h3 { margin: 0 0 4px; font-size: 19px; }
.mail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; margin-top: 16px; }

.relance { margin-top: 22px; }

/* ─────────────────────────────────────────── liens privés */
.liens { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 18px; }
.liens summary {
  cursor: pointer; font-weight: 650; font-size: 14.5px; color: var(--ink-2);
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.liens summary::-webkit-details-marker { display: none; }
.liens summary::before {
  content: "▸"; color: var(--accent); transition: transform .15s;
}
.liens[open] summary::before { transform: rotate(90deg); }
.liens ul { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.liens li {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fafbff; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 13.5px;
}
.liens li b { min-width: 110px; }
.liens li code {
  font-size: 12px; color: var(--soft); background: #fff; border: 1px solid var(--line);
  border-radius: 6px; padding: 3px 7px; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%; flex: 1 1 240px;
}
.liens li button {
  font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 7px; padding: 5px 10px;
}
.liens li button:hover { border-color: var(--accent); color: var(--accent); }

/* ─────────────────────────────────────────── étapes & faq */
.steps, .faq { padding: 56px 0 0; }
.steps h2, .faq h2 { margin: 0 0 24px; font-size: clamp(24px, 3vw, 32px); }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step {
  background: #fff; border: 1px solid var(--line); border-radius: 15px;
  padding: 22px; box-shadow: var(--shadow);
}
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; margin-bottom: 12px;
  font-size: 14px; font-weight: 700; color: #24150b;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.step h3 { margin: 0 0 6px; font-size: 17px; font-family: var(--sans); font-weight: 700; }
.step p { margin: 0; color: var(--soft); font-size: 14px; line-height: 1.6; }

.faq details {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 10px;
}
.faq summary {
  cursor: pointer; font-weight: 650; font-size: 15px; list-style: none;
  display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 700; font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 12px 0 0; color: var(--soft); font-size: 14.5px; line-height: 1.65; }

/* ─────────────────────────────────────────── pied */
.footer { margin-top: 64px; padding: 26px 0 40px; border-top: 1px solid var(--line); }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center;
  color: var(--muted); font-size: 13.5px;
}
.footer a { color: var(--soft); text-decoration: none; }
.footer a:hover { color: var(--accent); }
.dot { opacity: .5; }

/* ─────────────────────────────────────────── toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 12px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 11px;
  font-size: 14px; box-shadow: var(--shadow-lg); z-index: 60;
  opacity: 0; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ─────────────────────────────────────────── page lien privé */
.lien-page {
  min-height: 100vh; display: grid; place-items: center; padding: 28px 18px;
  background: radial-gradient(120% 120% at 20% -20%, #2c3566 0%, #151a34 48%, #0e1226 100%);
}
.lien-card {
  width: min(520px, 100%); background: #fff; border-radius: 22px;
  box-shadow: var(--shadow-lg); padding: 38px 32px; text-align: center;
}
.lien-card .brand { justify-content: center; margin-bottom: 22px; }
.lien-eyebrow {
  font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin: 0 0 10px;
}
.lien-card h1 { margin: 0 0 10px; font-size: clamp(24px, 5vw, 30px); line-height: 1.2; }
.lien-card p.sub { margin: 0 0 26px; color: var(--soft); font-size: 15px; }
.reveal-zone { min-height: 156px; display: grid; place-items: center; }
.reveal-cache {
  width: 100%; border: 2px dashed #d9dfee; border-radius: 16px;
  padding: 34px 18px; color: var(--muted); font-size: 14px;
  transition: border-color .2s, background .2s;
}
.reveal-cache:hover { border-color: var(--accent); background: rgba(255,122,89,.03); }
.reveal-resultat {
  width: 100%; padding: 30px 18px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,122,89,.14), rgba(255,180,87,.2));
  animation: pop .42s cubic-bezier(.2,.9,.3,1.2) both;
}
.reveal-resultat small {
  display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: #9a6a1f; margin-bottom: 8px; font-weight: 700;
}
.reveal-resultat strong {
  font-family: var(--serif); font-size: clamp(26px, 6vw, 34px);
  color: var(--ink); line-height: 1.2;
}
@keyframes pop {
  from { opacity: 0; transform: scale(.94); }
  to { opacity: 1; transform: scale(1); }
}
.lien-card .btn { width: 100%; margin-top: 8px; }
.lien-foot { margin: 20px 0 0; font-size: 12px; color: var(--muted); }

/* ─────────────────────────────────────────── responsive */
@media (max-width: 760px) {
  .steps-grid { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .hero { padding: 54px 0 74px; }
  .mail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  /* 16px minimum : sinon Safari iOS zoome automatiquement au focus */
  input[type="text"], input[type="email"], textarea, select { font-size: 16px; }
  .participant { grid-template-columns: 1fr; gap: 7px; }
  .participant .icon-btn { margin-left: 0; justify-self: end; margin-top: -2px; }
  .panel-head { flex-direction: column; align-items: stretch; }
  .head-actions { justify-content: flex-start; }
  .launch { flex-direction: column; align-items: stretch; }
  .launch .btn { width: 100%; }
  .counter { text-align: center; }
  .liens li code { flex-basis: 100%; }
  .resultats th:nth-child(2) { width: 28px; }
  .resultats td { padding: 10px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* ─────────────────────────────────────────── impression */
@media print {
  .topbar, .hero, .steps, .faq, .footer, .mail, .liens, .relance,
  .head-actions, .launch, #panel-form, .toast { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; border: none; padding: 0; }
  .resultats { font-size: 13pt; }
  .resultats th { color: #000; }
  .res-vers { background: none; padding: 0; }
}
