/**
 * Ecrans d'authentification (connexion, inscription, mot de passe,
 * verification) : mise en page en deux volets, volet visuel de marque a
 * gauche et formulaire a droite. Charge apres css/style.css et avant le
 * partiel theme-couleurs : les couleurs de marque (--bs-primary / --bs-dark)
 * pilotent les accents.
 *
 * Contrainte : auth-form.js attend un <input> dans un .input-group lui-meme
 * dans un .form-group (il y ajoute le bouton oeil, l'alerte majuscules et la
 * jauge de robustesse) ; ce balisage est conserve tel quel.
 */

:root {
  --auth-dark: var(--bs-dark, #1f2937);
  --auth-dark-rgb: var(--bs-dark-rgb, 31, 41, 55);
  --auth-accent: var(--bs-primary, #ffc800);
  --auth-accent-rgb: var(--bs-primary-rgb, 255, 200, 0);
}

body.auth-body {
  margin: 0;
  background: #f5f6f8;
  font-family: var(--police-ui, "Inter"), "Inter", "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #1f2937;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

.auth-shell.is-compact {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* ------------------------------------------------------------------ */
/* Volet visuel                                                        */
/* ------------------------------------------------------------------ */
.auth-visual {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  color: #fff;
  background-color: var(--auth-dark);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.auth-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(var(--auth-dark-rgb), .94) 0%, rgba(var(--auth-dark-rgb), .78) 55%, rgba(var(--auth-dark-rgb), .55) 100%);
}

.auth-visual::after {
  content: '';
  position: absolute;
  width: 520px;
  height: 520px;
  right: -180px;
  bottom: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--auth-accent-rgb), .35) 0%, rgba(var(--auth-accent-rgb), 0) 70%);
}

.auth-visual > * {
  position: relative;
  z-index: 1;
}

.auth-visual-logo {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  color: #fff;
}

.auth-visual-logo img {
  height: 64px;
  width: auto;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .35));
}

.auth-visual-body h1 {
  font-size: clamp(1.9rem, 2.6vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.01em;
  margin: 0 0 1rem;
}

.auth-visual-body p {
  font-size: 1rem;
  color: rgba(255, 255, 255, .78);
  max-width: 34rem;
  margin: 0 0 1.75rem;
}

.auth-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .9rem;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: .8rem;
  font-size: .95rem;
  color: rgba(255, 255, 255, .9);
}

.auth-points li i {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--auth-accent-rgb), .22);
  color: var(--auth-accent);
  font-size: 1.05rem;
  flex-shrink: 0;
}

.auth-visual-footer {
  font-size: .78rem;
  color: rgba(255, 255, 255, .6);
}

.auth-visual-footer a {
  color: rgba(255, 255, 255, .85);
  text-decoration: none;
}

/* ------------------------------------------------------------------ */
/* Panneau formulaire                                                  */
/* ------------------------------------------------------------------ */
.auth-panel {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  margin: auto 0;
}

.auth-shell.is-wide .auth-card {
  max-width: 820px;
}

.auth-card-mobile-logo {
  display: none;
  margin-bottom: 1.5rem;
}

.auth-card-mobile-logo img {
  height: 44px;
}

.auth-title h2 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 .35rem;
  color: #111827;
}

.auth-title p {
  margin: 0 0 1.75rem;
  color: #6b7280;
  font-size: .95rem;
}

.auth-section-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6b7280;
  margin: 1.5rem 0 .9rem;
}

.auth-section-title i {
  color: var(--auth-accent);
  font-size: 1rem;
}

/* Champs */
.auth-field {
  margin-bottom: 1.1rem;
}

.auth-field label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: .4rem;
}

.auth-field .input-group {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid #d7dbe0;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-field .input-group:focus-within {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 4px rgba(var(--auth-accent-rgb), .18);
}

.auth-field .input-group.is-invalid {
  border-color: #dc3545;
}

.auth-field .input-group-text {
  background: transparent;
  border: 0;
  color: #9ca3af;
  padding: 0 0 0 .9rem;
  font-size: 1.1rem;
}

.auth-field .input-group-text.auth-code {
  font-size: .85rem;
  font-weight: 600;
  color: #374151;
  padding-right: .25rem;
  border-right: 1px solid #e5e7eb;
  margin-right: .25rem;
}

.auth-field .form-control,
.auth-field select.form-control {
  flex: 1 1 auto;
  min-width: 0;
  height: 46px;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  font-size: .95rem;
  padding: .5rem .9rem .5rem .6rem;
  color: #111827;
}

.auth-field select.form-control {
  appearance: auto;
  -webkit-appearance: menulist;
  padding-left: .4rem;
}

.auth-field .form-control::placeholder {
  color: #b0b6bf;
}

.auth-field .form-control.is-invalid {
  background-image: none !important;
}

/* Bouton oeil ajoute par auth-form.js dans le .input-group */
.auth-field .bascule-mdp {
  border: 0 !important;
  background: transparent !important;
  color: #9ca3af !important;
  padding: 0 .9rem;
  display: inline-flex;
  align-items: center;
  font-size: 1.1rem;
}

.auth-field .bascule-mdp:hover {
  color: #374151 !important;
}

.auth-field .alerte-majuscules,
.auth-field .retour-disponibilite,
.auth-field .jauge-libelle,
.auth-field small {
  display: block;
  margin-top: .35rem;
  font-size: .76rem;
}

.auth-field .indicateur-mdp {
  margin-top: .5rem;
}

.auth-field .indicateur-mdp .progress {
  border-radius: 999px;
  background: #e5e7eb;
}

.auth-erreur {
  margin-top: .4rem;
  font-size: .78rem;
  color: #b91c1c;
  display: flex;
  align-items: center;
  gap: .35rem;
}

.auth-alert {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .8rem 1rem;
  border-radius: 10px;
  font-size: .88rem;
  margin-bottom: 1.25rem;
  border: 1px solid transparent;
}

.auth-alert i {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-alert .btn-close {
  margin-left: auto;
  font-size: .7rem;
  flex-shrink: 0;
}

.auth-alert.is-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.auth-alert.is-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.auth-alert.is-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.auth-alert.is-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

.auth-alert ul {
  margin: .4rem 0 0;
  padding-left: 1.1rem;
}

/* Actions */
.auth-btn {
  width: 100%;
  height: 48px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .98rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: #111827 !important;
  box-shadow: 0 10px 24px -12px rgba(var(--auth-accent-rgb), .9);
  transition: transform .1s ease, box-shadow .15s ease, filter .15s ease;
}

.auth-btn:hover {
  filter: brightness(.96);
  transform: translateY(-1px);
}

.auth-btn.disabled,
.auth-btn:disabled {
  box-shadow: none;
  transform: none;
}

.auth-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .85rem;
  margin: .25rem 0 1.25rem;
}

.auth-meta .form-check {
  margin: 0;
  padding-left: 0;
}

.auth-meta .form-check-label {
  color: #4b5563;
}

.auth-link {
  color: #111827;
  font-weight: 600;
  text-decoration: none;
}

.auth-link:hover {
  color: var(--auth-accent);
  text-decoration: underline;
}

.auth-foot {
  text-align: center;
  font-size: .88rem;
  color: #6b7280;
  margin-top: 1.5rem;
}

.auth-foot a {
  font-weight: 600;
  color: #111827;
  text-decoration: none;
}

.auth-foot a:hover {
  color: var(--auth-accent);
}

.auth-foot .auth-link.small {
  font-weight: 500;
  color: #9ca3af;
}

/* Onglets d'inscription et cartes de type (partiels register-tabs / type-cartes) */
.auth-card .register-tabs {
  display: inline-flex;
  gap: .25rem;
  padding: .3rem;
  margin-bottom: 1.5rem;
  border: 0;
  border-radius: 12px;
  background: #eceef2;
}

.auth-card .register-tabs a {
  padding: .5rem 1.1rem;
  margin: 0;
  border: 0;
  border-radius: 9px;
  font-size: .88rem;
  color: #4b5563;
}

.auth-card .register-tabs a.active {
  background: #fff;
  color: #111827;
  box-shadow: 0 2px 8px rgba(17, 24, 39, .08);
}

.auth-card .type-carte {
  border-radius: 12px;
  background: #fff;
  border-color: #e5e7eb;
}

.auth-card .type-carte.selectionnee {
  background: rgba(var(--auth-accent-rgb), .08);
}

.auth-card .form-check .form-check-label {
  font-size: .85rem;
  color: #4b5563;
}

.auth-legal {
  font-size: .8rem;
  color: #6b7280;
  text-align: center;
  margin-top: .5rem;
}

.auth-legal a {
  color: #111827;
  font-weight: 600;
  text-decoration: none;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 991.98px) {
  .auth-shell,
  .auth-shell.is-compact {
    grid-template-columns: 1fr;
  }
  .auth-visual {
    display: none;
  }
  .auth-card-mobile-logo {
    display: block;
  }
  .auth-panel {
    padding: 2rem 1.25rem;
    align-items: flex-start;
  }
}

@media (max-width: 575.98px) {
  .auth-title h2 {
    font-size: 1.4rem;
  }
  .auth-panel {
    padding: 1.5rem 1rem;
  }
}
