/* French Speak – style commun des pages (connexion, inscription, mot de passe, compte, admin) */

@view-transition { navigation: auto; }   /* fondu entre les pages (navigateurs récents) */

:root {
  --bg: #070d24;
  --ink: #0b1433;                         /* texte foncé sur surfaces blanches */
  --text: #ffffff;
  --muted: rgba(235, 240, 255, .68);
  --faint: rgba(235, 240, 255, .42);
  --blue: #4375fe;
  --blue-hover: #335fff;
  --blue-light: #8fb0ff;
  --red: #ff5a60;
  --red-text: #ff8a8f;
  --green: #3ddc97;
  --glass: rgba(14, 20, 44, .46);
  --glass-edge: rgba(255, 255, 255, .14);
  --fill: rgba(255, 255, 255, .08);
  --hair: rgba(255, 255, 255, .12);

  --pad: 36px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: "Outfit", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: clip;                       /* la carte inclinée ne doit jamais créer de défilement horizontal */
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Fond : l'image floutée sous un dégradé bleu ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}
.backdrop::before {
  content: "";
  position: absolute;
  inset: -60px;
  background: url("hero.webp") center / cover no-repeat;
  filter: blur(28px);
  animation: drift 24s ease-in-out infinite alternate;
  will-change: transform;
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg,
    rgba(30, 80, 220, .62) 0%,
    rgba(12, 35, 120, .76) 50%,
    rgba(5, 12, 45, .9) 100%);
  background-size: 220% 220%;
  animation: gradient 14s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: scale(1.05) translate(0, 0); }
  50%  { transform: scale(1.14) translate(-2%, 1.5%); }
  100% { transform: scale(1.08) translate(2%, -1.5%); }
}
@keyframes gradient { to { background-position: 100% 100%; } }

/* ---------- Mise en page ---------- */
.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-height: 100vh;
  padding: 48px 24px;
}

/* ---------- Carte ---------- */
.box {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  backdrop-filter: blur(30px) saturate(160%);
  border: 1px solid var(--glass-edge);
  border-radius: 32px;
  padding: var(--pad);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    0 24px 60px rgba(0, 0, 0, .4);
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s var(--ease);
  animation: card-in .9s var(--spring) .1s backwards;
}
.box.entered { animation: none; }
@keyframes card-in {
  from { opacity: 0; transform: perspective(1200px) translateY(40px) scale(.94); }
}

.box.entered.shake { animation: shake .45s var(--ease); }
@keyframes shake {
  20% { transform: translateX(-10px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

/* Le contenu arrive élément par élément */
.box > .item { animation: rise .7s var(--ease) backwards; }
.item:nth-child(1) { animation-delay: .30s; }
.item:nth-child(2) { animation-delay: .37s; }
.item:nth-child(3) { animation-delay: .44s; }
.item:nth-child(4) { animation-delay: .51s; }
.item:nth-child(5) { animation-delay: .58s; }
.item:nth-child(6) { animation-delay: .65s; }
.item:nth-child(7) { animation-delay: .72s; }
.item:nth-child(8) { animation-delay: .79s; }
.item:nth-child(9) { animation-delay: .86s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Textes ---------- */
h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.4px;
  line-height: 1.1;
}
.sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.35;
}
.sub b { color: var(--text); font-weight: 700; }

a:not(.btn) { position: relative; color: var(--blue-light); text-decoration: none; font-weight: 700; }
a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s var(--ease);
}
a:not(.btn):hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- Boutons ---------- */
.btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 16px;
  font: 700 18px "Outfit", sans-serif;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, transform .25s var(--spring), box-shadow .25s;
}
.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: scale(.97); transition-duration: .08s; }
.btn::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}
.btn:hover::after { animation: shine .8s var(--ease); }
@keyframes shine { to { left: 130%; } }

.btn:focus-visible, .text-btn:focus-visible, a:focus-visible, summary:focus-visible,
.switch input:focus-visible + .track {
  outline: 3px solid var(--blue-light);
  outline-offset: 2px;
}

.btn-roblox {
  margin-top: 24px;
  background: var(--blue);
  box-shadow: 0 8px 20px rgba(30, 80, 255, .35);
}
.btn-roblox:hover { background: var(--blue-hover); box-shadow: 0 12px 26px rgba(30, 80, 255, .45); }
.btn-roblox svg { width: 22px; height: 22px; transition: transform .5s var(--spring); }
.btn-roblox:hover svg { transform: rotate(90deg) scale(1.1); }

.btn-main {
  background: #fff;
  color: var(--ink);
  border-radius: 9999px;
  height: 56px;
}
.btn-main:hover { background: #eef2ff; }

.btn-danger {
  background: var(--red);
  color: #fff;
  border-radius: 9999px;
  height: 52px;
}
.btn-danger:hover { background: #ff4249; }

.btn-ghost {
  background: var(--fill);
  border: 1px solid var(--hair);
  border-radius: 9999px;
}
.btn-ghost:hover { background: rgba(255, 255, 255, .14); }

.btn .spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: .8;
  animation: spin .7s linear infinite;
}
.btn.loading { pointer-events: none; }
.btn.loading .label { display: none; }
.btn.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.text-btn {
  border: 0;
  background: none;
  padding: 8px 12px;
  border-radius: 10px;
  font: 700 15px "Outfit", sans-serif;
  color: var(--blue-light);
  cursor: pointer;
  transition: background-color .2s;
}
.text-btn:hover { background: rgba(255, 255, 255, .08); }
.text-btn:disabled { opacity: .35; cursor: default; background: none; }

/* ---------- Séparateur « ou » ---------- */
.sep {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--faint);
  font-size: 15px;
  font-weight: 600;
}
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: var(--hair); animation: grow .8s var(--ease) .7s backwards; }
.sep::before { transform-origin: right; }
.sep::after  { transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }

/* ---------- Champs groupés façon iOS ---------- */
.fields { margin-top: 24px; }
.sep + .fields { margin-top: 0; }

.group {
  border-radius: 16px;
  background: var(--fill);
  border: 1px solid var(--hair);
  transition: border-color .2s, box-shadow .2s;
}
.group:focus-within { border-color: rgba(143, 176, 255, .6); }
.group.invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 90, 96, .25); }

.line {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 6px 0 18px;
  position: relative;
}
.line + .line { border-top: 1px solid var(--hair); }
.line::before {                           /* repère du champ actif */
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--blue-light);
  transform: scaleY(0);
  transition: transform .3s var(--spring), background-color .2s;
}
.line:focus-within::before { transform: scaleY(1); }
.line.invalid::before { transform: scaleY(1); background: var(--red); }
.line input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  outline: none;
  font: 500 17px "Outfit", sans-serif;
  color: var(--text);
}
.line input::placeholder { color: var(--faint); transition: transform .3s var(--ease), opacity .3s; }
.line input:focus::placeholder { transform: translateX(6px); opacity: .6; }

/* Message sous les champs : se déplie en douceur */
.error {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  color: var(--red-text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  transition: grid-template-rows .3s var(--ease), opacity .3s, margin-top .3s var(--ease);
}
.error > span { overflow: hidden; }
.error.on { grid-template-rows: 1fr; opacity: 1; margin-top: 10px; }
.error.note { color: var(--muted); }
.error.ok { color: var(--green); }

/* Force du mot de passe */
.meter {
  --lvl: var(--red);
  display: flex;
  align-items: center;
  gap: 12px;
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: height .3s var(--ease), opacity .3s, margin-top .3s var(--ease);
}
.meter.on { height: 18px; opacity: 1; margin-top: 12px; }
.meter[data-level="2"] { --lvl: var(--blue-light); }
.meter[data-level="3"] { --lvl: var(--green); }
.meter .bars { flex: 1; display: flex; gap: 6px; }
.meter .bars i { flex: 1; height: 4px; border-radius: 2px; background: var(--hair); position: relative; overflow: hidden; }
.meter .bars i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--lvl);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease), background-color .3s;
}
.meter[data-level="1"] .bars i:nth-child(-n+1)::after,
.meter[data-level="2"] .bars i:nth-child(-n+2)::after,
.meter[data-level="3"] .bars i::after { transform: scaleX(1); }
.meter .lbl { min-width: 46px; text-align: right; font-size: 13px; font-weight: 700; color: var(--lvl); transition: color .3s; }

/* ---------- Ligne d'options + interrupteur iOS ---------- */
.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 16px 0 22px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}
.row > * { white-space: nowrap; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .track {
  flex: none;
  width: 46px;
  height: 28px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .18);
  position: relative;
  transition: background-color .25s, box-shadow .2s;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .3);
  transition: transform .3s var(--spring), width .2s;
}
.switch input:checked + .track { background: var(--blue); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch:active .track::after { width: 26px; }
.switch:active input:checked + .track::after { transform: translateX(14px); }
.switch.invalid .track { box-shadow: 0 0 0 2px var(--red); }

.fields + .btn-main { margin-top: 22px; }

.foot {
  margin-top: 20px;
  text-align: center;
  color: var(--muted);
  font-weight: 500;
  font-size: 16px;
}

/* ---------- Écrans de résultat (envoyé, confirmé, lien expiré…) ---------- */
.done { display: none; text-align: center; padding: 6px 0 2px; }
.box.is-done > .item { display: none; }
.box.is-done > .done.show { display: block; animation: rise .6s var(--ease) backwards; }
.done:focus { outline: none; }
.check {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--blue);
  display: grid;
  place-items: center;
  animation: pop .6s var(--spring) .1s backwards;
}
.check.fail { background: var(--red); }
@keyframes pop { from { opacity: 0; transform: scale(.4); } }
.check svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: #fff;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: draw .45s var(--ease) .45s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.big-spinner {
  width: 56px;
  height: 56px;
  margin: 8px auto 22px;
  border: 4px solid rgba(255, 255, 255, .15);
  border-top-color: var(--blue-light);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.done h2 { font-size: 28px; font-weight: 800; letter-spacing: -.3px; }
.done p { margin-top: 8px; color: var(--muted); font-size: 17px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.done p b { color: var(--text); font-weight: 700; }
.done .btn { margin-top: 24px; }

/* ---------- Configuration admin : QR code ---------- */
.qr {
  display: block;
  width: 200px;
  height: 200px;
  margin: 22px auto 0;
  padding: 10px;
  border-radius: 18px;
  background: #fff;
  image-rendering: pixelated;
}
.secret { margin-top: 12px; text-align: center; color: var(--muted); font-size: 14px; font-weight: 600; }
.secret b {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: 1px;
  overflow-wrap: anywhere;
  user-select: all;
}

/* ---------- Page « Mon compte » ---------- */
.notice {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--green);
  background: rgba(61, 220, 151, .12);
  border: 1px solid rgba(61, 220, 151, .3);
}
.notice.bad { color: var(--red-text); background: rgba(255, 90, 96, .12); border-color: rgba(255, 90, 96, .3); }

.info {
  margin-top: 24px;
  border-radius: 16px;
  background: var(--fill);
  border: 1px solid var(--hair);
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 18px;
  font-size: 16px;
}
.info-row + .info-row { border-top: 1px solid var(--hair); }
.info-row > span:first-child { color: var(--muted); font-weight: 600; white-space: nowrap; }
.info-row b, .info-row .val { text-align: right; font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.info-row .val { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px 6px; }
.info-row .val .text-btn { padding: 4px 8px; }

.panel {
  margin-top: 14px;
  border-radius: 16px;
  background: var(--fill);
  border: 1px solid var(--hair);
}
.panel > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 16px;
}
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 2px solid var(--faint);
  border-bottom: 2px solid var(--faint);
  transform: rotate(-45deg);
  transition: transform .3s var(--spring);
}
.panel[open] > summary::after { transform: rotate(45deg); }
.panel > form { padding: 0 14px 16px; }
.panel .group { background: rgba(255, 255, 255, .05); }
.panel .btn { margin-top: 14px; height: 50px; font-size: 17px; }
.panel.danger > summary { color: var(--red-text); }
.panel-text { margin-bottom: 12px; color: var(--muted); font-size: 15px; line-height: 1.4; }
.account > .btn-main { margin-top: 22px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .check svg { stroke-dashoffset: 0; }
}

/* ---------- Téléphone ---------- */
@media (max-width: 600px) {
  :root { --pad: 20px; }
  .page { padding: 32px 16px; }
  .box { border-radius: 28px; padding: 26px var(--pad) 24px; }
  h1 { font-size: 30px; }
  .sub { font-size: 16px; }
  .row { font-size: 13px; gap: 8px; }
  .switch { gap: 8px; }
  .info-row { padding: 10px 14px; font-size: 15px; }
}
