/* =========================================================
   AFTERGLOW · page de connexion du backoffice (backoffice/login.html)
   Reprend la connexion du site (css/afterglow-auth.css) :
   panneau « alcôve » à gauche, formulaire à droite,
   champs .inp, bouton signature Ivoire, chips mono.
   ========================================================= */
:root {
  --l-nuit: #0B0908; --l-fumee: #1A1614; --l-tabac: #3A2A22; --l-ambre: #B5683C;
  --l-rouge: #A3241C; --l-ivoire: #EFE6DA; --l-creux: #13100E; --l-cire: #CDBBA5;
  --l-voile: #ADA093; --l-cendre: #6E6359; --l-lichen: #8FA184;

  --ag-nuit: var(--l-nuit); --ag-salon: var(--l-fumee); --ag-salon-haut: var(--l-tabac);
  --ag-creux: var(--l-creux); --ag-lueur: var(--l-ambre); --ag-halo: var(--l-ambre);
  --ag-signature: var(--l-rouge); --ag-poudre: var(--l-cire); --ag-lait: var(--l-ivoire);
  --ag-voile: var(--l-voile); --ag-cendre: var(--l-cendre); --ag-valide: var(--l-lichen);
  --ag-filet: color-mix(in srgb, var(--ag-lait) 11%, transparent);
  --ag-filet-fort: color-mix(in srgb, var(--ag-lait) 22%, transparent);
  --ag-btn-survol: #F7F1E8; --ag-btn-presse: #D8CCBC; --ag-btn-encre: var(--l-nuit);
  --ag-trace-1: color-mix(in srgb, var(--l-ambre) 80%, transparent);
  --ag-trace-2: color-mix(in srgb, var(--l-ambre) 40%, transparent);
  --ag-trace-3: color-mix(in srgb, var(--l-ambre) 16%, transparent);
  --ag-trace-halo: -.035em 0 0 var(--ag-trace-1), -.07em 0 .02em var(--ag-trace-2), -.105em 0 .04em var(--ag-trace-3), 0 0 .8em color-mix(in srgb, var(--ag-halo) 22%, transparent);
  --ag-g-satin: linear-gradient(100deg, var(--l-ivoire) 0%, color-mix(in srgb, var(--l-ivoire) 88%, var(--l-ambre)) 100%);
  --ag-g-alcove: radial-gradient(130% 90% at 50% 118%, color-mix(in srgb, var(--ag-lueur) 62%, var(--ag-nuit)) 0%, color-mix(in srgb, var(--ag-halo) 55%, var(--ag-nuit)) 26%, var(--ag-salon) 62%, var(--ag-nuit) 100%);
  --ag-r-xs: 8px; --ag-r-s: 12px; --ag-r-m: 20px; --ag-r-l: 28px; --ag-r-pill: 999px;
  --ag-t-flash: 160ms; --ag-t-court: 320ms; --ag-t-temps: 640ms;
  --ag-e: cubic-bezier(.22, .61, .36, 1);
  --f-display: 'Anybody', 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
  --f-body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'Archivo Etroit', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ag-gut: max(16px, 4vw);
  --ag-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 240 240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body.ag-login {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--ag-nuit); color: var(--ag-lait);
  font: 400 15px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
body.ag-login::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50; background-image: var(--ag-grain); opacity: .04; }
body.ag-login ::selection { background: var(--ag-lueur); color: var(--ag-nuit); }
body.ag-login :focus-visible { outline: 2px solid var(--ag-lait); outline-offset: 3px; }
body.ag-login [hidden] { display: none !important; }

/* ---------- Barre du haut : logo + langues ---------- */
.agl-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; max-width: 1240px; margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) var(--ag-gut) 0;
}
.agl-logo { display: block; height: 26px; width: auto; }
.login-lang {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border-radius: var(--ag-r-pill); background: var(--ag-creux);
  box-shadow: inset 0 0 0 1px var(--ag-filet-fort);
}
.login-lang__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.login-lang__btn {
  min-width: 40px; padding: 8px 10px; border-radius: var(--ag-r-pill); text-align: center;
  font: 400 10.5px/1 var(--f-mono); letter-spacing: .1em; text-decoration: none; color: var(--ag-voile);
  transition: color var(--ag-t-court), background var(--ag-t-court);
}
.login-lang__btn:hover { color: var(--ag-lait); }
.login-lang__btn.is-active { background: var(--ag-g-satin); color: var(--ag-btn-encre); }

/* ---------- Mise en page ---------- */
.agl-shell {
  flex: 1 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 440px); gap: clamp(40px, 6vw, 88px);
  align-items: stretch;
  width: 100%; max-width: 1240px; margin: 0 auto;
  padding: clamp(28px, 5vh, 56px) var(--ag-gut) clamp(32px, 6vh, 64px);
}

/* ---------- Panneau gauche : alcôve + accroche ---------- */
.agl-panel {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
  min-height: min(620px, calc(100dvh - 180px)); padding: 44px;
  border-radius: var(--ag-r-l); background: var(--ag-g-alcove);
  box-shadow: inset 0 0 0 1px var(--ag-filet);
  container-type: inline-size;
}
.agl-panel::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: var(--ag-grain); background-size: 160px; opacity: .14; mix-blend-mode: overlay; }
.agl-kicker { display: inline-flex; align-items: center; gap: 10px; margin: 0; font: 400 10.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ag-lait); }
.agl-kicker i { width: 7px; height: 7px; border-radius: 50%; background: var(--ag-lueur); box-shadow: 0 0 12px var(--ag-lueur); }
@media (prefers-reduced-motion: no-preference) {
  .agl-kicker i { animation: aglBreath 5s cubic-bezier(.45, 0, .55, 1) infinite; }
}
@keyframes aglBreath { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

.login-brand__title {
  margin: 0;
  font-family: var(--f-display); font-weight: 900; font-variation-settings: "wdth" 150, "wght" 900;
  font-size: clamp(24px, 8.6cqi, 60px); line-height: .92; letter-spacing: -.01em; text-transform: uppercase;
  color: var(--ag-lait); text-shadow: var(--ag-trace-halo);
}
.login-brand__title br.login-brand__break--narrow { display: none; }
.login-brand__title em {
  display: inline-block; margin-top: .14em;
  font-style: normal; font-weight: 700; font-variation-settings: "wdth" 54, "wght" 700; font-size: .62em; letter-spacing: .02em;
  color: color-mix(in srgb, var(--ag-lait) 78%, var(--ag-lueur)); text-shadow: none;
}
.login-brand__desc { max-width: 440px; margin: 22px 0 0; font: 400 16px/1.55 var(--f-body); color: color-mix(in srgb, var(--ag-lait) 82%, transparent); }

/* ---------- Colonne formulaire ---------- */
.agl-col { align-self: center; width: 100%; }
.login-glass__title {
  margin: 0 0 10px;
  font-family: var(--f-display); font-weight: 850; font-variation-settings: "wdth" 130, "wght" 850;
  font-size: 40px; line-height: .95; text-transform: uppercase; color: var(--ag-lait);
}
.login-glass__lead { margin: 0 0 30px; font: 400 15px/1.5 var(--f-body); color: var(--ag-voile); }

.login-form { display: flex; flex-direction: column; gap: 18px; margin: 0; }
.login-field { display: flex; flex-direction: column; gap: 10px; }
.login-field__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.login-field label { font: 400 10.5px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ag-voile); }
.login-text-link {
  appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
  font: 500 13px/1 var(--f-body); color: var(--ag-lait);
  text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ag-lueur) 70%, transparent); text-underline-offset: 4px;
  transition: color var(--ag-t-court);
}
.login-text-link:hover { color: var(--ag-poudre); }

.login-input {
  width: 100%; height: 54px; padding: 0 18px;
  border: 1px solid var(--ag-filet-fort); border-radius: var(--ag-r-m);
  background: var(--ag-creux); color: var(--ag-lait);
  font: 400 16px/1 var(--f-body); outline: none;
  transition: border-color var(--ag-t-court), box-shadow var(--ag-t-temps) var(--ag-e);
}
.login-input::placeholder { color: var(--ag-cendre); }
.login-input:hover { border-color: color-mix(in srgb, var(--ag-lait) 40%, transparent); }
.login-input:focus { border-color: var(--ag-lueur); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ag-lueur) 16%, transparent), 0 0 30px -10px var(--ag-lueur); }
.login-input:-webkit-autofill { -webkit-box-shadow: 0 0 0 100px var(--ag-creux) inset; -webkit-text-fill-color: var(--ag-lait); }

/* Cases à cocher : carré arrondi, coche Ivoire sur fond Lueur */
.login-check { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font: 400 14px/1.35 var(--f-body); color: var(--ag-lait); }
.login-check input {
  appearance: none; flex: none; width: 20px; height: 20px; margin: 0; cursor: pointer;
  border-radius: 6px; background: var(--ag-creux); box-shadow: inset 0 0 0 1px var(--ag-filet-fort);
  display: grid; place-items: center;
  transition: background var(--ag-t-court), box-shadow var(--ag-t-court);
}
.login-check input::after {
  content: ""; width: 10px; height: 6px; margin-top: -2px;
  border: solid var(--ag-nuit); border-width: 0 0 1.5px 1.5px; border-radius: 0 0 0 1px;
  transform: rotate(-45deg) scale(0); transition: transform var(--ag-t-flash) var(--ag-e);
}
.login-check input:checked { background: var(--ag-lait); box-shadow: none; }
.login-check input:checked::after { transform: rotate(-45deg) scale(1); }
.login-check:hover input:not(:checked) { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ag-lait) 40%, transparent); }

/* Bouton signature Ivoire */
.login-submit {
  appearance: none; border: 0; cursor: pointer;
  width: 100%; height: 56px; margin-top: 6px; border-radius: var(--ag-r-pill);
  background: var(--ag-g-satin); color: var(--ag-btn-encre);
  font-family: var(--f-display); font-weight: 760; font-variation-settings: "wdth" 118, "wght" 760;
  font-size: 14px; letter-spacing: .03em; text-transform: uppercase;
  box-shadow: 0 14px 40px -20px color-mix(in srgb, var(--ag-halo) 70%, transparent);
  transition: background var(--ag-t-court), box-shadow var(--ag-t-temps) var(--ag-e), transform var(--ag-t-flash) var(--ag-e), font-variation-settings var(--ag-t-temps) var(--ag-e);
}
.login-submit:hover { background: var(--ag-btn-survol); box-shadow: 0 18px 50px -20px color-mix(in srgb, var(--ag-halo) 85%, transparent); font-variation-settings: "wdth" 132, "wght" 800; }
.login-submit:active { background: var(--ag-btn-presse); transform: scale(.98); }

/* Bas : demande d'accès, capsule contour */
.login-signup {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 26px 0 0; padding: 10px 10px 10px 20px;
  border-radius: var(--ag-r-pill); box-shadow: inset 0 0 0 1px var(--ag-filet-fort);
  font: 400 14px/1.3 var(--f-body); color: var(--ag-voile);
}
.login-signup a {
  display: inline-flex; align-items: center; padding: 11px 16px; border-radius: var(--ag-r-pill);
  color: var(--ag-lait); text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ag-lait) 32%, transparent);
  font-family: var(--f-display); font-weight: 760; font-variation-settings: "wdth" 118, "wght" 760;
  font-size: 12px; letter-spacing: .03em; text-transform: uppercase;
  transition: color var(--ag-t-court), box-shadow var(--ag-t-court);
}
.login-signup a:hover { color: var(--ag-poudre); box-shadow: inset 0 0 0 1.5px var(--ag-poudre); }
#otpPanel .login-signup { justify-content: center; padding: 0; box-shadow: none; }

/* ---------- Étape code à 6 chiffres ---------- */
.agl-otp-intro { margin: 0 0 26px; font: 400 15px/1.5 var(--f-body); color: var(--ag-voile); }
.agl-otp-intro strong { color: var(--ag-lait); font-weight: 600; }
.login-otp { position: relative; }
.login-otp__input {
  position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; padding: 0;
  border: 0; background: transparent; color: transparent; caret-color: transparent; opacity: 0; font-size: 16px;
}
.login-otp__boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.login-otp__box {
  display: grid; place-items: center; height: 64px; border-radius: var(--ag-r-s);
  border: 1px solid var(--ag-filet-fort); background: var(--ag-creux); color: var(--ag-lait);
  font-family: var(--f-display); font-weight: 900; font-variation-settings: "wdth" 150, "wght" 900; font-size: 26px;
  transition: border-color var(--ag-t-court), box-shadow var(--ag-t-temps) var(--ag-e);
}
.login-otp__box.is-active { border-color: var(--ag-lueur); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ag-lueur) 16%, transparent); }
.login-otp__box.is-filled { border-color: color-mix(in srgb, var(--ag-lait) 40%, transparent); }
.login-otp.is-invalid .login-otp__box { border-color: var(--ag-signature); }
.login-error { margin: 0; font: 400 13px/1.4 var(--f-body); color: var(--ag-lait); }
.login-error::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--ag-signature); vertical-align: 1px; }
.agl-otp-links { margin: 18px 0 0; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .agl-shell { grid-template-columns: minmax(0, 1fr); max-width: 560px; gap: 36px; }
  .agl-panel { min-height: 0; padding: 32px 28px; gap: 36px; }
}
@media (max-width: 560px) {
  .agl-top { padding-top: max(16px, env(safe-area-inset-top)); }
  .agl-logo { height: 20px; }
  .login-lang__btn { min-width: 34px; padding: 7px 8px; }
  .agl-shell { padding-top: 20px; gap: 28px; }
  .agl-panel { padding: 24px 22px 26px; gap: 28px; border-radius: var(--ag-r-m); }
  .login-brand__desc { font-size: 14.5px; margin-top: 14px; }
  .login-glass__title { font-size: 32px; }
  .login-glass__lead { margin-bottom: 24px; }
  .login-signup { border-radius: var(--ag-r-m); padding: 16px; }
  .login-otp__box { height: 54px; font-size: 22px; }
}

/* Inscription (register.html) : logo cliquable, titre de carte sur deux lignes au besoin */
.agl-logo-link { display: inline-flex; }
.login-glass__title { text-wrap: balance; }

/* ---------- Maquette du backoffice dans le panneau (décor, sans chiffres) ---------- */
.agl-mock { position: relative; flex: 1 1 auto; display: grid; place-items: center; min-height: 0; padding: 8px 6px 28px; }
.agl-mock__win {
  width: min(100%, 420px); padding: 16px; border-radius: var(--ag-r-m);
  background: color-mix(in srgb, var(--ag-salon) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px var(--ag-filet-fort), 0 40px 80px -36px #000, 0 30px 70px -40px color-mix(in srgb, var(--ag-halo) 45%, transparent);
  transform: perspective(1400px) rotateX(8deg) rotateY(-10deg) rotateZ(1.5deg);
}
.agl-mock__bar { display: flex; align-items: center; gap: 8px; padding: 0 2px 14px; margin-bottom: 14px; border-bottom: 1px solid var(--ag-filet); }
.agl-mock__bar i { width: 6px; height: 6px; border-radius: 50%; background: var(--ag-lueur); box-shadow: 0 0 10px var(--ag-lueur); }
.agl-mock__bar span { flex: 1; font: 400 9.5px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ag-lait); }
.agl-mock__bar b { width: 34px; height: 8px; border-radius: var(--ag-r-pill); background: var(--ag-filet); }
.agl-mock__tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.agl-mock__tile { display: flex; flex-direction: column; gap: 8px; padding: 12px 10px 8px; border-radius: var(--ag-r-s); background: var(--ag-creux); box-shadow: inset 0 0 0 1px var(--ag-filet); color: var(--ag-lueur); }
.agl-mock__tile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 8.5px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ag-voile); }
.agl-mock__tile em { width: 62%; height: 10px; border-radius: var(--ag-r-pill); background: color-mix(in srgb, var(--ag-lait) 72%, transparent); }
.agl-mock__tile svg { width: 100%; height: 26px; }
.agl-mock__plan { margin-top: 8px; padding: 12px; border-radius: var(--ag-r-s); background: var(--ag-creux); box-shadow: inset 0 0 0 1px var(--ag-filet); }
.agl-mock__label { display: block; margin-bottom: 10px; font: 400 8.5px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ag-voile); }
.agl-mock__stage { height: 8px; width: 46%; margin: 0 auto 12px; border-radius: var(--ag-r-pill); background: var(--ag-g-satin); opacity: .8; }
.agl-mock__tables { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 12px; padding: 0 6px; }
.agl-mock__tables i { aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ag-filet-fort); }
.agl-mock__tables i.on { background: color-mix(in srgb, var(--ag-lueur) 26%, transparent); box-shadow: inset 0 0 0 1.5px var(--ag-lueur), 0 0 14px -2px color-mix(in srgb, var(--ag-lueur) 60%, transparent); }
.agl-mock__toast {
  position: absolute; right: 0; bottom: 12px; display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 14px 10px 12px; border-radius: var(--ag-r-pill);
  background: var(--ag-salon-haut); box-shadow: inset 0 0 0 1px var(--ag-filet-fort), 0 20px 40px -18px #000;
  font: 500 12.5px/1 var(--f-body); color: var(--ag-lait);
}
.agl-mock__toast i { width: 7px; height: 7px; border-radius: 50%; background: var(--ag-valide); box-shadow: 0 0 10px var(--ag-valide); }
.agl-mock__toast em { width: 36px; height: 7px; border-radius: var(--ag-r-pill); background: var(--ag-filet-fort); }
@media (prefers-reduced-motion: no-preference) {
  .agl-mock__win { animation: aglFloat 9s cubic-bezier(.45, 0, .55, 1) infinite; }
  .agl-mock__toast { animation: aglToast 9s var(--ag-e) infinite; }
}
@keyframes aglFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes aglToast { 0%, 12% { opacity: 0; translate: 0 10px; } 20%, 80% { opacity: 1; translate: 0 0; } 90%, 100% { opacity: 0; translate: 0 6px; } }
@media (max-width: 980px) { .agl-mock { display: none; } }
/* Plan compact : petites tables rondes */
.agl-mock__tables { grid-template-columns: repeat(6, 18px); justify-content: space-between; gap: 9px 0; padding: 0 10px; }
.agl-mock__tables i { width: 18px; height: 18px; }
.agl-mock__win { width: min(100%, 380px); }
.agl-mock { padding: 0 6px 18px; }
.agl-panel { gap: 28px; }

/* Aperçu : vraie capture de l'accueil (assets/images/login/bo-apercu-accueil.jpg) dans la fenêtre inclinée */
.agl-mock__win--shot { margin: 0; width: min(100%, 560px) !important; padding: 0 !important; overflow: hidden; background: var(--ag-salon) !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
.agl-mock__win--shot img { display: block; width: 100%; height: auto; aspect-ratio: 1440 / 910; }
.agl-mock__win--shot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px var(--ag-filet-fort); }
.agl-mock__win--shot { position: relative; }
.agl-mock__toast { right: -6px; }

