/* WE GO CLUB / AUTHENTICATION V2
   Animation signature assumée : sceau bleu, orbites et transition plein écran.
   Strictement présentation. Aucune modification des flux d'authentification. */

.auth-shell {
  --auth-primary: var(--color-primary, #276EC7);
  --auth-deep: #082D59;
  --auth-ease: cubic-bezier(.19, 1, .22, 1);
  background: #F4F8FD;
}
.auth-shell .auth-story {
  background:
    radial-gradient(ellipse at 90% 75%, rgba(74,195,249,.35) 0%, transparent 44%),
    linear-gradient(145deg, #071D43 0%, #11477C 55%, #116EAE 100%);
}
.auth-shell .auth-story::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: min(75vw, 510px);
  height: min(75vw, 510px);
  left: -34%;
  top: 16%;
  border-radius: 50%;
  border: 1px solid rgba(235,248,255,.17);
  box-shadow: 0 0 0 56px rgba(255,255,255,.025), 0 0 0 112px rgba(99,208,255,.035);
  transform: rotate(-18deg);
  animation: wg-auth-orbit-arrive 1.3s var(--auth-ease) both;
  pointer-events: none;
}
.auth-shell .auth-story::after {
  animation: wg-auth-side-orbit 13s ease-in-out infinite alternate;
}
.auth-shell .auth-story-brand {
  animation: wg-auth-rise 700ms 0ms var(--auth-ease) both;
}
.auth-shell .auth-story-content {
  animation: wg-auth-rise 830ms 25ms var(--auth-ease) both;
}
.auth-shell .auth-story-content h2 {
  max-width: 11ch;
  font-size: clamp(36px, 3.9vw, 60px);
  letter-spacing: -.04em;
}
.auth-shell .auth-story-content h2 span {
  color: #B8E9FF;
}
.auth-shell .auth-story-content p {
  max-width: 35ch;
  font-size: 15px;
  line-height: 1.8;
}
.auth-shell .auth-main {
  gap: 22px;
}
.auth-shell .auth-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #DFE9F5;
  border-radius: 23px;
  background: #fff;
  box-shadow: 0 28px 72px rgba(14, 47, 83, .12), 0 4px 9px rgba(14, 47, 83, .03);
  animation: wg-auth-card-appear 690ms 0ms var(--auth-ease) both;
}
.auth-shell .auth-card::before {
  content: '';
  position: absolute;
  height: 4px;
  inset: 0 0 auto;
  background: linear-gradient(90deg, #276EC7, #1B8BDC, #71C7EE);
}
.auth-shell .auth-heading { margin-bottom: 25px; }
.auth-shell .auth-heading-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 11px;
}
.auth-shell .auth-heading-top .auth-step { margin: 0; }
.auth-shell .auth-secure-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 100px;
  background: #EFF5FC;
  color: #3A5E7B;
  font-size: 11px;
  font-weight: 730;
  white-space: nowrap;
}
.auth-shell .auth-secure-label .ic-inline { width: 12px; height: 12px; }
.auth-shell .auth-heading h1 {
  color: #142F4E;
  font-size: clamp(28px, 2.55vw, 37px);
  font-weight: 780;
}
.auth-shell .auth-heading p { max-width: 37ch; }
.auth-shell .auth-form { gap: 15px; }
.auth-shell .auth-form .field { min-width: 0; }
.auth-shell .auth-form .field > span {
  margin-bottom: 5px;
  color: #27425B;
  font-size: 13px;
  font-weight: 760;
}
.auth-shell .auth-form input:not([type="checkbox"]) {
  min-height: 52px;
  border: 1px solid #C8D6E6;
  border-radius: 11px;
  background: #fff;
  color: #19334C;
  font-size: 15px;
  padding: 12px 14px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.auth-shell .auth-form input:not([type="checkbox"]):hover {
  border-color: #97B6D8;
}
.auth-shell .auth-form input:not([type="checkbox"]):focus {
  outline: 0;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 4px #D8EAFF;
}
.auth-shell .auth-input-hint {
  display: block;
  margin-top: 7px;
  color: #61758A;
  font-size: 11.5px;
}
.auth-shell .auth-password-toggle { right: 7px; min-height: 37px; }
.auth-shell .auth-error:not([hidden]) {
  border-left: 4px solid #B42336;
  animation: wg-auth-error-enter 280ms ease-out both;
}
.auth-shell .auth-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  justify-content: center;
  overflow: hidden;
  min-height: 55px;
  border-radius: 11px;
  margin-top: 8px;
  color: white;
  background: linear-gradient(107deg, #2165BB 0%, #276EC7 52%, #308BE3 100%);
  box-shadow: 0 10px 24px rgba(39,110,199,.22);
  font-size: 15px;
  font-weight: 770;
  transition: transform 180ms var(--auth-ease), box-shadow 180ms ease;
}
.auth-shell .auth-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(39,110,199,.28);
}
.auth-shell .auth-submit:active:not(:disabled) { transform: translateY(1px); }
.auth-shell .auth-submit:focus-visible { outline: 3px solid #83C8FF; outline-offset: 3px; }
.auth-shell .auth-submit-arrow {
  display: inline-block;
  font-size: 21px;
  font-weight: 500;
  transition: transform 210ms var(--auth-ease);
}
.auth-shell .auth-submit:hover:not(:disabled) .auth-submit-arrow { transform: translateX(5px); }
.auth-shell .auth-submit.is-busy {
  opacity: 1;
  cursor: progress;
  box-shadow: 0 0 0 3px #D7E9FF, 0 11px 27px rgba(39,110,199,.27);
}
.auth-shell .auth-submit.is-busy::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.25) 44%, transparent 75%);
  transform: translateX(-110%);
  animation: wg-auth-button-sweep 850ms ease-in-out infinite;
  pointer-events: none;
}
.auth-shell .auth-submit.is-busy .auth-submit-arrow {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: white;
  font-size: 0;
  animation: wg-auth-spin 680ms linear infinite;
}
.auth-shell .auth-progress:not([hidden]) {
  color: #2D638E;
  background: #EDF6FF;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 12px;
  text-align: center;
  animation: wg-auth-rise 250ms ease-out both;
}
.auth-shell .auth-help {
  text-align: center;
  margin-top: 1px;
}
.auth-shell .auth-footnote {
  color: #657991;
  font-size: 11.5px;
}

/* TRANSITION CINÉMATIQUE : visible seulement après vérification /auth/me,
   et jamais au stade du simple mot de passe si le 2FA est requis. */
.auth-entrance-scene {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  /* Empêche les clics sur des commandes encore masquées par la transition. */
  pointer-events: auto;
  color: #fff;
  background:
    radial-gradient(ellipse at 50% 62%, #197CBD 0%, #0A427B 39%, #06244B 78%),
    #06244B;
  animation: wg-auth-portal-out 1660ms cubic-bezier(.67, 0, .22, 1) both;
}
.auth-entrance-scene::before {
  content: '';
  position: absolute;
  inset: -100%;
  background: conic-gradient(from 120deg, transparent, rgba(74,198,250,.2), transparent 28%, rgba(255,255,255,.12), transparent 62%);
  animation: wg-auth-halo-turn 1650ms ease-out both;
}
.auth-entrance-scene::after {
  content: '';
  position: absolute;
  width: min(115vw, 990px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(174, 234, 255, .22);
  box-shadow: 0 0 0 45px rgba(131,209,245,.07), 0 0 0 130px rgba(131,209,245,.04);
  animation: wg-auth-portal-ring 1200ms var(--auth-ease, ease-out) both;
}
.auth-entrance-sweep {
  position: absolute;
  z-index: 2;
  height: 2px;
  width: 150vw;
  left: -25vw;
  background: linear-gradient(90deg, transparent, #98E6FF 35%, #fff 49%, #98E6FF 65%, transparent);
  box-shadow: 0 0 26px rgba(139,231,255,.55);
  transform-origin: center;
}
.auth-entrance-sweep-one {
  top: 35%;
  transform: rotate(-18deg);
  animation: wg-auth-flight-one 840ms 80ms ease-out both;
}
.auth-entrance-sweep-two {
  top: 63%;
  transform: rotate(17deg);
  animation: wg-auth-flight-two 920ms 110ms ease-out both;
}
.auth-entrance-orbit {
  position: absolute;
  z-index: 2;
  border-radius: 50%;
  border: 2px solid rgba(176,236,255,.72);
  width: clamp(250px, 34vw, 460px);
  aspect-ratio: 1;
  animation: wg-auth-orbit-burst 1030ms 80ms cubic-bezier(.16,.87,.32,1) both;
}
.auth-entrance-orbit-two {
  border-color: rgba(110,205,255,.5);
  animation-delay: 190ms;
}
.auth-entrance-core {
  position: relative;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  animation: wg-auth-logo-bloom 1050ms 80ms cubic-bezier(.16, 1, .24, 1) both;
}
.auth-entrance-logo {
  display: grid;
  place-items: center;
  width: clamp(115px, 19vw, 168px);
  aspect-ratio: 1;
  padding: 17px;
  border-radius: 29px;
  background: white;
  box-shadow: 0 28px 75px rgba(4,18,44,.35), 0 0 0 7px rgba(255,255,255,.11);
  transform: rotate(-3deg);
}
.auth-entrance-logo img.logo-entrance {
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
}
.auth-entrance-confirmation {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-top: 18px;
  border: 1px solid rgba(157,237,213,.4);
  border-radius: 100px;
  background: rgba(5, 59, 79, .45);
  color: #CFF8EB;
  font-size: 11px;
  font-weight: 780;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.auth-entrance-core strong {
  font-size: clamp(25px, 3.2vw, 42px);
  letter-spacing: -.04em;
  font-weight: 780;
  line-height: 1.17;
}
.auth-entrance-core > span {
  color: #D9F0FF;
  font-size: 14px;
}
.shell.auth-entering {
  animation: wg-auth-shell-reveal 950ms 350ms cubic-bezier(.21, 1, .26, 1) both;
}

@keyframes wg-auth-card-appear {
  from { opacity: 0; transform: translateY(37px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes wg-auth-rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes wg-auth-error-enter {
  from { opacity: 0; transform: translateY(-7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes wg-auth-orbit-arrive {
  from { opacity: 0; transform: scale(.72) rotate(-20deg); }
  to { opacity: 1; transform: scale(1) rotate(-18deg); }
}
@keyframes wg-auth-side-orbit {
  from { transform: translate(-8px, 5px) scale(.96); }
  to { transform: translate(16px, -20px) scale(1.07); }
}
@keyframes wg-auth-button-sweep {
  to { transform: translateX(110%); }
}
@keyframes wg-auth-spin {
  to { transform: rotate(360deg); }
}
@keyframes wg-auth-halo-turn {
  from { transform: rotate(-22deg) scale(.75); opacity: .3; }
  to { transform: rotate(105deg) scale(1.18); opacity: .72; }
}
@keyframes wg-auth-flight-one {
  0% { opacity: 0; translate: -40vw 30vh; }
  35% { opacity: .9; }
  100% { opacity: 0; translate: 30vw -35vh; }
}
@keyframes wg-auth-flight-two {
  0% { opacity: 0; translate: 25vw -30vh; }
  40% { opacity: .85; }
  100% { opacity: 0; translate: -35vw 25vh; }
}
@keyframes wg-auth-orbit-burst {
  0% { opacity: 0; transform: scale(.2) rotate(-45deg); }
  45% { opacity: .85; }
  100% { opacity: 0; transform: scale(1.95) rotate(115deg); }
}
@keyframes wg-auth-logo-bloom {
  0% { opacity: 0; transform: translateY(50px) scale(.72); filter: blur(7px); }
  45% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes wg-auth-portal-ring {
  from { opacity: 0; transform: scale(.38); }
  55% { opacity: .9; }
  to { opacity: .16; transform: scale(1.28); }
}
@keyframes wg-auth-shell-reveal {
  from { opacity: .52; transform: scale(.985); filter: blur(6px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}
@keyframes wg-auth-portal-out {
  0%, 66% { opacity: 1; clip-path: inset(0 0 0 0); }
  100% { opacity: 0; clip-path: inset(0 0 100% 0); }
}
@media (max-width: 900px) {
  .auth-shell .auth-story-content { display: none; }
  .auth-shell .auth-story { min-height: 108px; }
  .auth-shell .auth-story::before { display: none; }
}
@media (max-width: 560px) {
  .auth-shell .auth-story { min-height: 90px; }
  .auth-shell .auth-card { border-radius: 17px; }
  .auth-shell .auth-form input:not([type="checkbox"]) { font-size: 16px; }
  .auth-shell .auth-secure-label { font-size: 10px; }
  .auth-entrance-core { padding: 16px; }
  .auth-entrance-core strong { font-size: 27px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-shell *, .auth-shell *::before, .auth-shell *::after,
  .auth-entrance-scene, .auth-entrance-scene *,
  .shell.auth-entering {
    animation: none !important;
    transition: none !important;
  }
  .auth-entrance-scene { display: none !important; }
}
