/* ==========================================================================
   AUTH — styles PARTAGÉS des pages Connexion (/connexion) et Inscription
   (/inscription). Desktop + mobile (bascule au seuil 768 px).
   AUCUN nouveau design : couleurs, typo (Poppins), radius, durées et le
   composant .btn viennent de composants.css (charte du site). Les champs
   (inédits sur le site vitrine) reprennent les tokens des cartes existantes :
   fond color-mix, filet rgba, --radius-md, focus --blue, erreur --signal.
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg); color: var(--white);
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh; display: flex; flex-direction: column;
  /* halo bleu discret en haut, dans l'ADN « néon » du site */
  background-image: radial-gradient(62% 46% at 50% 0%, color-mix(in srgb, var(--blue) 8%, transparent), transparent 72%);
  background-repeat: no-repeat;
}

/* ---- Logo (retour accueil) ---- */
.logo { display: inline-block; border-radius: var(--radius-sm); line-height: 0; }
.logo img { height: clamp(34px, 4vw, 42px); width: auto; display: block; }
.logo:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

/* ---- Page : carte centrée ---- */
.page {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: clamp(12px, 3vw, 32px) clamp(16px, 5vw, 24px) clamp(44px, 8vw, 80px);
}
/* ---- Alerte générale ---- Live region TOUJOURS rendue (jamais display:none) :
   sinon l'insertion de texte au moment où elle réapparaît n'est pas annoncée de
   façon fiable par les lecteurs d'écran. Vide = invisible (0 marge/fond) ;
   `.is-visible` applique l'encadré. */
.form__alerte { color: var(--white); font-size: 13.5px; line-height: 1.45; }
.form__alerte.is-visible {
  margin: clamp(20px, 4vw, 26px) 0 0; padding: 12px 14px; border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--signal) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--signal) 42%, transparent);
}
/* variante INFO (message non-erreur, ex. « … arrive bientôt ») en bleu */
.form__alerte--info.is-visible {
  background: color-mix(in srgb, var(--blue) 13%, transparent);
  border-color: color-mix(in srgb, var(--blue) 42%, transparent);
}

/* ---- État de succès (ex. mot de passe oublié) : bloc centré + pastille ---- */
.succes { text-align: center; }
.succes__ic {
  width: 56px; height: 56px; margin: 0 auto clamp(16px, 3vw, 22px);
  border-radius: 50%; display: grid; place-items: center; color: var(--blue);
  background: color-mix(in srgb, var(--blue) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--blue) 40%, transparent);
}
.succes__ic svg { width: 28px; height: 28px; }
.succes .btn--bloc { margin-top: 0; }

/* ---- Formulaire ---- */
.form { margin-top: clamp(22px, 4vw, 30px); }
.champ + .champ { margin-top: 16px; }
/* Duo de champs côte à côte en desktop (ex. Prénom / Nom), empilés en mobile. */
.champ-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.champ-duo > .champ + .champ { margin-top: 0; }        /* la grille gère l'écart */
.champ-duo + .champ, .champ + .champ-duo { margin-top: 16px; }
@media not all and (min-width: 768px) {
  .champ-duo { grid-template-columns: 1fr; }
}
.champ__label { display: block; font-size: 13px; font-weight: 500; color: var(--grey); margin-bottom: 7px; }
.champ__zone { position: relative; }
.champ__input {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--white);
  background: color-mix(in srgb, var(--white) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--white) 14%, transparent); border-radius: var(--radius-md);
  padding: 14px 16px; min-height: 52px;
  transition: border-color var(--duree-hover), box-shadow var(--duree-hover), background var(--duree-hover);
}
.champ__input::placeholder { color: var(--grey-dim); }
.champ__input:hover { border-color: color-mix(in srgb, var(--white) 26%, transparent); }
.champ__input:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 22%, transparent);
  background: color-mix(in srgb, var(--white) 6%, transparent);
}
.champ__input--mdp { padding-right: 52px; } /* place pour le bouton œil */

/* indice sous un champ (ex. « 8 caractères minimum ») */
.champ__indice { margin-top: 7px; font-size: 12px; color: var(--grey-dim); line-height: 1.4; }

/* état erreur (réutilise --signal, la couleur « erreur/complet » du site) */
.champ--erreur .champ__input { border-color: var(--signal); }
.champ--erreur .champ__input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 24%, transparent); }
.champ__erreur { display: none; margin-top: 7px; font-size: 12.5px; color: var(--signal); line-height: 1.4; }
.champ--erreur .champ__erreur { display: block; }
.champ--erreur .champ__indice { display: none; } /* l'erreur remplace l'indice */

/* bouton afficher / masquer le mot de passe */
.oeil {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; display: grid; place-items: center;
  background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer;
  color: var(--grey); transition: color var(--duree-hover);
}
.oeil:hover { color: var(--white); }
.oeil:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.oeil svg { width: 20px; height: 20px; }

/* lien « mot de passe oublié » aligné à droite sous le champ */
.oubli { text-align: right; margin-top: 9px; }
.oubli a { color: var(--blue); font-size: 13px; font-weight: 500; text-decoration: none; }
.oubli a:hover { color: var(--blue-soft); text-decoration: underline; }
.oubli a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: var(--radius-sm); }

/* case à cocher (acceptation CGU / confidentialité — page inscription) */
.accord { margin-top: 20px; }
.accord__ligne { display: flex; align-items: flex-start; gap: 11px; }
.accord__case {
  flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background: color-mix(in srgb, var(--white) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--white) 24%, transparent); border-radius: var(--radius-sm);
  display: grid; place-items: center;
  transition: background var(--duree-hover), border-color var(--duree-hover);
}
.accord__case:hover { border-color: color-mix(in srgb, var(--white) 40%, transparent); }
.accord__case:checked { background: var(--blue); border-color: var(--blue); }
.accord__case:checked::after {
  content: ''; width: 11px; height: 6px; margin-top: -2px;
  border-left: 2px solid var(--encre-bleu); border-bottom: 2px solid var(--encre-bleu);
  transform: rotate(-45deg);
}
.accord__case:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.accord__texte { font-size: 13px; color: var(--grey); line-height: 1.5; }
.accord__texte a { color: var(--blue); text-decoration: none; font-weight: 500; }
.accord__texte a:hover { color: var(--blue-soft); text-decoration: underline; }
.accord--erreur .accord__case { border-color: var(--signal); }
.accord__erreur { display: none; margin-top: 7px; font-size: 12.5px; color: var(--signal); line-height: 1.4; }
.accord--erreur .accord__erreur { display: block; }

/* bouton principal .btn (composant du site) en pleine largeur + chargement */
.btn--bloc { width: 100%; justify-content: center; margin-top: clamp(20px, 4vw, 26px); }
.btn[aria-busy="true"] { pointer-events: none; opacity: 0.9; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--encre-bleu) 30%, transparent);
  border-top-color: var(--encre-bleu); animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* connexions tierces (Google / Apple) — PLACEHOLDERS (cf. auth-backend.js) */
.tiers { display: flex; flex-direction: column; gap: 12px; }
.btn-tiers {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; min-height: 52px; padding: 12px 18px;
  background: color-mix(in srgb, var(--white) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--white) 16%, transparent); border-radius: var(--radius-md);
  color: var(--white); font-family: inherit; font-size: 14.5px; font-weight: 500; cursor: pointer;
  transition: background var(--duree-hover), border-color var(--duree-hover), transform var(--duree-appui);
}
.btn-tiers:hover { background: color-mix(in srgb, var(--white) 8%, transparent); border-color: color-mix(in srgb, var(--white) 30%, transparent); transform: translateY(-1px); }
.btn-tiers:active { transform: translateY(0); }
.btn-tiers:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.btn-tiers svg { width: 20px; height: 20px; flex-shrink: 0; }

/* pied de carte : bascule connexion <-> inscription */
.carte__pied { margin-top: clamp(22px, 4vw, 28px); text-align: center; color: var(--grey); font-size: 14px; }
.carte__pied a { color: var(--blue); font-weight: 600; text-decoration: none; }
.carte__pied a:hover { color: var(--blue-soft); text-decoration: underline; }
.carte__pied a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: var(--radius-sm); }

/* Mobile (< 768 px) : carte pleine largeur avec marges, confort tactile. */
@media not all and (min-width: 768px) {
  .champ__input, .btn-tiers { min-height: 54px; }
}

/* Message affiché quand JavaScript est désactivé (couleur = token, pas de dur). */
.noscript-msg { max-width: 432px; margin: 60px auto; padding: 0 24px; text-align: center; color: var(--grey); }

/* Mouvement réduit : pas de lifts ni de spin animé (le texte « … » + aria-busy
   suffisent à signaler le chargement). */
@media (prefers-reduced-motion: reduce) {
  .btn:hover, .btn-tiers:hover { transform: none; }
  .spinner { animation: none; }
}

.visuellement-cache {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
