/* ==========================================================================
   Connexion et inscription. Deux mises en page :
   - ordinateur (1024 px et plus) : présentation à gauche, formulaire à droite ;
   - téléphone : une colonne, gros champs, inscription en 3 étapes.
   ========================================================================== */
.au-body { margin: 0; min-height: 100dvh; background: var(--background); color: var(--text-primary); }
.au { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
.au-side { display: none; }
.au-main { display: flex; flex-direction: column; min-width: 0; padding: calc(env(safe-area-inset-top, 0px) + .9rem) 1rem calc(env(safe-area-inset-bottom, 0px) + 1.5rem); }
.au-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 44px; }
.au-top-brand { min-width: 0; }
.au-card { width: 100%; max-width: 460px; margin: 1.25rem auto 0; min-width: 0; }
.au-head { margin-bottom: 1.25rem; }
.au-title { margin: 0; font-size: clamp(1.6rem, 6vw, 2rem); font-weight: 800; letter-spacing: -.02em; color: var(--text-primary); }
.au-sub { margin: .35rem 0 0; color: var(--text-secondary); font-size: 1rem; line-height: 1.5; }

/* Formulaire */
.au-form { display: grid; gap: 1rem; }
.au-field { display: grid; gap: .4rem; min-width: 0; }
.au-field > label, .au-group-title { font-size: .95rem; font-weight: 700; color: var(--text-primary); }
.au-optional { font-weight: 500; color: var(--text-secondary); }
.au-hint { margin: 0; font-size: .85rem; color: var(--text-secondary); }
.au-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 54px;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.au-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring, rgba(37, 99, 235, .18)); }
.au-input-wrap.has-error { border-color: #DC2626; }
.au-lead { position: absolute; left: 14px; color: var(--text-secondary); pointer-events: none; }
.au-input-wrap input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 0 3rem 0 2.8rem;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 16px; /* 16 px minimum : pas de zoom automatique sur iPhone */
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.au-input-wrap input::placeholder { color: var(--text-secondary); opacity: .75; }
.au-eye { position: absolute; right: 6px; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: var(--text-secondary); cursor: pointer; }
.au-eye:hover { color: var(--primary); background: var(--primary-soft); }
.au-eye:focus-visible, .au-btn:focus-visible, .au-choice-card:focus-within { outline: 3px solid var(--primary-ring, rgba(37, 99, 235, .35)); outline-offset: 2px; }
.au-error { margin: 0; font-size: .88rem; font-weight: 600; color: #B91C1C; }
.au-notice { margin: 0 0 1rem; padding: .7rem .9rem; border-radius: 14px; font-size: .95rem; }
.au-notice.is-success { background: #D1FAE5; color: #065F46; }
.au-check { display: flex; align-items: center; gap: .6rem; min-height: 44px; font-size: .95rem; cursor: pointer; }
.au-check input { width: 20px; height: 20px; accent-color: var(--primary); }
.au-alt { margin: 1.25rem 0 0; text-align: center; color: var(--text-secondary); }
.au-alt a { font-weight: 800; color: var(--primary); }

/* Boutons */
.au-actions { display: grid; gap: .6rem; margin-top: .25rem; }
.au-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 1.2rem; border-radius: 16px; border: 2px solid transparent; font: inherit; font-size: 1.02rem; font-weight: 800; cursor: pointer; transition: transform .12s ease, background-color .18s ease, box-shadow .18s ease; }
.au-btn:active { transform: scale(.985); }
.au-btn-primary { color: #fff; background: linear-gradient(120deg, #2563EB, #1D4ED8); box-shadow: 0 12px 26px rgba(37, 99, 235, .28); }
.au-btn-primary:hover { box-shadow: 0 14px 30px rgba(37, 99, 235, .36); }
.au-btn-ghost { color: var(--text-primary); background: var(--surface); border-color: var(--border); }
.au-btn[hidden] { display: none; }

/* Choix du type de compte */
.au-choice { border: 0; margin: 0; padding: 0; display: grid; gap: .6rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-width: 0; }
.au-choice-card { position: relative; cursor: pointer; min-width: 0; }
.au-choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.au-choice-body { display: grid; gap: .25rem; justify-items: start; min-height: 96px; padding: .85rem; border-radius: 18px; border: 2px solid var(--border); background: var(--surface); min-width: 0; transition: border-color .18s ease, background-color .18s ease; }
.au-choice-body strong { font-size: .92rem; line-height: 1.25; }
.au-choice-body small { font-size: .8rem; color: var(--text-secondary); line-height: 1.3; }
.au-choice-body svg { color: var(--primary); }
.au-choice-card input:checked + .au-choice-body { border-color: var(--primary); background: var(--primary-soft); }

/* Étapes et progression (téléphone) */
.au-progress { height: 6px; border-radius: 999px; background: var(--slate-soft, #E2E8F0); overflow: hidden; }
.au-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #2563EB, #10B981); transition: width .3s ease; }
.au-step-label { margin: -.4rem 0 0; font-size: .85rem; font-weight: 700; color: var(--primary); }
.au-group { display: grid; gap: 1rem; min-width: 0; }
.au-group[hidden] { display: none; }
.au-group-title { margin: 0; font-size: 1.05rem; font-weight: 800; }

/* Mot de passe */
.au-meter { height: 6px; border-radius: 999px; background: var(--slate-soft, #E2E8F0); overflow: hidden; margin-top: .2rem; }
.au-meter span { display: block; height: 100%; width: 0; border-radius: inherit; background: #DC2626; transition: width .25s ease, background-color .25s ease; }
.au-meter span[data-level="medium"] { background: #F59E0B; }
.au-meter span[data-level="strong"] { background: #10B981; }
.au-rules { list-style: none; margin: .25rem 0 0; padding: 0; display: grid; gap: .3rem; grid-template-columns: minmax(0, 1fr); font-size: .9rem; color: var(--text-secondary); }
.au-rules li { position: relative; padding-left: 1.6rem; min-width: 0; }
.au-rules li::before { content: "○"; position: absolute; left: 0; color: var(--text-secondary); font-weight: 800; }
.au-rules li.is-ok { color: #047857; font-weight: 700; }
.au-rules li.is-ok::before { content: "✓"; color: #10B981; }
@media (min-width: 380px) { .au-rules { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* Téléphone : barre d'actions collée en bas */
.au-steps-actions { grid-template-columns: 1fr; }
@media (min-width: 480px) and (max-width: 1023px) { .au-steps-actions { grid-template-columns: 1fr 1fr; } }

/* ---------- Ordinateur : deux colonnes ---------- */
@media (min-width: 1024px) {
  .au { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
  .au-side {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2.6rem 3rem;
    color: #fff;
    background:
      radial-gradient(90% 70% at 100% 0%, rgba(255, 255, 255, .18), transparent 60%),
      linear-gradient(150deg, #1E3A8A 0%, #1D4ED8 55%, #0F766E 130%);
    overflow: hidden;
  }
  .au-side::after { content: ""; position: absolute; width: 380px; height: 380px; right: -140px; bottom: -150px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
  .au-side-brand { position: relative; z-index: 1; color: #fff; }
  .au-side-brand .brand-name, .au-side-brand strong { color: #fff; }
  .au-side-copy { position: relative; z-index: 1; display: grid; gap: 1rem; max-width: 440px; margin-top: auto; }
  .au-side-copy h2 { margin: 0; font-size: clamp(1.8rem, 2.6vw, 2.5rem); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
  .au-side-copy p { margin: 0; color: rgba(255, 255, 255, .88); font-size: 1.05rem; line-height: 1.55; }
  .au-side-points { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .8rem; }
  .au-side-points li { display: flex; align-items: flex-start; gap: .75rem; font-size: .98rem; line-height: 1.45; color: rgba(255, 255, 255, .95); }
  .au-point-icon { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .24); }
  .au-side-foot { position: relative; z-index: 1; margin: 0; font-size: .85rem; color: rgba(255, 255, 255, .75); max-width: 440px; }
  .au-side-brand a, .au-side-brand { color: #fff; }

  .au-main { justify-content: center; padding: 2.5rem 3.2rem; }
  .au-top { position: absolute; top: 1.4rem; right: 2rem; left: auto; }
  .au-top-brand { display: none; }
  .au-card { margin: 0; max-width: 420px; }
  .au-title { font-size: 2rem; }
  .au-choice { gap: .75rem; }
  .au-steps-actions { grid-template-columns: 1fr; }
  .au-progress, .au-step-label { display: none; }
  .au-input-wrap input { min-height: 52px; }
}
@media (min-width: 1024px) and (max-height: 760px) { .au-side { padding-top: 1.8rem; padding-bottom: 1.8rem; gap: 1.2rem; } }

@media (prefers-reduced-motion: reduce) { .au-btn, .au-input-wrap, .au-meter span, .au-progress span { transition: none; } }
