/* Police de marque 4SH : Asap (variable, graisse 100–900, largeur 75–125 %). */
@font-face {
  font-family: 'Asap';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 75% 125%;
  font-display: swap;
  src: url(/fonts/asap-latin-wdth-normal.woff2) format('woff2');
}

:root {
  --ink: #1f292e;
  --ink-2: #494849;
  --paper: #f4f5f7;
  --white: #fefefe;
  --red: #ea2631;
  --red-deep: #c41c26;
  --teal: #0097a7;
  --teal-deep: #007c8a;
  --line: #d6dae1;
  --font: 'Asap', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img { max-width: 100%; }
strong { font-weight: 700; }

/* ==========================================================================
   Écran TV
   ========================================================================== */

body.tv { overflow: hidden; background: #000; cursor: none; }

.tv-layout { display: flex; width: 100vw; height: 100vh; }

.stage { position: relative; flex: 1; min-width: 0; background: #000; overflow: hidden; }
.stage video, .stage iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover;
}
.stage.contain video { object-fit: contain; }
.stage-empty {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  color: var(--paper); font-size: 2.2vw; padding: 4vw; margin: 0;
}
.stage-empty small { display: block; margin-top: 1em; opacity: .6; font-size: .6em; word-break: break-all; }

.rail {
  width: clamp(380px, 27vw, 620px);
  container-type: inline-size;
  background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  text-align: center;
  padding: clamp(24px, 2.6vw, 56px) clamp(20px, 2vw, 44px);
}

.brand { display: block; width: 40cqw; height: auto; margin: 0 auto; }
.tagline { margin: .5em auto 0; font-size: 4.6cqw; font-weight: 500; color: var(--ink-2); max-width: 20ch; text-wrap: balance; }

.qr {
  margin: 0; background: var(--white); border: 3px solid var(--ink); border-radius: 3cqw;
  padding: 5cqw 5cqw 4cqw;
}
.qr img { display: block; width: 60cqw; height: 60cqw; }
.qr figcaption { margin-top: 3cqw; font-size: 4.4cqw; font-weight: 600; }

.counter { width: 100%; }
.counter-value {
  font-weight: 800; font-stretch: 125%; font-size: 32cqw; line-height: .9;
  color: var(--red); font-variant-numeric: tabular-nums; letter-spacing: -.03em;
  transform-origin: 50% 70%;
}
.counter-value[data-digits="4"] { font-size: 25cqw; }
.counter-value[data-digits="5"] { font-size: 20cqw; }
.counter-value[data-digits="6"] { font-size: 16cqw; }
.counter-label { font-size: 6cqw; font-weight: 600; margin-top: .15em; }
.counter-value.bump { animation: bump .7s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes bump {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.16); color: var(--ink); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   Pages mobiles (don, info)
   ========================================================================== */

body.mobile { display: flex; flex-direction: column; min-height: 100dvh; }
.m-wrap {
  flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 540px; margin: 0 auto;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
}
.screen { flex: 1; display: flex; flex-direction: column; }
.m-brand { display: block; align-self: flex-start; height: 28px; width: auto; margin-bottom: 20px; }
.m-title {
  font-size: clamp(30px, 8.5vw, 42px); font-weight: 700; line-height: 1.08; letter-spacing: -.01em;
  margin: auto 0 14px; text-wrap: balance;
}
.m-lead { font-size: 18px; color: var(--ink-2); margin: 0 0 24px; }

.actions { display: grid; gap: 12px; margin-top: auto; }
.btn {
  appearance: none; display: block; width: 100%; border: 0; border-radius: 16px;
  font: inherit; font-weight: 700; font-size: 24px; line-height: 1.2; padding: 22px 24px;
  color: var(--white); background: var(--red); text-align: center; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .08s;
}
.btn:hover { background: var(--red-deep); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--teal); }
.btn.secondary:hover { background: var(--teal-deep); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.back { display: block; text-align: center; color: var(--ink-2); font-weight: 600; padding: 10px; text-decoration: none; }
.back:hover { color: var(--ink); text-decoration: underline; }

.error { color: var(--red); font-weight: 600; margin: 0 0 10px; min-height: 1.4em; }

.thanks { justify-content: flex-start; }
.thanks-body { margin: auto 0; text-align: center; }
.thanks .big {
  font-weight: 800; font-stretch: 125%; font-size: clamp(60px, 22vw, 110px); line-height: 1;
  color: var(--red); letter-spacing: -.02em;
}
.thanks-text { font-size: 22px; margin: 18px 0 8px; }
.thanks-text strong { font-size: 1.3em; font-stretch: 125%; font-weight: 800; color: var(--red); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 26px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip span {
  display: block; padding: 11px 16px; border: 2px solid var(--line); border-radius: 999px;
  background: var(--white); font-size: 17px; font-weight: 600; user-select: none;
  transition: background .12s, border-color .12s, color .12s;
}
.chip input:checked + span { background: var(--red); border-color: var(--red); color: var(--white); }
.chip input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }

.field { margin: 0 0 8px; }
.field label { display: block; font-weight: 600; margin-bottom: 8px; }
.field input {
  width: 100%; font: inherit; font-size: 18px; padding: 15px 16px; border: 2px solid var(--line);
  border-radius: 12px; background: var(--white); color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--teal); }
.field input[aria-invalid="true"] { border-color: var(--red); }
.hint { font-size: 14px; color: var(--ink-2); margin: 0 0 18px; }

/* ==========================================================================
   Admin
   ========================================================================== */

body.admin { padding: 24px 20px 60px; }
.a-wrap { max-width: 720px; margin: 0 auto; }
.a-wrap h1 { font-weight: 800; font-stretch: 125%; font-size: 32px; margin: 0 0 6px; }
.a-wrap h1 + p { margin: 0 0 28px; color: var(--ink-2); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin: 0 0 18px; }
.card h2 { font-size: 20px; margin: 0 0 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.a-wrap label { display: block; font-weight: 600; margin: 12px 0 6px; }
.a-wrap label.inline { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.a-wrap input[type="text"], .a-wrap input[type="url"], .a-wrap input[type="number"], .a-wrap textarea, .a-wrap select {
  width: 100%; font: inherit; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px;
  background: var(--white); color: var(--ink);
}
.a-wrap input[type="number"] { width: 140px; }
.a-wrap textarea { min-height: 220px; resize: vertical; }
.a-wrap input:focus, .a-wrap textarea:focus, .a-wrap select:focus { outline: none; border-color: var(--teal); }
.a-wrap .btn { width: auto; display: inline-block; font-size: 16px; padding: 11px 18px; border-radius: 10px; }
.a-wrap .btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.a-wrap .btn.ghost:hover { border-color: var(--ink); }
.a-wrap .btn.danger { background: var(--ink); }
.big-count { font-weight: 800; font-stretch: 125%; font-size: 64px; line-height: 1; color: var(--red); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); font-size: 14px; }
.status { font-weight: 600; min-height: 1.4em; margin: 10px 0 0; }
.status.ok { color: var(--teal-deep); }
.status.ko { color: var(--red); }
.qr-preview { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.qr-preview img { width: 160px; height: 160px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; }
code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .92em; background: var(--paper); padding: 1px 5px; border-radius: 4px; word-break: break-all; }

@media (prefers-reduced-motion: reduce) {
  .counter-value.bump { animation: none; }
  .btn, .chip span { transition: none; }
}
