/* Tiltus — jeu de tokens unique.
   Aucune valeur hexadécimale ne doit apparaître ailleurs dans le projet.
   Palette : prompt maître du 31 août 2026. */

/* Polices auto-hébergées : aucune requête vers un service tiers, et le service
   worker les met en cache dès la première visite. Sous-ensemble latin, qui
   couvre le français y compris œ et l'apostrophe typographique.
   Inter est une police variable : un seul fichier sert tous les graisses. */

/* @critique:debut — bloc inliné dans le <head> par critical_css() */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Poppins";
  src: url("/assets/fonts/poppins-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --night:      #110F1E;
  --navy:       #17152B;
  --violet:     #5B33CC;
  --violet-up:  #7655E8;
  --coral:      #FF6A63;
  --ivory:      #F7F5FA;

  --bg:         var(--night);
  --surface:    var(--navy);
  --surface-2:  #1F1D35;
  --text:       var(--ivory);
  --text-soft:  #A8A3BC;
  --line:       #2C2942;
  --accent:     var(--violet-up);
  --accent-ink: var(--ivory);
  --highlight:  var(--coral);

  --radius:     18px;
  --radius-sm:  12px;
  --gap:        16px;
  --shell:      560px;

  --font: "Poppins", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

[data-theme="light"] {
  --bg:        var(--ivory);
  --surface:   #FFFFFF;
  --surface-2: #EFECF7;
  --text:      var(--navy);
  --text-soft: #5F5A78;
  --line:      #DEDAEC;
  --accent:    var(--violet);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, .brand, .btn { font-family: var(--font); font-weight: 600; }

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 24px 20px 48px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* — Splash : visible pendant le chargement réel, jamais ralenti — */
.splash {
  position: fixed;
  inset: 0;
  background: var(--night);
  display: grid;
  place-items: center;
  z-index: 50;
  transition: opacity .55s ease;
}
.splash[hidden] { display: none; }
.splash.out { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; position: relative; }

/* — Constellation de l'écran de bienvenue —
   Points diffus de tailles variées, sans lignes : c'est la règle de la charte.
   Chacun respire à son propre rythme et dérive un peu, pour que l'ensemble
   paraisse vivant sans jamais attirer l'œil plus que le logo. */
.constellation {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.constellation i {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 var(--glow) currentColor;
  opacity: 0;
  animation: star-breathe var(--dur) ease-in-out var(--delay) infinite;
  will-change: opacity, transform;
}

@keyframes star-breathe {
  0%, 100% { opacity: 0; transform: translate3d(0, 0, 0) scale(.55); }
  50%      { opacity: var(--peak); transform: translate3d(var(--dx), var(--dy), 0) scale(1); }
}

/* Halo : l'univers de la marque, pas un projecteur.
   Porté par .constellation, qui est déjà sous le logo dans le document — un
   z-index négatif l'aurait fait passer derrière le fond du splash. */
.constellation::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 44%;
  width: 118vw;
  max-width: 620px;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--violet-up) 0%, transparent 62%);
  opacity: .2;
  animation: halo-pulse 6s ease-in-out infinite;
}

@keyframes halo-pulse {
  0%, 100% { opacity: .16; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: .30; transform: translate(-50%, -50%) scale(1.12); }
}



.splash-logo {
  width: min(62vw, 280px);
  height: auto;
  animation:
    splash-logo-in 1.1s cubic-bezier(.22, 1, .36, 1) both,
    splash-float 3.6s ease-in-out 1.1s infinite;
}

.splash-welcome {
  margin: 22px 0 0;
  font-family: var(--font);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: .01em;
  color: var(--text-soft);
  animation: splash-text-in .9s cubic-bezier(.22, 1, .36, 1) .85s both;
}

@keyframes splash-logo-in {
  from { opacity: 0; transform: scale(.82) rotate(-4deg); }
  to   { opacity: 1; transform: none; }
}

@keyframes splash-text-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Le logo respire pendant qu'on le regarde : sans cela l'attente paraît figée. */
@keyframes splash-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

/* Un téléphone réglé sur « moins d'animations » n'en subit aucune. */
@media (prefers-reduced-motion: reduce) {
  .splash-logo { animation: none; }
  .splash-welcome { animation: none; }
  .splash { transition: none; }
  .constellation::before { animation: none; }
  .constellation i { animation: none; opacity: var(--peak); }
}

/* @critique:fin */

/* — Voix de Tiltus — */
.tiltus-says {
  white-space: pre-line;
  font-size: 1.05rem;
  margin: 0 0 var(--gap);
}
.lead { font-size: 1.25rem; font-weight: 600; white-space: pre-line; margin: 0 0 8px; }
.soft { color: var(--text-soft); }
.balance { color: var(--text-soft); font-style: italic; }

.example {
  background: var(--surface);
  border-left: 3px solid var(--highlight);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px;
  margin: var(--gap) 0;
  color: var(--text-soft);
  font-style: italic;
}

/* — Formulaire — */
label { display: block; font-weight: 600; margin-bottom: 8px; }

textarea, input[type="text"], input[type="email"], input[type="password"], input[type="date"], select {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  font: inherit;
  resize: vertical;
}
textarea { min-height: 8.5em; }
textarea:focus, input:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.field { margin-bottom: var(--gap); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.btn {
  display: block;
  width: 100%;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: var(--radius);
  padding: 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.btn:disabled { opacity: .45; cursor: default; }
.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--line);
}
.btn + .btn { margin-top: 10px; }

.hint { font-size: .85rem; color: var(--text-soft); margin-top: 8px; }
.error { color: var(--highlight); font-size: .9rem; margin-top: 8px; }

.spacer { flex: 1; }

/* — Relecture proposée par Tiltus — */
.review {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: var(--gap) 0;
}
.review h3 { margin: 0 0 8px; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-soft); }
.review p { margin: 0 0 14px; }

/* — Confirmation — */
.merveilleux {
  text-align: center;
  margin: auto 0;
}
.merveilleux h1 {
  font-size: 2rem;
  letter-spacing: .04em;
  margin: 0 0 20px;
  color: var(--highlight);
}
.merveilleux p { white-space: pre-line; margin: 0 0 16px; }
.sign { font-weight: 600; }

/* — Dashboard hôte — */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: var(--gap);
}
.panel h2 { margin: 0 0 12px; font-size: 1rem; }
.stat { font-size: 2.2rem; font-weight: 700; line-height: 1; }
.stat-label { color: var(--text-soft); font-size: .85rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; color: var(--text-soft); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); }
td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }

/* — Cartes du live — */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: var(--gap);
}
.card h3 {
  margin: 0 0 12px;
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--text-soft);
  font-weight: 600;
}
.card-found { border-color: var(--accent); }
.card-found h3 { color: var(--accent); }
.card .anecdote { font-size: 1.08rem; margin: 0 0 16px; }
.card .answer { font-weight: 600; margin: 0 0 8px; }
.card .tiltus-says { color: var(--text-soft); font-size: .95rem; }

/* — Panneau de validation : jamais un nouvel écran — */
.sheet {
  position: fixed;
  inset: 0;
  background: rgba(17, 15, 30, .82);
  display: flex;
  align-items: flex-end;
  z-index: 40;
}
.sheet[hidden] { display: none; }
.sheet-inner {
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  max-height: 88dvh;
  overflow-y: auto;
  position: relative;
}
.sheet-close {
  position: absolute;
  top: 12px; right: 14px;
  background: none; border: 0;
  color: var(--text-soft);
  font-size: 1.8rem; line-height: 1;
  cursor: pointer;
}

.results { list-style: none; margin: 0; padding: 0; }
.results li {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 1.05rem;
}
.results li:active { background: var(--surface-2); }

/* — Back-office — */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.topbar-brand {
  display: flex; align-items: center; gap: 10px;
  color: inherit; text-decoration: none;
  font-family: var(--font); font-weight: 600;
}
.topbar-user { font-size: .85rem; color: var(--text-soft); text-align: right; }
.topbar-user a { color: inherit; }
.page-title { font-size: 1.4rem; margin: 0 0 20px; }

.shell-wide { max-width: 860px; }
.muted-note { color: var(--text-soft); font-size: .88rem; }
.inline-form { display: inline; }
.btn-small { width: auto; padding: 6px 12px; font-size: .8rem; }

/* — Blocs à copier — */
.copyfield textarea { margin-bottom: 10px; }
.btn-copy { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn-copy.is-copied { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.hint-before { margin: 0 0 12px; }

/* — Présence de marque sur les écrans invité —
   Le logo complet reste au splash. Ici seul le picto revient, comme une
   signature discrète, avec l'identité de l'événement. */
.event-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 16px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.event-picto { flex: none; width: 34px; height: auto; }
.event-name {
  margin: 0;
  font-family: var(--font);
  font-weight: 600;
  font-size: .92rem;
  line-height: 1.25;
}
.event-date {
  margin: 2px 0 0;
  font-size: .78rem;
  color: var(--text-soft);
}

/* Halo de marque très discret en haut de page : l'univers, pas l'ornement.
   Le brief demande très peu d'ornement pendant le live. */
body::before {
  content: "";
  position: fixed;
  left: 50%;
  top: -34vh;
  width: 150vw;
  max-width: 900px;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--violet-up) 0%, transparent 60%);
  opacity: .10;
  pointer-events: none;
  z-index: 0;
}
.shell { position: relative; z-index: 1; }

/* — Actions destructives — */
.btn-danger {
  background: transparent;
  color: var(--highlight);
  border: 1px solid var(--highlight);
  margin-top: 10px;
}
.panel-danger { border-color: var(--highlight); }
.panel-danger h2 { color: var(--highlight); }

/* Mot de passe affiché une seule fois : il doit être lisible et dictable. */
.secret {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  font-size: 1.5rem;
  letter-spacing: .06em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 0 0 10px;
  text-align: center;
  user-select: all;
  word-break: break-all;
}
