/*
 * Fenêtre d'inscription en 4 étapes (catalogue et fiches de lots). Voir includes/fenetre-inscription.php.
 * Le flou est un voile posé par-dessus la page : le contenu reste entier et rien ne change de place.
 * Pensé d'abord pour le téléphone : carte en bas de l'écran, au centre sur ordinateur.
 */

.lbsf {
  --lbsf-creme: #FBF8F3;
  --lbsf-nuit: #0E1E3A;
  --lbsf-orange: #F28A2B;
  --lbsf-vert: #2E8B47;
  --lbsf-gris: #5B6170;
  --lbsf-trait: #DCE0E8;
  position: fixed;
  inset: 0;
  z-index: 100000;
  overscroll-behavior: contain;
  font-family: var(--police, "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", sans-serif);
  color: var(--lbsf-nuit);
  text-align: left;
}
.lbsf[hidden],
.lbsf [hidden] { display: none !important; }

.lbsf *,
.lbsf *::before,
.lbsf *::after { box-sizing: border-box; }

/* Le fond : flou + voile sombre léger */
.lbsf__fond {
  position: absolute;
  inset: 0;
  background: rgba(21, 23, 28, .28);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  touch-action: none;
}
/* Téléphone ou navigateur ancien sans « backdrop-filter » : on floute directement le contenu */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  html.lbsf-ouverte body > *:not(.lbsf):not(script):not(style) { filter: blur(7px); }
}

/* La page derrière ne défile plus */
html.lbsf-ouverte,
html.lbsf-ouverte body { overflow: hidden !important; overscroll-behavior: none; }

/* La zone suit la partie visible de l'écran (clavier du téléphone ouvert compris) */
.lbsf__zone {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--lbsf-haut, 0px);
  height: var(--lbsf-hauteur, 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.lbsf__carte {
  width: 100%;
  max-width: 420px;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border-radius: 28px;
  padding: 22px 22px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  animation: lbsf-monte .38s cubic-bezier(.22, .9, .3, 1) both;
}
@keyframes lbsf-monte {
  from { transform: translateY(28px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@media (min-width: 720px) {
  .lbsf__zone { justify-content: center; padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .lbsf__carte { animation: none; }
}

/* Barre de progression en points */
.lbsf__points { display: flex; justify-content: center; gap: 6px; margin: 0 0 14px; }
.lbsf__points span {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--lbsf-trait);
  transition: width .25s ease, background-color .25s ease;
}
.lbsf__points span.est-actif { width: 22px; background: var(--lbsf-nuit); }

.lbsf__etape { display: flex; flex-direction: column; gap: 12px; }

.lbsf__pastille {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #FFF1E5;
  color: var(--lbsf-orange);
  flex: none;
}
.lbsf__pastille--vert { width: 64px; height: 64px; border-radius: 50%; background: #E7F7EE; color: var(--lbsf-vert); }
.lbsf__pastille svg { display: block; }

.lbsf__tete { display: flex; flex-direction: column; gap: 6px; }

.lbsf .lbsf__titre {
  margin: 0;
  font-family: inherit;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -.02em;
  text-align: center;
  text-wrap: balance;
  color: var(--lbsf-nuit);
}
.lbsf .lbsf__titre:focus { outline: none; }
.lbsf .lbsf__texte {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  text-wrap: balance;
  color: var(--lbsf-gris);
}

.lbsf__formulaire { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.lbsf__champ { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lbsf .lbsf__champ > label { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--lbsf-nuit); }

.lbsf input[type="text"],
.lbsf input[type="tel"],
.lbsf input[type="password"] {
  width: 100%;
  min-width: 0;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0 14px;
  border: 1.5px solid var(--lbsf-trait);
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
  font: inherit;
  font-size: 16px; /* 16 px au moins : sinon l'iPhone zoome */
  color: var(--lbsf-nuit);
  -webkit-appearance: none;
  appearance: none;
}
.lbsf input::placeholder { color: #9AA1AF; opacity: 1; }

/* La liste des pays (celle du téléphone), au même format que les champs */
.lbsf__liste { position: relative; }
.lbsf .lbsf__liste select {
  display: block;
  width: 100%;
  min-width: 0;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0 42px 0 14px;
  border: 1.5px solid var(--lbsf-trait);
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
  font: inherit;
  font-size: 16px;
  color: var(--lbsf-nuit);
  text-overflow: ellipsis;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.lbsf__liste svg { position: absolute; top: 15px; right: 14px; color: var(--lbsf-gris); pointer-events: none; }

.lbsf input[type="text"]:focus,
.lbsf input[type="tel"]:focus,
.lbsf input[type="password"]:focus,
.lbsf .lbsf__liste select:focus,
.lbsf__pays:focus-within .lbsf__pays-vu {
  border-color: var(--lbsf-nuit);
  outline: 3px solid rgba(242, 138, 43, .35);
  outline-offset: 0;
}
.lbsf input[aria-invalid="true"],
.lbsf select[aria-invalid="true"],
.lbsf__tel select[aria-invalid="true"] { border-color: #B42318; }


.lbsf__tel { display: flex; gap: 8px; }
.lbsf__tel input { flex: 1 1 auto; }
.lbsf__pays { position: relative; flex: 0 0 auto; }
.lbsf__pays-vu {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 48px;
  padding: 0 12px;
  border: 1.5px solid var(--lbsf-trait);
  border-radius: 14px;
  background: var(--lbsf-creme);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}
/* La vraie liste du téléphone (tous les pays) est posée, invisible, sur la case « CI +225 » */
.lbsf .lbsf__pays select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  font-size: 16px;
  cursor: pointer;
}

/* Mot de passe, avec « Afficher » dans le champ */
.lbsf__mdp { position: relative; }
.lbsf .lbsf__mdp input { padding-right: 96px; }
.lbsf .lbsf__voir {
  position: absolute;
  top: 0;
  right: 4px;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--lbsf-gris);
  cursor: pointer;
}
.lbsf .lbsf__voir:hover { background: transparent; color: var(--lbsf-nuit); }
.lbsf .lbsf__voir:focus-visible { outline: 3px solid var(--lbsf-orange); outline-offset: -3px; }

.lbsf .lbsf__aide { margin: 0; font-size: 12px; line-height: 1.4; color: var(--lbsf-gris); }

.lbsf .lbsf__erreur { margin: 0; font-size: 13px; line-height: 1.4; font-weight: 600; color: #B42318; }

.lbsf .lbsf__bouton {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 10px 18px;
  border: 0;
  border-radius: 16px;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, opacity .2s ease;
}
.lbsf .lbsf__bouton:active { transform: scale(.98); }
.lbsf .lbsf__bouton--nuit,
.lbsf .lbsf__bouton--nuit:hover { background: var(--lbsf-nuit); color: #fff; }
.lbsf .lbsf__bouton--vert,
.lbsf .lbsf__bouton--vert:hover { background: var(--lbsf-vert); color: #fff; }
/* « Prévenir Les Bons Stocks » et son dessin tiennent sur une ligne, même sur un petit téléphone */
.lbsf .lbsf__bouton--vert { gap: 8px; padding-left: 8px; padding-right: 8px; font-size: 16px; }
.lbsf .lbsf__bouton[aria-disabled="true"],
.lbsf .lbsf__bouton:disabled { opacity: .6; cursor: default; }
.lbsf .lbsf__bouton[aria-disabled="true"] { pointer-events: none; }
.lbsf__bouton svg { flex: none; }

.lbsf .lbsf__retour,
.lbsf .lbsf__deja {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: 48px;
  margin: -4px 0 -8px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--lbsf-gris);
  cursor: pointer;
}
.lbsf .lbsf__deja { display: flex; width: -moz-fit-content; width: fit-content; margin: 4px auto -8px; text-decoration: underline; text-underline-offset: 3px; }
.lbsf button.lbsf__deja:hover,
.lbsf .lbsf__retour:hover { background: transparent; color: var(--lbsf-nuit); }

.lbsf .lbsf__bouton:focus-visible,
.lbsf .lbsf__retour:focus-visible,
.lbsf .lbsf__deja:focus-visible { outline: 3px solid var(--lbsf-orange); outline-offset: 2px; }

.lbsf .lbsf__petit { margin: 0; font-size: 13px; line-height: 1.4; text-align: center; color: var(--lbsf-gris); }
.lbsf__petit strong { white-space: nowrap; color: var(--lbsf-nuit); }

.lbsf__piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lbsf .lbsf__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* L'étape 1 a cinq champs : sur les petits écrans, le cadenas laisse la place */
@media (max-height: 760px) {
  .lbsf__etape[data-etape="1"] > .lbsf__pastille { display: none; }
  .lbsf__etape[data-etape="1"],
  .lbsf__formulaire { gap: 10px; }
}

/* Très petits écrans (clavier ouvert) : la carte se resserre */
@media (max-height: 560px) {
  .lbsf__carte { padding: 16px 18px 14px; }
  .lbsf__pastille { display: none; }
  .lbsf__etape,
  .lbsf__formulaire { gap: 9px; }
  .lbsf__points { margin-bottom: 10px; }
}

@media print {
  .lbsf { display: none !important; }
}
