  :root {
    --navy: #0B2D57;
    --red: #E30613;
    --red-dark: #B8050F;
    --ink: #14213A;
    --slate: #5B6B80;
    --line: #DDE3EA;
    --bg: #F3F5F8;
    --ok: #1E8E4E;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; }
  body {
    font-family: "Montserrat", Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: #fff;
    -webkit-font-smoothing: antialiased;
  }

  .layout { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }

  /* ---------- Panneau de marque ---------- */
  .brand {
    position: relative; overflow: hidden;
    background: var(--navy); color: #fff;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 48px 56px calc(var(--swoosh-h) + 20px);
    --swoosh-h: 130px;
  }
  .brand .swoosh { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: var(--swoosh-h); pointer-events: none; }
  .brand-logo { position: relative; width: min(230px, 55%); margin-top: 2vh; }
  .brand-text { position: relative; max-width: 420px; }
  .brand-text .kicker {
    font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
    color: #FF8A92; margin-bottom: 12px;
  }
  .brand-text h2 { font-size: 30px; font-weight: 800; line-height: 1.15; }
  .brand-text p { margin-top: 14px; font-size: 15px; line-height: 1.6; color: #C9D3E0; font-weight: 500; font-style: italic; }
  .brand-foot { position: relative; font-size: 12px; color: #A9B6C8; }

  /* ---------- Formulaire ---------- */
  .form-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
  .card { width: 100%; max-width: 420px; }
  .mobile-logo { display: none; width: 180px; margin: 0 auto 28px; }

  .card .kicker {
    font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
    color: var(--red); margin-bottom: 8px;
  }
  .card h1 { font-size: 30px; font-weight: 800; color: var(--navy); line-height: 1.1; }
  .rule { width: 56px; height: 5px; background: var(--red); transform: skewX(-20deg); margin: 16px 0 18px; }
  .card .intro { font-size: 15px; color: var(--slate); line-height: 1.55; margin-bottom: 28px; }

  .alert {
    display: none; align-items: flex-start; gap: 10px;
    background: #FDECEE; border-left: 4px solid var(--red); color: #8A0A12;
    border-radius: 0 8px 8px 0; padding: 12px 14px; font-size: 14px; font-weight: 500;
    margin-bottom: 20px;
  }
  .alert.show { display: flex; }
  .alert.success { background: #E8F5EE; border-color: var(--ok); color: #135C33; }

  .field { margin-bottom: 18px; }
  .field label { display: block; font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
  .input-wrap { position: relative; }
  .input-wrap svg.icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 20px; height: 20px; stroke: var(--slate); pointer-events: none;
  }
  .field input {
    width: 100%; height: 52px; padding: 0 48px 0 46px;
    font: inherit; font-size: 15px; font-weight: 500; color: var(--ink);
    background: var(--bg); border: 2px solid transparent; border-radius: 10px;
    transition: border-color .15s, background .15s, box-shadow .15s;
  }
  .field input::placeholder { color: #94A1B2; font-weight: 400; }
  .field input:hover { border-color: var(--line); }
  .field input:focus { outline: none; background: #fff; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(11,45,87,.12); }
  .field.invalid input { border-color: var(--red); background: #fff; }
  .field .error { display: none; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--red); }
  .field.invalid .error { display: block; }

  .toggle-pw {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border: 0; background: none; border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
  }
  .toggle-pw:hover { background: var(--line); }
  .toggle-pw:focus-visible { outline: 3px solid rgba(11,45,87,.35); }
  .toggle-pw svg { width: 20px; height: 20px; stroke: var(--slate); }

  .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 26px; flex-wrap: wrap; }
  .check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; user-select: none; }
  .check input { width: 18px; height: 18px; accent-color: var(--navy); cursor: pointer; }
  .link { font-size: 14px; font-weight: 600; color: var(--navy); text-decoration: none; border-bottom: 2px solid transparent; }
  .link:hover { border-bottom-color: var(--red); }
  .link:focus-visible { outline: 3px solid rgba(11,45,87,.35); border-radius: 3px; }

  .btn {
    width: 100%; height: 54px; border: 0; border-radius: 10px; cursor: pointer;
    background: var(--red); color: #fff; font: inherit; font-size: 16px; font-weight: 700; letter-spacing: .02em;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: background .15s, transform .05s, box-shadow .15s;
    box-shadow: 0 6px 16px rgba(227,6,19,.25);
  }
  .btn:hover { background: var(--red-dark); }
  .btn:active { transform: translateY(1px); }
  .btn:focus-visible { outline: 3px solid rgba(11,45,87,.45); outline-offset: 2px; }
  .btn[disabled] { opacity: .75; cursor: progress; }
  .spinner {
    display: none; width: 18px; height: 18px; border-radius: 50%;
    border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite;
  }
  .btn.loading .spinner { display: block; }
  @keyframes spin { to { transform: rotate(360deg); } }

  .divider { display: flex; align-items: center; gap: 14px; margin: 26px 0 18px; font-size: 13px; color: var(--slate); }
  .divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

  .help { text-align: center; font-size: 14px; color: var(--slate); line-height: 1.6; }

  /* ---------- Choix de l'espace ---------- */
  .spaces { display: grid; gap: 12px; }
  .space {
    display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
    padding: 16px 16px; background: #fff; border: 2px solid var(--line); border-radius: 12px;
    font: inherit; color: var(--ink); cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .1s;
  }
  .space:hover { border-color: var(--navy); box-shadow: 0 6px 18px rgba(11,45,87,.10); transform: translateY(-1px); }
  .space:focus-visible { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(11,45,87,.15); }
  .space-ico { flex: none; width: 46px; height: 46px; border-radius: 10px; background: var(--navy); display: flex; align-items: center; justify-content: center; }
  .space-ico.red { background: var(--red); }
  .space-ico svg { width: 24px; height: 24px; stroke: #fff; }
  .space-txt { flex: 1; display: flex; flex-direction: column; gap: 3px; }
  .space-txt b { font-size: 15.5px; font-weight: 700; color: var(--navy); }
  .space-txt small { font-size: 13px; color: var(--slate); line-height: 1.4; }
  .space .chev { flex: none; width: 20px; height: 20px; stroke: var(--line); transition: stroke .15s, transform .15s; }
  .space:hover .chev { stroke: var(--red); transform: translateX(3px); }
  .space.last { border-color: var(--navy); }
  .space.last .space-txt b::after { content: "Dernier utilisé"; margin-left: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--red); vertical-align: 1px; }

  .back {
    display: inline-flex; align-items: center; gap: 6px; margin-bottom: 22px;
    background: none; border: 0; padding: 6px 10px 6px 4px; border-radius: 8px;
    font: inherit; font-size: 14px; font-weight: 600; color: var(--slate); cursor: pointer;
  }
  .back svg { width: 18px; height: 18px; stroke: currentColor; }
  .back:hover { color: var(--navy); background: var(--bg); }
  .back:focus-visible { outline: 3px solid rgba(11,45,87,.35); }
  .fade { animation: fade .25s ease-out; }
  @keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

  /* ---------- Responsive ---------- */
  @media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .brand { display: none; }
    .mobile-logo { display: block; }
    .form-side { align-items: flex-start; padding-top: 40px; }
    .card h1 { font-size: 26px; }
  }
  @media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
