/* ================================================================
   ÉCRAN D'AUTHENTIFICATION (connexion / inscription / mot de passe oublié)
   Extrait de account.css (règles inchangées) : tout le CSS de l'écran
   /connexion/ vit ici — account.css ne garde que le tableau de bord « Mon
   compte ». Enqueue conditionnel : inc/auth-assets.php (nouli_is_account_context).
   Les composants voisins ont leur propre feuille : auth-bg.css (fond),
   auth-error.css (ligne d'erreur), password-toggle.css / caps-lock.css /
   pass-strength.css (champs mot de passe).
   NB : la règle de base morte .nl-auth--inner (grille 2 col, toujours
   surchargee par « .nl-auth .nl-auth--inner ») n'a pas été reprise.
================================================================ */

/* --- Champ de formulaire propre à la page CONNEXION (.nl-auth-field) ---
   Duplication ASSUMÉE de l'utilitaire global .field (défini dans wc-checkout.css
   / checkout-steps.css) : page-connexion.php a renommé ses champs en nl-auth-field,
   il ne peut donc plus s'appuyer sur .field. Seules les règles réellement utilisées
   sur la connexion sont reprises (pas de .field.inline ni .field-row : non utilisés).
   ⚠️ Doublon volontaire : toute évolution de .field doit être répercutée ici. */
.nl-auth-field {
  display: grid;
  gap: 0.375rem;
  position: relative; /* ancre pour le meter/suggestions insérés en flux */
}
.nl-auth-field label {
  font-size: var(--text-xs);
  color: var(--primary-60);
}
/* Boîte des champs de saisie — miroir de « .form input[…] » (checkout-steps.css).
   Duplication assumée : la connexion ne dépend ainsi plus du .form global.
   ⚠️ Doublon volontaire : répercuter toute évolution de .form input ici. */
.nl-auth-field input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 0.0625rem solid var(--primary-40);
  border-radius: 1px;
  background-color: rgba(255, 255, 255, 0);
  color: var(--primary);
  font-size: var(--text-sm);
}
/* Focus — miroir de « .form input:focus » (checkout-steps.css). */
.nl-auth-field input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Écran d'authentification plein viewport (connexion + création de compte) */
.nl-auth {
  font-family: var(--SR);
  position: relative;
  /* Pleine largeur viewport, en sortant du container parent */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  min-height: calc(100vh - 2.5rem);
  display: grid;
  place-items: center;
  padding: 7.5rem 1rem;
  /* Photo de fond : voir .nl-auth--bg (<img> réel, plus de background CSS) */
}
.nl-auth > * {
  position: relative;
  z-index: 2; /* contenu AU-DESSUS des calques de fond (photo + voile) */
}
/* Calques de fond .nl-auth--bg (photo <img>) et .nl-auth--overlay
   (voile <span>) → composant auth-bg (markup auth-bg.php, style
   assets/css/auth-bg.css, enqueue conditionnel inc/auth-bg.php). Leurs sélecteurs
   y sont préfixés par .nl-auth pour rester sous ce contenu quel que soit
   l'ordre des feuilles. */
.nl-auth .nl-auth--inner {
  display: block;
  width: min(30rem, 100%);
  margin: 0;
  gap: 0;
}
.nl-auth .nl-auth-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 1px;
  display: grid;
  gap: 1.25rem;
  padding: 2.5rem;
}
.nl-auth .nl-auth-card h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  text-align: center;
  font-style: italic;
  font-weight: 500;
}

/* Connexion / inscription 2 étapes */
.nl-auth--step { display: grid; gap: 0.875rem; }
.nl-auth--step[hidden] { display: none; }

/* Champ code OTP : large, espacé, monospaced */
input[data-register-code] {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  letter-spacing: var(--ls-x-wide);
  text-align: center;
  padding-left: 0.4em;
}

/* Champs mot de passe (toggle + caps lock) → extraits dans le composant :
   assets/css/password-toggle.css (bouton œil) */


/* OTP : 6 cases séparées avec auto-advance */
.nl-auth--otp {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}
.nl-auth--otp-box {
  width: 2.75rem;
  height: 3.25rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 600;
  border: 0.0625rem solid var(--accent);
  border-radius: 3px;
  background: var(--secondary);
  caret-color: var(--primary);
}
.nl-auth--otp-box:focus {
  outline: none;
  border-color: var(--primary);
}
@media (max-width: 48rem) {
  .nl-auth--otp-box { width: 2.25rem; height: 2.875rem; font-size: var(--text-lg); }
  .nl-auth--otp { gap: 0.375rem; }
}

/* Boutons social login */
.nl-auth--social {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
}
.nl-auth--social-sep {
  position: relative;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--primary-60);
  text-transform: uppercase;
  letter-spacing: var(--ls-display);
  margin: 1rem 0 0.5rem;
}
.nl-auth--social-sep::before,
.nl-auth--social-sep::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 1.5rem);
  height: 1px;
  background: var(--accent);
}
.nl-auth--social-sep::before { left: 0; }
.nl-auth--social-sep::after  { right: 0; }
.nl-auth--social-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.7rem 1rem;
  border: 0.0625rem solid var(--accent);
  border-radius: 3px;
  background: var(--secondary);
  color: var(--primary);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.nl-auth--social-btn:hover { background: var(--secondary-c); }
.nl-auth--social-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.nl-auth--social-btn svg { width: 1.125rem; height: 1.125rem; flex: 0 0 auto; }
.nl-auth--social-btn--apple { background: var(--primary); color: var(--secondary); border-color: var(--primary); }
.nl-auth--social-btn--apple:hover { background: var(--primary); }

/* Ligne « Renvoyer le code » sous le bouton submit étape 2 */
.nl-auth--resend-code {
  margin: 0;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--primary-60);
}
.link-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin-left: 0.25rem;
  color: var(--primary);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.link-button:disabled {
  cursor: default;
  opacity: 0.6;
  text-decoration: none;
}

/* Ligne de lien sous un bouton primaire (mot de passe oublié, switch register, etc.) */
.nl-auth--link-row {
  margin: 0.625rem 0 0 0;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--primary-60);
}
.nl-auth--link-row .link-secondary { margin-left: 0.25rem; }

/* .nl-compte--login-step-error → composant auth-error
   (renommé .nl-auth-error, déplacé dans assets/css/auth-error.css,
    enqueue conditionnel par inc/auth-error.php). */
.nl-auth--step-email {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  background: var(--muted);
  border-radius: 1px;
  font-size: var(--text-sm);
  word-break: break-all;
}
.nl-auth--step-edit {
  flex: 0 0 auto;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: var(--text-sm);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
