/* Connexion / Inscription animées */
    :root {
      --red: #A40000;
      --yellow: #FFDF43;
      --cream: #f7f2f0;
      --page: #efe9e7;
      --white: #ffffff;
      --white-70: rgba(255, 255, 255, .72);
      --white-45: rgba(255, 255, 255, .45);
      --error: #ffe08a;
    
      --font: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
      --serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
    
      --ease: cubic-bezier(.2, .8, .2, 1);
      --swing: cubic-bezier(.76, 0, .24, 1);
      --slide: .85s; 
    
      --brand-w: 44%;
    }
    
    *, *::before, *::after { box-sizing: border-box; }
    html { -webkit-text-size-adjust: 100%; }
    body {
      margin: 0;
      min-height: 100vh;
      min-height: 100dvh;
      display: grid;
      place-items: center;
      padding: 24px;
      font: 400 15px/1.5 var(--font);
      background: var(--white);
    }
    h1, h2, p { margin: 0; }
    a { color: inherit; }
    button, input { font: inherit; }
    .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    
    .auth{
        h1, h2, p, a, input, label{ color: var(--white); }
    }
    
    /* Carte (ordinateur) */
    .auth {
      position: relative;
      width: 100%;
      max-width: 900px;
      min-height: 510px;
      display: grid;
      grid-template-columns: 44fr 12fr 44fr;
      border-radius: 20px;
      overflow: hidden;
      background: var(--red);
      box-shadow: 0 30px 70px -30px rgba(90, 0, 0, .6), 0 8px 20px -12px rgba(90, 0, 0, .5);
      border: 1px solid var(--red);
      isolation: isolate;
    }
    
    /* ---------- Panneau du logo ---------- */
    .auth-brand {
      position: absolute;
      z-index: 3;
      top: 0;
      bottom: 0;
      left: 0;
      width: var(--brand-w);
      display: grid;
      place-items: center;
      background: var(--cream);
      will-change: transform;
    }
    /* Connexion : le panneau est à droite (56 / 44 = 127,27 % de sa propre largeur) */
    .auth[data-mode="connexion"] .auth-brand { transform: translateX(127.2727%); }
    .auth[data-mode="inscription"] .auth-brand { transform: translateX(0); }
    
    .brand-inner {
      display: grid;
      justify-items: center;
      gap: 30px;
      padding: 32px 28px;
    }
    .brand-logo { width: clamp(160px, 20vw, 210px); height: auto; }
    
    /* Vagues : celle du bord qui touche le formulaire est visible */
    .wave { position: absolute; fill: var(--cream); pointer-events: none; }
    .wave--l { top: 0; right: 100%; width: 56px; height: 100%; margin-right: -1px; transform-origin: right center; }
    .wave--r { top: 0; left: 100%;  width: 56px; height: 100%; margin-left: -1px;  transform-origin: left center; }
    .wave--h { display: none; }
    
    .auth[data-mode="connexion"] .wave--l   { transform: scaleX(1); }
    .auth[data-mode="connexion"] .wave--r   { transform: scaleX(0); }
    .auth[data-mode="inscription"] .wave--l { transform: scaleX(0); }
    .auth[data-mode="inscription"] .wave--r { transform: scaleX(1); }
    
    /* ---------- Boutons sous le logo ---------- */
    .switcher {
      position: relative;
      display: grid;
      grid-template-columns: 1fr 1fr;
      width: 260px;
      max-width: 100%;
      padding: 4px;
      border-radius: 999px;
      background: rgba(164, 0, 0, .08);
      box-shadow: inset 0 0 0 1px rgba(164, 0, 0, .14);
    }
    .switcher-pill {
      position: absolute;
      top: 4px;
      bottom: 4px;
      left: 4px;
      width: calc(50% - 4px);
      border-radius: 999px;
      background: var(--red);
      box-shadow: 0 6px 14px -6px rgba(164, 0, 0, .6);
    }
    .auth[data-mode="inscription"] .switcher-pill { transform: translateX(100%); }
    
    .switcher-btn {
      position: relative;
      z-index: 1;
      height: 42px;
      padding: 0 12px;
      border: 0;
      border-radius: 999px;
      background: none;
      color: var(--red);
      font-size: 14.5px;
      font-weight: 600;
      cursor: pointer;
      transition: color .3s;
    }
    .switcher-btn[aria-selected="true"] { color: var(--white); }
    .switcher-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
    
    /* ---------- Formulaires ---------- */
    .panes { display: contents; }
    
    .pane {
      grid-row: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding: 40px 48px;
    }
    .pane--connexion { grid-column: 1 / 3; padding-right: 76px; }   /* place pour la vague */
    .pane--inscription { grid-column: 2 / 4; padding-left: 76px; }
    
    .pane-title {
      margin-bottom: 24px;
      font-family: var(--serif);
      font-size: clamp(28px, 3vw, 34px);
      font-weight: 600;
      line-height: 1.1;
      text-align: center;
    }
    
    form { display: grid; gap: 18px; }
    
    /* État des formulaires : seul le formulaire actif est visible et cliquable */
    .pane { opacity: 0; pointer-events: none; }
    .pane.is-active { opacity: 1; pointer-events: auto; }
    
    /* Champs */
    .field { display: grid; gap: 3px; }
    .field label { font-size: 13.5px; font-weight: 500; }
    
    .control { position: relative; }
    .control input {
      width: 100%;
      height: 40px;
      padding: 0 30px 0 2px;
      border: 0;
      border-bottom: 1.5px solid var(--white-45);
      border-radius: 0;
      background: transparent;
      color: var(--white);
      font-size: 15px;
      outline: none;
      transition: border-color .2s, background-color .2s;
    }
    .control input::placeholder { color: var(--white-70); opacity: 1; }
    .control input:hover { border-bottom-color: var(--white-70); }
    .control input:focus { border-bottom-color: var(--white); background: rgba(255, 255, 255, .06); }
    .control input:focus-visible { box-shadow: 0 2px 0 0 var(--white); }
    .control input:-webkit-autofill,
    .control input:-webkit-autofill:hover,
    .control input:-webkit-autofill:focus {
      -webkit-text-fill-color: var(--white);
      -webkit-box-shadow: 0 0 0 1000px var(--red) inset;
      caret-color: var(--white);
      transition: background-color 9999s;
    }
    
    .ok {
      position: absolute;
      right: 2px;
      top: 50%;
      width: 18px;
      height: 18px;
      margin-top: -9px;
      fill: none;
      stroke: var(--white);
      stroke-width: 2.4;
      stroke-linecap: round;
      stroke-linejoin: round;
      opacity: 0;
      transform: scale(.6);
      transition: opacity .2s, transform .25s var(--ease);
      pointer-events: none;
    }
    .control input:not(:placeholder-shown):valid ~ .ok { opacity: 1; transform: none; }
    
    .hint { font-size: 12.5px; color: var(--white-70); }
    .error { display: none; align-items: center; gap: 6px; font-size: 12.5px; color: var(--error); }
    .error::before {
      content: "!";
      display: inline-grid;
      place-items: center;
      flex: none;
      width: 15px;
      height: 15px;
      border-radius: 50%;
      background: var(--error);
      color: var(--red);
      font-size: 10.5px;
      font-weight: 700;
    }
    .field:has(input:user-invalid) .error { display: flex; }
    .field:has(input:user-invalid) .hint { display: none; }
    .control input:user-invalid { border-bottom-color: var(--error); }
    
    .row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px 12px;
      flex-wrap: wrap;
      margin-top: -4px;
    }
    
    .check { display: inline-flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.4; cursor: pointer; }
    .check input {
      appearance: none;
      -webkit-appearance: none;
      flex: none;
      width: 17px;
      height: 17px;
      margin: 0;
      border: 1.5px solid var(--white-70);
      border-radius: 5px;
      background: transparent center / 12px no-repeat;
      cursor: pointer;
      transition: background-color .15s, border-color .15s;
    }
    .check input:hover { border-color: var(--white); }
    .check input:checked {
      background-color: var(--white);
      border-color: var(--white);
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23A40000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }
    .check input:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }
    .check input:user-invalid { border-color: var(--error); }
    .check a, .link { color: var(--white); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
    .link { font-size: 13px; font-weight: 500; }
    .link:hover, .check a:hover { text-decoration-thickness: 2px; }
    
    .btn {
      width: 100%;
      height: 44px;
      margin-top: 6px;
      border: 1.5px solid var(--yellow);
      border-radius: 999px;
      background: var(--yellow);
      color: var(--red);
      font-size: 15px;
      font-weight: 600;
      cursor: pointer;
      transition: background-color .2s, transform .15s;
    }
    .btn:hover { scale: 1.03; }
    .btn:active { transform: translateY(1px); }
    /*.btn:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }*/
    
    /* ==========================================================================
       Animations (activées par JS après le premier affichage : .is-ready)
       ========================================================================== */
    .is-ready .auth-brand { transition: transform var(--slide) var(--swing); }
    .is-ready .switcher-pill { transition: transform .5s var(--swing); }
    
    /* Vagues : l'ancienne se replie tout de suite, la nouvelle se déplie à l'arrivée */
    .is-ready .wave--l, .is-ready .wave--r { transition: transform .35s var(--ease); }
    .is-ready[data-mode="connexion"] .wave--l,
    .is-ready[data-mode="inscription"] .wave--r { transition: transform .5s var(--ease) calc(var(--slide) - .2s); }
    
    /* Formulaires : l'ancien part vite, le nouveau entre champ par champ */
    .is-ready .pane { transition: opacity .25s ease, transform .4s var(--ease); }
    .is-ready .pane--connexion:not(.is-active) { transform: translateX(-24px); }
    .is-ready .pane--inscription:not(.is-active) { transform: translateX(24px); }
    .is-ready .pane.is-active { transition: opacity .35s ease .3s, transform .6s var(--ease) .25s; }
    
    .is-ready .pane .pane-title,
    .is-ready .pane form > * {
      opacity: 0;
      transform: translateY(12px);
      transition: opacity .2s ease, transform .2s ease;
    }
    .is-ready .pane.is-active .pane-title,
    .is-ready .pane.is-active form > * {
      opacity: 1;
      transform: none;
      transition: opacity .45s ease, transform .55s var(--ease);
      transition-delay: calc(.32s + var(--i, 0) * 55ms);
    }
    
    /* ==========================================================================
       Mobile : logo + boutons en haut, formulaires dessous
       ========================================================================== */
    @media (max-width: 720px) {
      body { padding: 14px; place-items: start center; }
    
      .auth {
        display: flex;
        flex-direction: column;
        max-width: 440px;
        min-height: 0;
        border-radius: 22px;
      }
    
      .auth-brand {
        position: relative;
        width: 100%;
        transform: none !important;
        padding-bottom: 10px;
      }
      .brand-inner { gap: 20px; padding: 26px 20px 24px; }
      .brand-logo { width: 140px; }
      .switcher { width: 100%; max-width: 300px; }
    
      .wave--l, .wave--r { display: none; }
      .wave--h { display: block; top: 100%; left: 0; width: 100%; height: 30px; margin-top: -1px; }
    
      /* La hauteur suit le formulaire affiché (réglée par le JS) */
      .panes {
        display: block;
        position: relative;
        overflow: hidden;
      }
      .is-ready .panes { transition: height .5s var(--swing); }
    
      .pane {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        padding: 46px 24px 28px !important;
      }
      .pane.is-active { position: relative; }
      .is-ready .pane--connexion:not(.is-active) { transform: translateX(-40px); }
      .is-ready .pane--inscription:not(.is-active) { transform: translateX(40px); }
      .is-ready .pane.is-active { transition: opacity .35s ease .12s, transform .5s var(--ease) .1s; }
      .is-ready .pane.is-active .pane-title,
      .is-ready .pane.is-active form > * { transition-delay: calc(.15s + var(--i, 0) * 45ms); }
    
      .pane-title { font-size: 28px; margin-bottom: 20px; }
    }
    
    @media (max-width: 340px) {
      .row { flex-direction: column; align-items: flex-start; gap: 12px; }
      .pane { padding: 44px 18px 24px !important; }
    }
    
    /* Animations réduites : on change de formulaire sans mouvement */
    @media (prefers-reduced-motion: reduce) {
      .is-ready .auth-brand,
      .is-ready .switcher-pill,
      .is-ready .wave--l, .is-ready .wave--r,
      .is-ready .panes,
      .is-ready .pane, .is-ready .pane.is-active,
      .is-ready .pane .pane-title, .is-ready .pane form > * {
        transition-duration: .01s !important;
        transition-delay: 0s !important;
      }
    }
/* Connexion / Inscription animées */