/* ==========================================================================
   Brainrot Fortnite — page d'authentification (/login)
   Refonte fidele a artifacts/auth-reference/maquette-login.webp
   Toutes les regles sont scopees sous .auth-page : aucun impact sur le reste
   du site (forum, wiki, marketplace, newsfeed, profil...).
   ========================================================================== */

.auth-page {
  --auth-night: #081228;
  --auth-night-soft: #0b1730;
  --auth-card-bg: rgba(8, 18, 40, .88);
  --auth-card-border: rgba(96, 150, 255, .34);
  --auth-card-glow: rgba(64, 132, 255, .30);
  --auth-input-bg: rgba(13, 26, 54, .92);
  --auth-input-border: rgba(53, 76, 130, .85);
  --auth-input-border-hover: rgba(90, 124, 196, .95);
  --auth-focus: #6ea8ff;
  --auth-focus-ring: rgba(110, 168, 255, .22);
  --auth-danger: #ff6b7d;
  --auth-danger-bg: rgba(120, 22, 38, .38);
  --auth-success: #4ade80;
  --auth-success-bg: rgba(18, 88, 56, .38);
  --auth-info-bg: rgba(31, 60, 132, .38);
  --auth-text: #ffffff;
  --auth-text-soft: #c3d1f0;
  --auth-text-dim: #93a3c6;
  --auth-link: #a7a9ff;
  --auth-grad: linear-gradient(90deg, #52f0a2 0%, #5982e6 52%, #936cfd 100%);
  --auth-discord: #6466e7;
  --auth-epic: #101725;
  --auth-radius: 14px;
  /* Ratios releves sur la maquette : carte 488/1672, marge droite 39/1672,
     logo 380/1672, switch 470/1672, bandeau 600/1672. */
  --auth-card-w: clamp(320px, 29.2vw, 488px);
  --auth-gutter: clamp(16px, 2.33vw, 39px);
  --auth-font: "Baloo 2", "Rajdhani", system-ui, -apple-system, "Segoe UI", sans-serif;
  --auth-arrow: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h13M12 5l7 7-7 7"/></svg>');

  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--auth-night);
  color: var(--auth-text);
  font-family: var(--auth-font);
  -webkit-font-smoothing: antialiased;
}

.auth-page *,
.auth-page *::before,
.auth-page *::after { box-sizing: border-box; }

.auth-page a { text-decoration: none; color: inherit; }

/* Le switcher flottant global i18n est remplace par les pastilles de la maquette. */
.auth-page #i18n-switch { display: none !important; }

/* --------------------------------------------------------------- Ossature */

.auth-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Scene Brainrot : image plein cadre calee a gauche + prolongement nuit a droite,
   exactement comme la maquette ou la carte flotte au-dessus du decor. */
.auth-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--auth-night);
  pointer-events: none;
}

.auth-scene__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  display: block;
}

/* Fondu de la scene vers la nuit sous la carte : relie visuellement les deux moities. */
.auth-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0%, transparent 56%, rgba(6, 14, 34, .22) 70%, rgba(6, 14, 34, .40) 84%, rgba(6, 14, 34, .48) 100%),
    linear-gradient(180deg, rgba(4, 9, 24, .72) 0%, rgba(4, 9, 24, .12) 16%, transparent 34%);
}

/* ------------------------------------------------------------ Barre haute */

.auth-topbar {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 88px;
  padding: 0 clamp(18px, 2.9vw, 48px);
  display: flex;
  align-items: center;
  gap: clamp(16px, 4.6vw, 78px);
}

.auth-topbar__logo { flex: 0 0 auto; display: block; }
.auth-topbar__logo img { display: block; width: clamp(96px, 7.9vw, 132px); height: auto; }

/* Pastilles de langue (maquette : 3 pilules, active cerclee de vert) */
.auth-langs {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-lang {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 45px;
  padding: 0 17px;
  border-radius: 13px;
  border: 1px solid rgba(96, 126, 190, .38);
  background: rgba(10, 20, 44, .86);
  color: #fff;
  font-family: var(--auth-font);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.auth-lang__flag {
  width: 24px;
  height: 17px;
  border-radius: 3px;
  display: block;
  flex: none;
}

.auth-lang:hover { border-color: rgba(140, 170, 235, .6); }

.auth-lang[aria-pressed="true"] {
  border-color: #55e08a;
  box-shadow: 0 0 0 1px rgba(85, 224, 138, .5), 0 0 18px rgba(85, 224, 138, .28);
}

.auth-lang:focus-visible {
  outline: 2px solid var(--auth-focus);
  outline-offset: 2px;
}

/* ------------------------------------------------------------- Corps 70/30 */

.auth-body {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: stretch;
  padding: 0 var(--auth-gutter) clamp(18px, 2.4vw, 32px);
  gap: clamp(14px, 1.6vw, 26px);
  margin-top: -88px;
  padding-top: 88px;
}

.auth-hero {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  /* La maquette place le bloc dans le tiers haut, pas au centre vertical. */
  padding-top: clamp(4px, 1vh, 14px);
  text-align: center;
}

.auth-aside {
  flex: 0 0 var(--auth-card-w);
  max-width: var(--auth-card-w);
  display: flex;
  align-items: center;
}

/* -------------------------------------------------------------- Colonne gauche */

.auth-hero__inner {
  width: min(600px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-hero__pretitle {
  margin: 0;
  color: #fff;
  font-size: clamp(.95rem, 1.2vw, 1.25rem);
  font-weight: 700;
  letter-spacing: .34em;
  text-transform: uppercase;
  text-shadow: 0 2px 14px rgba(3, 8, 24, .7);
}

.auth-hero__logo {
  display: block;
  width: clamp(210px, 23vw, 380px);
  height: auto;
  aspect-ratio: 900 / 600;
  margin: clamp(0px, .4vh, 6px) auto 0;
  filter: drop-shadow(0 18px 38px rgba(4, 10, 28, .5));
}

.auth-hero__title {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.auth-hero__tagline {
  margin: clamp(10px, 1.9vh, 22px) 0 0;
  color: #fff;
  font-size: clamp(.95rem, 1.08vw, 1.09rem);
  font-weight: 700;
  letter-spacing: .015em;
  text-transform: uppercase;
  text-shadow: 0 2px 14px rgba(3, 8, 24, .72);
}

.auth-hero__lead {
  max-width: 480px;
  margin: clamp(8px, 1.3vh, 14px) auto 0;
  color: #dfe8ff;
  font-size: clamp(.9rem, 1vw, 1rem);
  font-weight: 500;
  line-height: 1.42;
  text-shadow: 0 2px 12px rgba(3, 8, 24, .72);
}

/* Switch Connexion / Inscription (pilule claire, segment actif noir) */
.auth-switch {
  width: clamp(290px, 28vw, 470px);
  height: 46px;
  margin: clamp(12px, 2vh, 24px) auto 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .34);
  background: rgba(219, 233, 255, .52);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  box-shadow: 0 10px 28px rgba(4, 10, 28, .28);
  overflow: hidden;
}

.auth-switch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  height: 100%;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #0b1430;
  font-family: var(--auth-font);
  font-size: 1.02rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .22s ease, color .22s ease;
}

.auth-switch__btn svg { width: 20px; height: 20px; flex: none; }

.auth-switch__btn[aria-selected="true"] {
  background: #05070f;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18) inset;
}

.auth-switch__btn:focus-visible {
  outline: 2px solid var(--auth-focus);
  outline-offset: -3px;
}

.auth-switch__btn.is-disabled { opacity: .45; pointer-events: none; }

/* Bandeau de decouverte (3 acces reels) */
.auth-discover {
  width: clamp(320px, 41vw, 640px);
  list-style: none;
  margin: clamp(8px, 1.3vh, 16px) auto 0;
  padding: 9px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  border-radius: 16px;
  border: 1px solid rgba(150, 178, 235, .26);
  background: rgba(9, 17, 38, .62);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.auth-discover__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px 7px;
  border-radius: 11px;
  text-align: left;
  transition: background-color .16s ease;
}

.auth-discover__item svg { width: 22px; height: 22px; flex: none; color: #fff; }
.auth-discover__item > span { min-width: 0; }
.auth-discover__label { display: block; color: #fff; font-size: .86rem; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.auth-discover__hint {
  display: block;
  color: #bfcdec;
  font-size: .67rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Liens legaux discrets : pied de la colonne gauche en desktop. */
.auth-legal {
  position: absolute;
  left: 0;
  bottom: 14px;
  z-index: 2;
  width: 68.5%;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px 15px;
}

.auth-legal a {
  color: rgba(214, 226, 252, .62);
  font-size: .72rem;
  font-weight: 600;
  text-shadow: 0 1px 6px rgba(3, 8, 24, .85);
  transition: color .16s ease;
}

.auth-legal a:hover { color: #fff; }
.auth-legal a:focus-visible { outline: 2px solid var(--auth-focus); outline-offset: 2px; color: #fff; }

/* -------------------------------------------------------------- Carte droite */

.auth-card {
  width: 100%;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 40px 46px 34px;
  border-radius: 22px;
  border: 1px solid var(--auth-card-border);
  background: var(--auth-card-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 0 0 1px rgba(120, 170, 255, .08),
    0 0 40px var(--auth-card-glow),
    0 28px 70px rgba(2, 6, 20, .6);
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 160, 240, .45) transparent;
}

.auth-card::-webkit-scrollbar { width: 8px; }
.auth-card::-webkit-scrollbar-thumb { background: rgba(120, 160, 240, .4); border-radius: 8px; }

.auth-card[hidden] { display: none !important; }

.auth-card__crown {
  display: block;
  width: 30px;
  height: 30px;
  margin: 0 auto;
  color: var(--auth-success);
}

.auth-card__title {
  margin: 12px 0 0;
  color: #fff;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.16;
  text-align: center;
  letter-spacing: -.005em;
}

.auth-card__subtitle {
  margin: 6px 0 0;
  color: var(--auth-text-soft);
  font-size: .92rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}

/* Champs */

.auth-form { margin-top: 26px; }
.auth-field + .auth-field,
.auth-form > * + .auth-field { margin-top: 14px; }

.auth-field__label {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.auth-field__control {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-field__icon {
  position: absolute;
  left: 18px;
  width: 20px;
  height: 20px;
  color: #93a7d3;
  pointer-events: none;
}

.auth-page .auth-field__input {
  width: 100%;
  height: 56px;
  padding: 0 18px 0 50px;
  border-radius: var(--auth-radius);
  border: 1px solid var(--auth-input-border);
  background: var(--auth-input-bg);
  color: #fff;
  font-family: var(--auth-font);
  font-size: 1rem;
  font-weight: 600;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.auth-page .auth-field__input::placeholder { color: #8d9dc0; font-weight: 500; }
.auth-page .auth-field__input:hover { border-color: var(--auth-input-border-hover); }

.auth-page .auth-field__input:focus,
.auth-page .auth-field__input:focus-visible {
  outline: none;
  border-color: var(--auth-focus);
  box-shadow: 0 0 0 3px var(--auth-focus-ring);
}

.auth-field.has-error .auth-field__input {
  border-color: var(--auth-danger);
  box-shadow: 0 0 0 3px rgba(255, 107, 125, .16);
}

.auth-field.has-error .auth-field__icon { color: var(--auth-danger); }

.auth-field__error {
  display: none;
  margin: 6px 0 0 4px;
  color: #ffb3bd;
  font-size: .78rem;
  font-weight: 600;
}

.auth-field.has-error .auth-field__error { display: block; }

.auth-field--plain .auth-page .auth-field__input,
.auth-field--plain .auth-field__input { padding-left: 18px; }

/* Bouton oeil */
.auth-reveal {
  position: absolute;
  right: 10px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #93a7d3;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease;
}

.auth-reveal:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.auth-reveal:focus-visible { outline: 2px solid var(--auth-focus); outline-offset: 1px; color: #fff; }
.auth-reveal svg { width: 20px; height: 20px; }
.auth-reveal .auth-reveal__off { display: none; }
.auth-reveal[aria-pressed="true"] .auth-reveal__on { display: none; }
.auth-reveal[aria-pressed="true"] .auth-reveal__off { display: block; }

.auth-field--password .auth-field__input { padding-right: 56px; }

/* Jauge de robustesse */
.auth-strength { margin: 8px 2px 0; display: none; }
.auth-strength.is-visible { display: block; }
.auth-strength__track {
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}
.auth-strength__bar {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: var(--auth-danger);
  transition: width .2s ease, background-color .2s ease;
}
.auth-strength[data-level="1"] .auth-strength__bar { width: 33%; background: #ff8b5e; }
.auth-strength[data-level="2"] .auth-strength__bar { width: 66%; background: #f2c94c; }
.auth-strength[data-level="3"] .auth-strength__bar { width: 100%; background: var(--auth-success); }
.auth-strength__text { margin-top: 5px; color: var(--auth-text-dim); font-size: .74rem; font-weight: 600; }

/* Ligne « se souvenir / mot de passe oublie » */
.auth-inline {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  color: var(--auth-text);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.35;
}

.auth-check { position: relative; }

/* L'input reste au-dessus de la case dessinee : c'est lui qui recoit le clic
   et le focus, la case n'etant qu'un rendu. Sans cela, le SVG interceptait
   les evenements de pointeur. */
.auth-check input {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  opacity: 0;
  width: 22px;
  height: 22px;
  margin: 0;
  cursor: pointer;
}

.auth-check__box svg { pointer-events: none; }

.auth-check__box {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid rgba(110, 140, 200, .7);
  background: rgba(10, 20, 44, .9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .16s ease, border-color .16s ease;
}

.auth-check__box svg { width: 14px; height: 14px; color: #06210f; opacity: 0; }
.auth-check input:checked + .auth-check__box { background: #22d37a; border-color: #22d37a; }
.auth-check input:checked + .auth-check__box svg { opacity: 1; }
.auth-check input:focus-visible + .auth-check__box { outline: 2px solid var(--auth-focus); outline-offset: 2px; }

.auth-link {
  color: var(--auth-link);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.auth-link:hover { color: #fff; }
.auth-link:focus-visible { outline: 2px solid var(--auth-focus); outline-offset: 3px; border-radius: 4px; }
.auth-link.is-disabled { opacity: .45; pointer-events: none; }

/* Bouton principal */
.auth-page .auth-submit {
  width: 100%;
  height: 59px;
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: var(--auth-radius);
  background: var(--auth-grad);
  color: #07142a;
  font-family: var(--auth-font);
  font-size: 1.12rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(76, 122, 226, .26);
  transition: filter .16s ease, transform .16s ease, box-shadow .16s ease;
}

/* La fleche est un pseudo-element : auth.js remplace le textContent du bouton
   pendant le chargement, un <svg> enfant serait donc detruit. */
.auth-page .auth-submit::before {
  content: "";
  width: 20px;
  height: 20px;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--auth-arrow) center / contain no-repeat;
  mask: var(--auth-arrow) center / contain no-repeat;
}

.auth-page .auth-submit:disabled::before { opacity: .7; }
.auth-page .auth-submit:hover { filter: brightness(1.06); transform: translateY(-1px); }
.auth-page .auth-submit:active { transform: translateY(0); }
.auth-page .auth-submit:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.auth-page .auth-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; filter: none; }

/* Separateur + fournisseurs */
.auth-sep {
  margin: 24px 0 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--auth-text-soft);
  font-size: .9rem;
  font-weight: 600;
}

.auth-sep::before,
.auth-sep::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(140, 165, 215, .32);
}

.auth-providers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.auth-providers:has(.auth-provider:only-child) { grid-template-columns: 1fr; }

.auth-provider {
  height: 63px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: var(--auth-radius);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, filter .16s ease;
}

.auth-provider svg { width: 26px; height: 26px; flex: none; }
.auth-provider:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, .32); }
.auth-provider:focus-visible { outline: 2px solid var(--auth-focus); outline-offset: 3px; }
.auth-provider.is-disabled { opacity: .45; pointer-events: none; }

.auth-provider--epic { background: linear-gradient(180deg, #16203a, #0b1020); }
.auth-provider--epic:hover { box-shadow: 0 10px 22px rgba(0, 0, 0, .4); }
.auth-provider--discord { background: linear-gradient(180deg, #7b7cf2, var(--auth-discord)); border-color: rgba(190, 196, 255, .34); }
.auth-provider--discord:hover { box-shadow: 0 10px 22px rgba(84, 96, 226, .38); }

/* Bas de carte */
.auth-card__foot {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--auth-text-soft);
  font-size: .86rem;
  font-weight: 500;
  white-space: nowrap;
}

.auth-card__foot-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 2px 4px;
  border-radius: 6px;
  color: var(--auth-success);
  font-family: var(--auth-font);
  font-size: .9rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.auth-card__foot-action svg { width: 17px; height: 17px; }
.auth-card__foot-action:hover { color: #86f5ae; }
.auth-card__foot-action:focus-visible { outline: 2px solid var(--auth-focus); outline-offset: 2px; }

/* Messages */
.auth-feedback {
  display: none;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.5;
}

.auth-feedback.is-visible { display: block; }
.auth-feedback.is-error { color: #ffd9de; background: var(--auth-danger-bg); border-color: rgba(255, 107, 125, .5); }
.auth-feedback.is-success { color: #d6fbe5; background: var(--auth-success-bg); border-color: rgba(74, 222, 128, .5); }
.auth-feedback.is-info { color: #dbe6ff; background: var(--auth-info-bg); border-color: rgba(110, 168, 255, .5); }

.auth-resend-email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.auth-resend-email__text { flex: 1 1 auto; min-width: 0; display: flex; align-items: flex-start; gap: 10px; }

.auth-resend-email__icon {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
}

.auth-page button.auth-resend-email__button {
  flex: none;
  width: auto;
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 9px;
  background: var(--auth-success);
  color: #06210f;
  font-family: var(--auth-font);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
}

.auth-page button.auth-resend-email__button:hover { filter: brightness(1.08); }
.auth-page button.auth-resend-email__button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.auth-page button.auth-resend-email__button:disabled { opacity: .6; cursor: not-allowed; }

/* Panneau mot de passe oublie (dans la carte, meme DA) */
.auth-forgot[hidden] { display: none !important; }

.auth-forgot__back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  border: 0;
  background: transparent;
  padding: 2px 4px;
  border-radius: 6px;
  color: var(--auth-link);
  font-family: var(--auth-font);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
}

.auth-forgot__back svg { width: 16px; height: 16px; }
.auth-forgot__back:hover { color: #fff; }
.auth-forgot__back:focus-visible { outline: 2px solid var(--auth-focus); outline-offset: 2px; }
.auth-forgot__back.is-disabled { opacity: .45; pointer-events: none; }

/* Etats desactives (site_control) */
.auth-card.is-disabled { opacity: .82; }
.auth-form.is-disabled { opacity: .82; }

/* Notes secondaires */
.auth-note { margin: 6px 0 0 2px; color: var(--auth-text-dim); font-size: .74rem; font-weight: 500; line-height: 1.45; }
.auth-card__legal { margin-top: 14px; color: var(--auth-text-dim); font-size: .76rem; font-weight: 500; line-height: 1.5; }
.auth-card__legal a { color: var(--auth-link); text-decoration: underline; text-underline-offset: 2px; }
.auth-check--legal { align-items: flex-start; }
.auth-check--legal .auth-check__box { margin-top: 1px; }
.auth-check--legal span:last-child { font-weight: 500; font-size: .82rem; }
.auth-check--legal a { color: var(--auth-link); text-decoration: underline; text-underline-offset: 2px; }

/* Transition entre panneaux (legere) */
.auth-panel-in { animation: auth-panel-in .3s cubic-bezier(.22, 1, .36, 1); }

@keyframes auth-panel-in {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------- Responsive */

/* Ecrans courts : on resserre sans casser la composition */
@media (max-height: 820px) {
  .auth-card { padding: 26px 40px 24px; }
  .auth-card__title { font-size: 1.62rem; }
  .auth-page .auth-field__input { height: 52px; }
  .auth-page .auth-submit { height: 54px; margin-top: 15px; }
  .auth-provider { height: 56px; }
  .auth-hero__logo { width: clamp(200px, 20vw, 320px); }
}

/* Laptop 1366 / 1280 */
@media (max-width: 1400px) {
  .auth-card { padding: 28px 36px 26px; }
}

@media (max-width: 1180px) {
}

/* Tablette : l'illustration recule, le formulaire prime */
@media (max-width: 1024px) {
  .auth-body { flex-direction: column; align-items: center; gap: 22px; padding-bottom: 32px; }
  .auth-scene__img { height: 46%; object-position: center 34%; }
  .auth-scene::after {
    background:
      linear-gradient(180deg, rgba(4, 9, 24, .62) 0%, rgba(4, 9, 24, .05) 14%, rgba(8, 18, 40, .45) 36%, var(--auth-night) 50%);
  }
  .auth-hero { flex: 0 0 auto; width: 100%; padding-top: 0; }
  .auth-hero__pretitle { font-size: .82rem; letter-spacing: .3em; }
  .auth-hero__logo { width: min(240px, 52%); }
  .auth-hero__tagline { font-size: .86rem; margin-top: 8px; }
  .auth-hero__lead { display: none; }
  .auth-switch { width: min(440px, 100%); height: 44px; margin-top: 12px; }
  .auth-discover { width: min(560px, 100%); margin-top: 10px; }
  .auth-aside { flex: 0 0 auto; width: 100%; max-width: 520px; align-items: flex-start; }
  .auth-card { max-height: none; }

  .auth-legal {
    position: static;
    width: 100%;
    margin: 6px auto 0;
    padding: 0 16px 22px;
  }
}

/* Mobile : petite illustration + logo, puis formulaire tout de suite */
@media (max-width: 720px) {
  .auth-shell { display: block; min-height: 100dvh; }
  .auth-scene { position: absolute; inset: 0; }
  .auth-scene__img { height: 232px; object-position: center 42%; }
  .auth-scene::after {
    background: linear-gradient(180deg, rgba(4, 9, 24, .58) 0%, rgba(4, 9, 24, .06) 18%, rgba(8, 18, 40, .72) 62%, var(--auth-night) 232px);
  }

  .auth-topbar { height: 64px; padding: 0 16px; gap: 10px; }
  .auth-topbar__logo img { width: 96px; }
  .auth-langs { gap: 7px; }
  .auth-lang { height: 36px; padding: 0 11px; gap: 7px; font-size: .84rem; border-radius: 11px; }
  .auth-lang__flag { width: 20px; height: 14px; }

  .auth-body { flex-direction: column; margin-top: -64px; padding: 64px 16px 28px; gap: 16px; }
  .auth-hero { padding-top: 6px; }
  .auth-hero__pretitle { font-size: .72rem; letter-spacing: .28em; }
  .auth-hero__logo { width: min(240px, 70%); margin-top: 2px; }
  .auth-discover { display: none; }
  .auth-hero__tagline { font-size: .8rem; margin-top: 8px; }
  .auth-hero__lead { display: none; }
  .auth-switch { width: 100%; height: 44px; margin-top: 14px; }
  .auth-switch__btn { font-size: .95rem; gap: 8px; }
  .auth-discover { display: none; }

  .auth-aside { flex: 0 0 auto; width: 100%; max-width: none; }
  .auth-card { padding: 22px 18px 20px; border-radius: 18px; }
  .auth-card__title { font-size: 1.42rem; }
  .auth-card__subtitle { font-size: .85rem; }
  .auth-page .auth-field__input { height: 52px; font-size: 1rem; }
  .auth-page .auth-submit { height: 54px; font-size: 1.04rem; }
  .auth-providers { grid-template-columns: 1fr; gap: 10px; }
  .auth-provider { height: 52px; }
  .auth-inline { flex-wrap: wrap; gap: 10px; }
  .auth-legal { margin-top: 4px; padding: 0 16px 20px; gap: 2px 12px; }
}

@media (max-width: 380px) {
  .auth-card { padding: 20px 14px 18px; }
  .auth-card__title { font-size: 1.3rem; }
  .auth-topbar__logo img { width: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page *,
  .auth-page *::before,
  .auth-page *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* Bascule titre/sous-titre en mode « mot de passe oublie » (classe posee par auth.js) */
.auth-login-box .auth-title-forgot,
.auth-login-box .auth-subtitle-forgot { display: none; }
.auth-login-box.is-forgot-mode .auth-title-default,
.auth-login-box.is-forgot-mode .auth-subtitle-default,
.auth-login-box.is-forgot-mode .auth-login-extras { display: none; }
.auth-login-box.is-forgot-mode .auth-title-forgot,
.auth-login-box.is-forgot-mode .auth-subtitle-forgot { display: inline; }

/* ---------------------------------------------------------------------------
   Variante « page isolee » : nouveau mot de passe, confirmation d'email...
   Une seule carte, centree sur la meme scene que /login.
   --------------------------------------------------------------------------- */

.auth-body--centered {
  justify-content: center;
  align-items: center;
}

.auth-aside--centered {
  flex: 0 0 auto;
  width: min(488px, 100%);
  max-width: min(488px, 100%);
  justify-content: center;
}

.auth-page--standalone .auth-scene::after {
  background:
    linear-gradient(90deg, rgba(6, 14, 34, .34) 0%, rgba(6, 14, 34, .52) 50%, rgba(6, 14, 34, .34) 100%),
    linear-gradient(180deg, rgba(4, 9, 24, .72) 0%, rgba(4, 9, 24, .16) 18%, rgba(4, 9, 24, .38) 100%);
}

.auth-page--standalone .auth-card__foot-action { color: var(--auth-link); }
.auth-page--standalone .auth-card__foot-action:hover { color: #fff; }

@media (max-width: 720px) {
  .auth-aside--centered { width: 100%; max-width: none; }
  .auth-page--standalone .auth-scene__img { height: 190px; }
}

/* Filet de securite : rien ne doit provoquer de defilement horizontal. */
.auth-page { overflow-x: hidden; }
.auth-shell,
.auth-body,
.auth-hero,
.auth-aside { max-width: 100%; }

/* ---------------------------------------------------------------------------
   Carte d'inscription : plus de champs que la connexion. On resserre le rythme
   pour qu'elle tienne dans un ecran 1440x900 sans defilement interne, tout en
   gardant exactement la meme direction artistique.
   --------------------------------------------------------------------------- */

.auth-register-box { padding: 26px 40px 22px; }
.auth-register-box .auth-card__title { font-size: 1.62rem; }
.auth-register-box .auth-form { margin-top: 18px; }
.auth-register-box .auth-field + .auth-field { margin-top: 11px; }
.auth-page .auth-register-box .auth-field__input { height: 50px; }
.auth-page .auth-register-box .auth-submit { height: 54px; margin-top: 14px; }
.auth-register-box .auth-note { font-size: .7rem; line-height: 1.35; }
.auth-register-box .auth-check--legal span:last-child { font-size: .76rem; line-height: 1.4; }
.auth-register-box .auth-card__legal { margin-top: 10px; font-size: .72rem; }
.auth-register-box .auth-card__foot { margin-top: 12px; }
.auth-register-box .auth-strength { margin-top: 6px; }

@media (max-height: 940px) {
  .auth-register-box { padding: 20px 36px 18px; }
  .auth-register-box .auth-card__title { font-size: 1.45rem; }
  .auth-register-box .auth-card__subtitle { font-size: .85rem; }
  .auth-register-box .auth-form { margin-top: 14px; }
  .auth-register-box .auth-field + .auth-field { margin-top: 9px; }
  .auth-page .auth-register-box .auth-field__input { height: 47px; }
  .auth-page .auth-register-box .auth-submit { height: 50px; margin-top: 12px; }
  .auth-register-box .auth-card__subtitle { display: none; }
  /* Le rappel « email de confirmation » reste affiche apres l'envoi du
     formulaire (message de succes) : on peut le retirer de la carte serree. */
  .auth-register-box .auth-card__legal { display: none; }
  .auth-register-box .auth-card__foot { margin-top: 8px; }
}

@media (max-width: 720px) {
  .auth-register-box { padding: 22px 18px 20px; }
  .auth-page .auth-register-box .auth-field__input { height: 50px; }
}

/* ---------------------------------------------------------------------------
   Vue « verifie ta boite mail » : meme carte, apres une inscription reussie.
   --------------------------------------------------------------------------- */

.auth-verify-box[hidden] { display: none !important; }
.auth-verify-box .auth-card__crown { color: var(--auth-focus); }
.auth-verify__email { display: block; margin-top: 4px; color: #fff; font-weight: 700; word-break: break-all; }

.auth-verify__hint {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(110, 168, 255, .22);
  background: rgba(20, 34, 68, .55);
  color: var(--auth-text-soft);
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.auth-verify-box .auth-submit { margin-top: 16px; }
.auth-verify-box .auth-card__legal { text-align: center; }

/* ---------------------------------------------------------------------------
   Carte d'etat (confirmation d'email : reussite, lien deja utilise, erreur).
   --------------------------------------------------------------------------- */

.auth-status-card { text-align: center; }

.auth-status-card__icon {
  width: 58px;
  height: 58px;
  margin: 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(74, 222, 128, .38);
  background: rgba(22, 88, 56, .34);
  color: var(--auth-success);
}

.auth-status-card__icon svg { width: 28px; height: 28px; stroke-width: 2.4; }

.auth-status-card.is-error .auth-status-card__icon {
  border-color: rgba(255, 107, 125, .42);
  background: rgba(120, 22, 38, .34);
  color: var(--auth-danger);
}

.auth-status-card__eyebrow {
  margin: 14px 0 0;
  color: var(--auth-text-dim);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.auth-status-card .auth-card__title { margin-top: 6px; }
.auth-status-card .auth-verify__hint { margin-top: 16px; }
.auth-status-card .auth-submit { text-decoration: none; }
