/* =============================================================================
   FLEUVA — ÉCRANS D'AUTHENTIFICATION (thème "Software")
   Complète fleuva-design-system-software-theme.css : layout à deux colonnes
   (panneau de marque + carte de formulaire), desktop-first avec repli
   tablette/mobile. Toutes les couleurs passent par les variables du thème,
   donc le mode sombre (html[data-mode="dark"]) est hérité sans code
   supplémentaire ici.
   ========================================================================== */
     .brand .brand-logo {
    height: 25px; /* Ajustez la hauteur selon votre design */
    width: auto;
    object-fit: contain;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  font-family: var(--font);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  background: var(--bg);
}

/* ---- Panneau de marque (desktop uniquement) ---- */
.auth-sidebar {
  width: 380px;
  flex-shrink: 0;
  background: #071923;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  color: #ffffff;
}

.auth-sidebar .brand,
.auth-sidebar .brand-context { color: #ffffff; }

.auth-sidebar-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  margin-top: -30px;
}

.auth-sidebar-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.auth-sidebar-text {
  font-size: 12.5px;
  color: #9aabb8;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-feature .material-symbols-outlined {
  font-size: 17px;
  color: #3d8168;
}

.auth-feature span {
  font-size: 12px;
  color: #c7d1d9;
}

.auth-sidebar-footer {
  font-size: 11px;
  color: #5b6b78;
}

/* ---- Colonne principale ---- */
.auth-main {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.auth-topbar {
  height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  flex-shrink: 0;
}

.auth-topbar-brand {
  display: none;
  flex-shrink: 0;
}

.auth-topbar-spacer {
  flex: 1;
  min-width: 0;
}

.auth-topbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

.auth-topbar select {
  flex-shrink: 0;
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 600;
  /* Cible tactile portée à ~40px de haut (mesurée 30px avant correction). */
  padding: 10px 12px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.auth-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-card h1 {
  font-size: 21px;
  margin: 0 0 4px;
}

.auth-card .lead {
  margin: 0 0 24px;
  font-size: 12.5px;
  /* --text-faint mesure ~2.6:1 sur --bg, sous le seuil WCAG AA (4.5:1) pour
     du texte porteur de sens. --text-muted mesure ~5:1, conforme. */
  color: var(--text-muted);
}

/* ---- Champs de formulaire ---- */
.auth-field {
  margin-bottom: 14px;
}

.auth-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.auth-field input,
.auth-field select {
  width: 100%;
  box-sizing: border-box;
}

.auth-field input.has-error,
.auth-field select.has-error {
  border-color: var(--error-border);
  background: var(--error-bg);
}

.auth-error-text {
  display: block;
  font-size: 11px;
  color: var(--error);
  margin-top: 4px;
}

.auth-phone-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.auth-phone-row select {
  width: 112px;
  flex-shrink: 0;
  box-sizing: border-box;
  font-family: 'JetBrains Mono', var(--font);
}

.auth-phone-row input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
}

.auth-password-wrap {
  position: relative;
}

.auth-password-wrap input {
  padding-right: 40px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  /* Cible tactile ~40x40px (mesurée 29x29px avant correction, sous le seuil
     WCAG 2.5.5 de 44x44px) : la zone cliquable grandit sans agrandir l'icône. */
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-password-toggle:hover {
  color: var(--text-muted);
}

.auth-password-toggle .material-symbols-outlined {
  font-size: 17px;
}

.auth-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  /* La case native ne mesure que 13x13px : le padding porte la zone
     cliquable réelle du label (case + texte) à ~40px de haut, sans changer
     la taille visuelle de la case elle-même. */
  padding: 10px 0;
  margin: -10px 0;
}

.auth-remember input {
  margin: 0;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.auth-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: none;
}

.auth-link:hover {
  color: var(--brand-hover);
}

/* Lien autonome (pas au milieu d'une phrase) : padding + marge négative
   égale pour agrandir la zone cliquable à ~40px sans déplacer le texte. */
.auth-row-between .auth-link {
  padding: 10px 0;
  margin: -10px 0;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  padding: 13px;
  font-size: 13px;
  min-height: 44px;
}

.auth-switch {
  margin-top: 20px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

.auth-back {
  margin-top: 18px;
  text-align: center;
  font-size: 12.5px;
}

.auth-back a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
  /* Zone cliquable ~40px de haut, cf. .auth-row-between .auth-link. */
  padding: 10px 0;
  margin: -10px 0;
}

.auth-back a .material-symbols-outlined {
  font-size: 15px;
}

.auth-match-msg {
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 16px;
  margin-top: 6px;
}

.auth-match-msg.error { color: var(--error); }
.auth-match-msg.success { color: var(--success); }
.auth-match-msg .material-symbols-outlined { font-size: 14px; }

.auth-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin: 8px 0 16px;
}

.auth-terms {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.auth-terms a {
  color: var(--text-muted);
}

.auth-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--error-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.auth-icon-circle .material-symbols-outlined {
  font-size: 28px;
  color: var(--brand);
}

.auth-notice {
  margin-top: 16px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--surface-3);
  border-radius: var(--radius-md);
  font-size: 11.5px;
  color: var(--text-muted);
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  margin-bottom: 16px;
}

.auth-alert.success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success);
}

.auth-alert.error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error);
}

.auth-alert .material-symbols-outlined {
  font-size: 16px;
  flex-shrink: 0;
}

/* Utilitaire manquant du thème "software" partagé */
.justify-center { justify-content: center; }

/* ---- État de chargement (soumission de formulaire) ---- */
.auth-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: -2px;
  animation: auth-spin .6s linear infinite;
}

.btn:not(.btn-primary) .auth-spinner {
  border-color: var(--border);
  border-top-color: var(--text-muted);
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-spinner {
    animation: none;
  }
}

/* ---- Checklist de robustesse du mot de passe (règles en direct) ---- */
.pwd-rules {
  list-style: none;
  margin: 8px 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pwd-rules li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.pwd-rules li .material-symbols-outlined {
  font-size: 14px;
  color: var(--text-faint);
}

.pwd-rules li.met {
  color: var(--success);
}

.pwd-rules li.met .material-symbols-outlined {
  color: var(--success);
}

/* ---- Temporisation de renvoi (mot de passe oublié / vérification e-mail) ---- */
.auth-cooldown-text {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* ---------------------------------------------------------------------------
   Repli tablette : le panneau de marque disparaît, remplacé par le
   mini-logo dans la barre du haut.
   ------------------------------------------------------------------------ */
@media (max-width: 1024px) {
  .auth-sidebar {
    display: none;
  }

  .auth-topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
  }
}

/* ---------------------------------------------------------------------------
   Repli mobile : espacements resserrés, champs empilés.
   ------------------------------------------------------------------------ */
@media (max-width: 480px) {
  .auth-topbar {
    height: 52px;
    padding: 0 14px;
  }

  .auth-body {
    padding: 16px;
  }

  .auth-card h1 {
    font-size: 19px;
  }

  .auth-phone-row {
    flex-direction: column;
  }

  .auth-phone-row select {
    width: 100%;
  }

  .auth-row-between {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
