:root {
  --fond: #0b0e13;
  --carte: rgba(17, 21, 28, 0.82);
  --bord: rgba(255, 255, 255, 0.09);
  --texte: #e8ecf1;
  --doux: #9aa4b2;
  --accent: #5b8def;
  --discord: #5865f2;
  --discord-fonce: #4752c4;
  --succes: #3ccf7a;
  --attention: #f0a43a;
  --danger: #ef5b5b;
  --rayon: 18px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--texte);
  background: var(--fond);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 72px;
  background: transparent; /* le fond (photo) est derrière, sur un calque à z-index -1 */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.fond {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(11, 14, 19, 0.55) 0%, rgba(11, 14, 19, 0.82) 60%, rgba(11, 14, 19, 0.96) 100%),
    url("/fond.webp") center / cover no-repeat;
  filter: saturate(0.85);
  animation: derive 40s ease-in-out infinite alternate;
  transform-origin: 50% 40%;
}

@keyframes derive {
  from { transform: scale(1.04); }
  to { transform: scale(1.12) translateX(-1.5%); }
}

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

.carte {
  width: 100%;
  max-width: 440px;
  padding: 34px 30px 28px;
  border-radius: var(--rayon);
  background: var(--carte);
  border: 1px solid var(--bord);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-align: center;
  animation: monte 0.45s ease-out both;
}

.carte.large { max-width: 640px; }

@keyframes monte {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.logo {
  display: block;
  margin: 0 auto 14px;
  width: 84px;
  height: auto;
  filter: drop-shadow(0 0 18px rgba(190, 215, 245, 0.25));
}

.sur-titre {
  margin: 0 0 4px;
  color: var(--doux);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 10px;
  font-size: 1.65rem;
  line-height: 1.2;
  font-weight: 700;
}

h2 {
  margin: 24px 0 6px;
  font-size: 1.05rem;
}

.intro {
  margin: 0 0 22px;
  color: var(--doux);
}

.etapes {
  list-style: none;
  counter-reset: etape;
  margin: 0 0 26px;
  padding: 0;
  text-align: left;
}

.etapes li {
  counter-increment: etape;
  position: relative;
  padding: 10px 12px 10px 52px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 8px;
}

.etapes li::before {
  content: counter(etape);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(91, 141, 239, 0.16);
  color: #a9c3ff;
}

.etapes b { display: block; font-size: 0.95rem; }
.etapes span { display: block; color: var(--doux); font-size: 0.85rem; }

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 650;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease, opacity 0.2s ease;
}

.bouton:hover { transform: translateY(-1px); }
.bouton:active { transform: none; }
.bouton:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.bouton svg { width: 24px; height: 24px; flex: none; }
.bouton.discord { background: var(--discord); }
.bouton.discord:hover { background: var(--discord-fonce); }
.bouton.secondaire { background: rgba(255, 255, 255, 0.08); color: var(--texte); }
.bouton.en-cours { opacity: 0.7; cursor: progress; }

.mention {
  margin: 16px 0 0;
  font-size: 0.78rem;
  color: var(--doux);
}

.profil {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 20px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.profil img { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.profil div { flex: 1; min-width: 0; }
.profil b, .profil span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profil span { color: var(--doux); font-size: 0.85rem; }
.profil .changer { font-size: 0.8rem; color: var(--doux); flex: none; }

/* --- case « Je ne suis pas un robot » */
.captcha {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 14px 14px 16px;
  border-radius: 12px;
  background: #f4f6f9;
  color: #1d232c;
  text-align: left;
  cursor: pointer;
  user-select: none;
  border: 1px solid #d5dbe3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  outline-offset: 3px;
}

.captcha:focus-visible { outline: 2px solid var(--accent); }

.captcha .case {
  position: relative;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 6px;
  border: 2px solid #9aa5b4;
  background: #fff;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.captcha:hover .case { border-color: #6c7a8c; }

.captcha .roue {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 3px solid #cfd8e3;
  border-top-color: var(--accent);
  opacity: 0;
}

.captcha .coche {
  position: absolute;
  inset: 2px;
  fill: none;
  stroke: var(--succes);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
}

.captcha.en-cours .case { border-color: transparent; background: transparent; }
.captcha.en-cours .roue { opacity: 1; animation: tourne 0.8s linear infinite; }
.captcha.valide { cursor: default; }
.captcha.valide .case { border-color: transparent; background: transparent; }
.captcha.valide .coche { animation: trace 0.35s ease-out forwards; }

@keyframes tourne { to { transform: rotate(360deg); } }
@keyframes trace { to { stroke-dashoffset: 0; } }

.captcha .libelle { flex: 1; font-weight: 600; font-size: 1rem; }

.captcha .marque {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: none;
  color: #6b7686;
}

.captcha .marque img { width: 30px; height: auto; }
.captcha .marque small { font-size: 0.6rem; line-height: 1.1; text-align: center; }

.progression {
  min-height: 1.4em;
  margin: 8px 0 14px;
  font-size: 0.82rem;
  color: var(--doux);
  text-align: left;
}

.cf-turnstile { margin: 0 0 14px; }

.accord {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 0.85rem;
  color: var(--doux);
  text-align: left;
  cursor: pointer;
}

.accord input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }

.piege {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.erreur {
  min-height: 1.2em;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 0.88rem;
}

.erreur:empty { margin: 0; min-height: 0; }

/* --- résultats */
.resultat .pastille {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.07);
  animation: pop 0.4s ease-out both 0.1s;
}

@keyframes pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.resultat.succes .pastille { background: rgba(60, 207, 122, 0.16); color: var(--succes); }
.resultat.attention .pastille { background: rgba(240, 164, 58, 0.16); color: var(--attention); }
.resultat.danger .pastille { background: rgba(239, 91, 91, 0.16); color: var(--danger); }

/* --- page texte */
.texte { text-align: left; }
.texte .logo { margin-left: 0; }
.texte ul { padding-left: 20px; color: var(--doux); }
.texte p { color: var(--doux); }
.texte li { margin-bottom: 6px; }
.texte .bouton { margin-top: 20px; }
code { background: rgba(255, 255, 255, 0.08); padding: 1px 6px; border-radius: 5px; font-size: 0.9em; }

.bas {
  position: fixed;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.42);
}

.bas a { color: inherit; }

.page-texte .bas { position: static; margin-top: 24px; }

@media (max-width: 480px) {
  body { padding: 20px 16px 64px; justify-content: flex-start; }
  .carte { padding: 26px 18px 22px; }
  h1 { font-size: 1.4rem; }
  .captcha .marque { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
