/* =============================================================
   LECOINGAMING — pages/auth.css
   Modal connexion + page inscription.
   Mobile-first. Tokens uniquement.
   ============================================================= */

/* MODAL LOGIN — overlay */
.login-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-navbar) + 100);
  background: rgba(14, 20, 38, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: modal-overlay-in 0.18s ease both;
}
.login-modal-overlay[hidden] { display: none; }
@keyframes modal-overlay-in { from { opacity: 0; } to { opacity: 1; } }

/* Boîte */
.login-modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-7) var(--space-6) var(--space-6);
  box-shadow: 0 32px 80px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.06);
  animation: modal-box-in 0.22s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes modal-box-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Fermer */
.login-modal__close {
  position: absolute;
  top: var(--space-4); right: var(--space-4);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-light);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.login-modal__close svg { width: 16px; height: 16px; }

/* Header */
.login-modal__header { text-align: center; margin-bottom: var(--space-5); }

.login-modal__logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--gold-gradient);
  font-family: var(--font-display), sans-serif;
  font-size: var(--font-md); font-weight: 900;
  color: var(--text-dark); letter-spacing: -0.04em;
  margin-bottom: var(--space-3);
}

.login-modal__title {
  font-family: var(--font-display), sans-serif;
  font-size: var(--font-xl); font-weight: 800;
  color: var(--text-dark); letter-spacing: -0.02em;
  margin: 0 0 var(--space-1);
}
.login-modal__subtitle {
  font-size: var(--font-sm); color: var(--text-muted);
  margin: 0; line-height: var(--leading-relaxed);
}

/* Bouton Google */
.login-modal__google,
.auth-google {
  display: flex; align-items: center; justify-content: center;
  gap: var(--space-3); width: 100%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(0,0,0,0.12);
  background: var(--bg-card);
  font-family: var(--font-body), sans-serif;
  font-size: var(--font-sm); font-weight: 600;
  color: var(--text-dark); text-decoration: none;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.login-modal__google-icon,
.auth-google__icon { width: 18px; height: 18px; flex-shrink: 0; }

.login-modal__google--soon,
.auth-google--soon { opacity: 0.5; pointer-events: none; cursor: not-allowed; }

.login-modal__soon-badge,
.auth-google__soon {
  position: absolute; right: var(--space-3);
  font-family: var(--font-mono), monospace;
  font-size: 10px; font-weight: 700;
  background: var(--bg-light); color: var(--text-muted);
  padding: 1px var(--space-2); border-radius: 999px;
  border: var(--border-light);
}

@media (hover: hover) {
  .login-modal__google:not(.login-modal__google--soon):hover,
  .auth-google:not(.auth-google--soon):hover {
    border-color: rgba(0,0,0,0.22);
    background: var(--bg-light);
  }
}

/* Séparateur */
.login-modal__sep,
.auth-sep {
  display: flex; align-items: center;
  gap: var(--space-3); margin: var(--space-4) 0;
}
.login-modal__sep::before, .login-modal__sep::after,
.auth-sep::before, .auth-sep::after {
  content: ''; flex: 1; height: 1px; background: var(--border-medium);
}
.login-modal__sep span,
.auth-sep span {
  font-family: var(--font-mono), monospace;
  font-size: var(--font-xs); color: var(--text-muted);
}

/* Form */
.login-modal__form,
.auth-form {
  display: flex; flex-direction: column; gap: var(--space-4);
}

.login-modal__field,
.auth-field {
  display: flex; flex-direction: column; gap: var(--space-2);
}

.login-modal__field label,
.auth-field label {
  font-size: var(--font-sm); font-weight: 600; color: var(--text-dark);
  display: flex; justify-content: space-between; align-items: center;
}

.login-modal__forgot {
  font-size: var(--font-xs); font-weight: 500;
  color: var(--text-muted); text-decoration: none;
}
@media (hover: hover) {
  .login-modal__forgot:hover { color: var(--gold-dark); }
}

.login-modal__field input,
.auth-field input {
  height: 44px; padding-inline: var(--space-4);
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: var(--radius-sm);
  font-size: var(--font-md); color: var(--text-dark);
  background: var(--bg-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.login-modal__field input:focus,
.auth-field input:focus {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(184,155,46,0.12);
  outline: none;
}

.login-modal__input-wrap,
.auth-input-wrap { position: relative; }
.login-modal__input-wrap input,
.auth-input-wrap input { width: 100%; padding-right: 44px; }

.login-modal__eye,
.auth-eye {
  position: absolute; right: var(--space-3); top: 50%;
  transform: translateY(-50%);
  width: 24px; height: 24px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.login-modal__eye svg,
.auth-eye svg { width: 16px; height: 16px; }

/* Erreur AJAX */
.login-modal__error {
  padding: var(--space-3) var(--space-4);
  background: var(--danger-bg);
  border: 1px solid rgba(183,28,28,0.15);
  border-radius: var(--radius-sm);
  font-size: var(--font-sm); color: var(--danger);
}
.login-modal__error[hidden] { display: none; }

/* Flash page signup */
.auth-flash {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--font-sm); margin-bottom: var(--space-3);
}
.auth-flash--danger, .auth-flash--error {
  background: var(--danger-bg); color: var(--danger);
  border: 1px solid rgba(183,28,28,0.15);
}
.auth-flash--success {
  background: var(--success-bg); color: var(--success);
  border: 1px solid rgba(11,122,75,0.15);
}

.auth-field__error { font-size: var(--font-xs); color: var(--danger); }

/* Indicateur force */
.auth-strength {
  font-family: var(--font-mono), monospace;
  font-size: var(--font-xs); min-height: 16px;
}
.auth-strength--weak   { color: var(--danger); }
.auth-strength--medium { color: var(--warning); }
.auth-strength--strong { color: var(--success); }

/* CGU */
.auth-cgu {
  font-size: var(--font-xs); color: var(--text-muted);
  line-height: var(--leading-relaxed); margin: 0;
}
.auth-cgu a {
  color: var(--gold-dark); font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px;
}

/* Bouton submit */
.login-modal__submit,
.auth-submit {
  height: 48px; width: 100%;
  border-radius: var(--radius-sm);
  background: var(--gold-gradient);
  border: none; cursor: pointer;
  font-family: var(--font-body), sans-serif;
  font-size: var(--font-md); font-weight: 700;
  color: var(--text-dark);
  display: flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  box-shadow: 0 4px 14px rgba(184,155,46,0.30);
  transition: opacity 0.15s ease;
}
.login-modal__submit:disabled,
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.login-modal__submit-loader svg {
  width: 18px; height: 18px;
  animation: spin 0.8s linear infinite;
}
.login-modal__submit-loader[hidden] { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Footer modal + page */
.login-modal__footer,
.auth-card__footer {
  text-align: center;
  font-size: var(--font-sm); color: var(--text-muted);
  margin: var(--space-5) 0 0;
}
.login-modal__signup-link,
.auth-card__switch {
  color: var(--gold-dark); font-weight: 700; text-decoration: none;
}

/* PAGE INSCRIPTION */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-6) var(--space-4);
  background:
    radial-gradient(ellipse at 20% 50%, rgba(184,155,46,0.07) 0%, transparent 60%),
    var(--bg-light);
}

.auth-card {
  width: 100%; max-width: 440px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-7) var(--space-6) var(--space-6);
  box-shadow: 0 4px 24px rgba(0,0,0,0.07), 0 0 0 1px rgba(0,0,0,0.05);
}

.auth-card__header { text-align: center; margin-bottom: var(--space-5); }

.auth-card__logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--gold-gradient);
  font-family: var(--font-display), sans-serif;
  font-size: var(--font-md); font-weight: 900;
  color: var(--text-dark); letter-spacing: -0.04em;
  margin-bottom: var(--space-3); text-decoration: none;
}

.auth-card__title {
  font-family: var(--font-display), sans-serif;
  font-size: var(--font-xl); font-weight: 800;
  color: var(--text-dark); letter-spacing: -0.02em;
  margin: 0 0 var(--space-1);
}
.auth-card__subtitle {
  font-size: var(--font-sm); color: var(--text-muted);
  margin: 0; line-height: var(--leading-relaxed);
}