/* ==========================================================================
   Connexion / inscription — panneau bois enneigé
   ========================================================================== */
html.auth-open, html.auth-open body { overflow: hidden; }

.auth { position: fixed; inset: 0; z-index: 350; display: grid; place-items: center; padding: 16px; }
.auth__scrim { position: absolute; inset: 0; background: rgba(4,8,34,.72); }

.auth__box {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100svh - 32px); overflow: auto; overscroll-behavior: contain;
  padding: 0 24px 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(0,0,0,0) 30%), linear-gradient(180deg, #5b2e16, #3a1b0b);
  border: 3px solid #b8783a;
  box-shadow: inset 0 0 0 2px #2a1206, 0 30px 70px rgba(0,0,0,.6);
  font-weight: 500;
  animation: modal-in .3s var(--ease-out);
}
.auth__logo { width: 210px; margin: 6px auto 4px; }

/* Onglets */
.auth__tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin: 6px 0 14px; border-radius: 999px; background: rgba(0,0,0,.3); }
.auth__tabs [role="tab"] { min-height: 44px; border-radius: 999px; font-size: 19px; font-weight: 700; color: #e8d3b5; }
.auth__tabs [aria-selected="true"] { background: linear-gradient(180deg, #c81a24, #8f0c13); color: #fff; box-shadow: inset 0 0 0 2px #ff5a4d, inset 0 2px 0 rgba(255,255,255,.2); }

.auth__intro { font-size: 17px; line-height: 1.35; color: #fbeedd; margin-bottom: 14px; text-align: center; }

/* Champs */
.af { margin-bottom: 12px; }
.af__label { display: block; font-size: 16px; font-weight: 600; color: #ffe9c4; margin-bottom: 5px; }
.af__wrap { position: relative; }
.af__input {
  width: 100%; height: 48px; padding: 0 14px;
  border-radius: 12px; border: 2px solid #8a5a2c; background: #fff8ec; color: #2a1608;
  font: 500 17px/1 var(--font);
}
.af__input:focus { outline: none; border-color: var(--gold-400); box-shadow: 0 0 0 3px rgba(246,185,40,.4); }
.af__input[aria-invalid="true"] { border-color: #e5484d; }
.af__input[type="password"], .af__wrap:has(.af__eye) .af__input { padding-right: 50px; }
.af__eye { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: #6b3a14; }
.af__eye svg { width: 22px; height: 22px; }
.af__eye[aria-pressed="true"] { color: #c97c08; }
.af__help { font-size: 14px; color: #d9c2a2; margin-top: 4px; }
.af__err { font-size: 14px; font-weight: 600; color: #ffb3a8; margin-top: 4px; min-height: 0; }
.af__err:empty { display: none; }

/* Cases à cocher */
.af--check { margin-bottom: 10px; }
.ac { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.35; color: #fbeedd; cursor: pointer; }
.ac input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ac__box { flex: none; width: 24px; height: 24px; margin-top: -1px; border-radius: 7px; border: 2px solid #c9953f; background: rgba(0,0,0,.25); display: grid; place-items: center; }
.ac input:checked + .ac__box { background: var(--green-400); border-color: #9bd36a; }
.ac input:checked + .ac__box::after { content: ""; width: 7px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: translate(0,-1px) rotate(45deg); }
.ac input:focus-visible + .ac__box { box-shadow: var(--focus); }
.ac input[aria-invalid="true"] + .ac__box { border-color: #e5484d; }

.auth__link { color: var(--gold-300); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; font-size: inherit; }
.af + .auth__link { display: block; margin: -4px 0 12px auto; font-size: 15px; }
.auth__submit { height: 56px; min-height: 0; margin-top: 6px; font-size: 22px; border-width: 3px; animation: none; }
.auth__submit:disabled { opacity: .7; cursor: progress; }
.auth__switch { text-align: center; font-size: 16px; color: #fbeedd; margin-top: 14px; }
.auth__demo { margin-top: 14px; padding: 8px 10px; border-radius: 10px; background: rgba(246,185,40,.14); color: var(--gold-300); font-size: 13px; text-align: center; }

@media (max-width: 420px) {
  .auth { padding: 0; place-items: stretch; }
  .auth__box { width: 100%; max-height: 100svh; border-radius: 0; border-width: 0; padding: 0 18px max(18px, env(safe-area-inset-bottom)); }
  .auth__logo { width: 180px; }
}

/* Le règlement s'ouvre par-dessus le formulaire */
html.auth-open .modal { z-index: 400; }
