/* ==========================================================================
   ATELIBOX — PAGES D'AUTHENTIFICATION (login, mot de passe oublié, réinitialisation)
   Split 45 / 55 en desktop (>= 1024px), bandeau compact en dessous.
   Panneau gauche : anthracite #1E1B18 + halo terracotta discret, identique en light et dark
   (surface de marque, texte blanc : contrastes mesurés > 12:1).
   ========================================================================== */

.auth-body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-app);
}

.auth {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.auth__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Panneau de marque (bandeau en mobile) ---------- */
.auth__brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-4);
  overflow: hidden;
  color: #FFFFFF;
  background-color: #1E1B18;
  background-image:
    radial-gradient(120% 90% at 100% 0%, rgba(211, 92, 39, 0.38), rgba(211, 92, 39, 0) 60%),
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: auto, 24px 24px, 24px 24px;
}

.auth__logo {
  display: inline-flex;
  border-radius: var(--radius-sm);
  line-height: 0;
}
.auth__logo img {
  display: block;
  width: 150px;
  height: auto;
}
.auth__logo:focus-visible {
  outline-color: #FFFFFF;
}

.auth__showcase,
.auth__slogan {
  display: none;
}

/* ---------- Zone formulaire ---------- */
.auth__main {
  position: relative;
  display: flex;
  flex: 1;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-6) var(--space-4) var(--space-8);
  background: var(--bg-app);
}

.auth__theme {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  color: var(--text-muted);
}

.auth__card {
  width: 100%;
  max-width: 440px;
  min-width: 0;
  margin-top: var(--space-6);
}

.auth__title {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-h3);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.auth__lead {
  margin: 0 0 var(--space-6);
  color: var(--text-muted);
  font-size: var(--font-size-body);
}

.auth__flashes {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: 20px;
}

.auth__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.auth__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-brand-700);
  font-weight: var(--font-weight-semibold);
  text-decoration: underline;
  text-underline-offset: 3px;
  border-radius: var(--radius-sm);
}
.auth__link:hover {
  text-decoration-thickness: 2px;
}
[data-theme='dark'] .auth__link {
  color: var(--color-brand-400, #E9A07C);
}

/* Champ mot de passe + bouton afficher / masquer */
.auth__pw {
  position: relative;
}
.auth__pw .ab-input {
  padding-right: 48px;
}
.auth__pw-toggle {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.auth__pw-toggle[hidden] {
  display: none;
}
.auth__pw-toggle:hover {
  color: var(--text-heading);
}
/* État « mot de passe visible » : barre diagonale sur l'œil (pas de seconde icône dans le sprite) */
.auth__pw-toggle[aria-pressed='true']::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transform: rotate(-45deg);
  box-shadow: 0 0 0 1.5px var(--ab-field-bg);
}

.auth__sep {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 20px 0;
  color: var(--text-muted);
  font-size: var(--font-size-body-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.auth__sep::before,
.auth__sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth__footer {
  margin: var(--space-6) 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-body-sm);
}

/* ---------- Desktop : split 45 / 55 ---------- */
@media (min-width: 1024px) {
  .auth {
    flex-direction: row;
  }

  .auth__brand {
    flex: 0 0 45%;
    max-width: 45%;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-6);
    padding: var(--space-12) clamp(var(--space-8), 4vw, var(--space-12));
    min-height: 100vh;
    min-height: 100dvh;
    position: sticky;
    top: 0;
    align-self: flex-start;
    background-image:
      radial-gradient(90% 60% at 100% 0%, rgba(211, 92, 39, 0.34), rgba(211, 92, 39, 0) 65%),
      radial-gradient(70% 50% at 0% 100%, rgba(211, 92, 39, 0.16), rgba(211, 92, 39, 0) 70%),
      linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: auto, auto, 32px 32px, 32px 32px;
  }

  .auth__logo img {
    width: 190px;
  }

  .auth__showcase {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
  }
  .auth__hero {
    display: block;
    width: min(100%, 520px);
    height: auto;
    padding: var(--space-6);
    box-sizing: border-box;
    background: #FAF8F5; /* carte « chaux » fixe : le panneau reste anthracite dans les deux thèmes */
    border-radius: 20px;
    transform: rotate(-3deg);
    box-shadow:
      0 30px 60px -12px rgba(0, 0, 0, 0.55),
      0 0 0 1px rgba(255, 255, 255, 0.08);
  }

  .auth__slogan {
    display: block;
    max-width: 24ch;
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #FFFFFF;
  }

  .auth__main {
    flex: 1 1 55%;
    align-items: center;
    padding: var(--space-12) var(--space-8);
  }
  .auth__theme {
    top: var(--space-4);
    right: var(--space-4);
  }
  .auth__card {
    margin-top: 0;
  }
  .auth__title {
    font-size: var(--font-size-h2);
  }
}

/* Écrans de hauteur réduite : la carte défile naturellement, le panneau de marque ne dépasse pas */
@media (min-width: 1024px) and (max-height: 640px) {
  .auth__showcase {
    display: none;
  }
}

/* Bandeau mobile / tablette : logo + motif quadrillé, sans slogan ni illustration */
@media (max-width: 1023px) {
  .auth__brand {
    min-height: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth__hero {
    transition: none;
  }
}

/* --- Activation du compte (#109) : étapes, force du mot de passe, modules --- */
.onb-steps ol {
  display: flex;
  gap: var(--space-4);
  margin: 0 0 var(--space-6);
  padding: 0;
  list-style: none;
}
.onb-steps li {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--font-size-body-sm);
}
.onb-steps__num {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-subtle);
  border-radius: 50%;
  font-weight: var(--font-weight-semibold);
}
.onb-steps li.is-current {
  color: var(--text-heading);
  font-weight: var(--font-weight-semibold);
}
.onb-steps li.is-current .onb-steps__num,
.onb-steps li.is-done .onb-steps__num {
  border-color: var(--color-brand-700);
  background: var(--color-brand-700);
  color: #fff;
}
@media (max-width: 480px) {
  .onb-steps__label {
    display: none;
  }
  .onb-steps li.is-current .onb-steps__label {
    display: inline;
  }
}
.pw-meter__bar {
  height: 6px;
  margin-top: var(--space-2);
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--border-subtle);
}
.pw-meter__bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--color-brand-700);
  transition: width 0.2s ease;
}
.pw-meter[data-score='1'] .pw-meter__bar span { width: 20%; }
.pw-meter[data-score='2'] .pw-meter__bar span { width: 40%; }
.pw-meter[data-score='3'] .pw-meter__bar span { width: 60%; }
.pw-meter[data-score='4'] .pw-meter__bar span { width: 80%; }
.pw-meter[data-score='5'] .pw-meter__bar span { width: 100%; }
.pw-meter__text {
  margin: var(--space-2) 0 0;
  color: var(--text-muted);
  font-size: var(--font-size-body-sm);
}
.onb-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-3);
}
@media (max-width: 480px) {
  .onb-row { grid-template-columns: 1fr; }
}
.onb-modules {
  display: grid;
  gap: var(--space-3);
  margin: 0 0 var(--space-6);
  padding: 0;
  border: 0;
}
