/* =========================================================
   AUTH.CSS — connexion + inscription pro (onboarding)
   Chargé par le gabarit tpl-login et le gabarit tpl-onboarding
   ========================================================= */

/* ── HAUTEUR DE LA PAGE DE CONNEXION ──────────────────────────────────────
   Cette regle disait « min-height: calc(100vh - 64px) ». Les 64 px sont la
   hauteur du bandeau .gnav — mais les gabarits tpl-login et tpl-login-pro
   n'ont PAS de bandeau. On retranchait donc la hauteur d'un element absent,
   et le centre de la boite se retrouvait 32 px au-dessus du centre reel de
   l'ecran, poussant le bas de la carte hors du cadre.

   100dvh est declare apres 100vh : les navigateurs qui le connaissent
   prennent la hauteur VRAIMENT disponible, barres d'interface comprises ;
   les autres ignorent la ligne et gardent 100vh. Aucune hauteur fixe : la
   grille peut grandir, donc la page defile. */
.auth-grid {
  display: grid; grid-template-columns: 5fr 7fr;
  min-height: 100vh;
  min-height: 100dvh;
}
.auth-left { background: var(--navy); padding: 3rem 2.5rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-left::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 20% 80%, rgba(255,107,53,.2) 0%, transparent 60%); }
.al-content { position: relative; z-index: 1; }
.al-logo { font-family: 'DM Sans', sans-serif; font-size: 20px; font-weight: 900; color: #fff; margin-bottom: 3rem; }
.al-logo span { color: var(--orange); }
.al-h1 { font-family: 'DM Sans', sans-serif; font-size: 34px; font-weight: 900; color: #fff; line-height: 1.2; margin-bottom: 1rem; }
.al-h1 em { color: var(--orange); font-style: normal; }
.al-p { font-size: 15px; color: rgba(255,255,255,.7); line-height: 1.6; margin-bottom: 2.5rem; }  /* .4 = 3.8:1 ; .7 = 8.9:1 sur --navy */
.al-stats { display: flex; gap: 2.5rem; }
.als-n { font-family: 'DM Sans', sans-serif; font-size: 26px; font-weight: 900; color: var(--orange); }
.als-l { font-size: var(--texte-pastille); color: rgba(255,255,255,.65); }
.al-trust { position: relative; z-index: 1; display: flex; gap: 1rem; flex-wrap: wrap; }
/* Focus clavier visible sur tout ce qui s'active dans ces pages : contour
   orange, décalé du texte, sur les deux fonds (bleu nuit et blanc). */
.auth-grid a:focus-visible,
.auth-grid button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.al-trust-item { font-size: var(--texte-pastille); color: rgba(255,255,255,.65); display: flex; align-items: center; gap: 5px; }  /* .25 = 2.3:1, invisible ; .65 = 7.9:1 */
/* ── UN CENTRAGE QUI DEBORDE, PAS QUI COUPE ───────────────────────────────
   La carte etait centree par « align-items: center » sur .auth-right.
   Quand l'element centre est PLUS HAUT que son conteneur, ce centrage le
   fait deborder des deux cotes a la fois — et le debordement du haut passe
   en coordonnees negatives, hors d'atteinte : aucune barre de defilement
   n'y ramene. C'est le piege classique du centrage flex, et c'est ce qui
   coupait le lien « Creer un compte gratuit ».

   « margin: auto » sur la carte centre exactement de la meme facon quand
   il y a la place, et ne coupe jamais quand il n'y en a pas : une marge
   automatique se resout a zero au lieu de devenir negative. Le
   remplissage de 2rem de la colonne reste alors visible en haut et en bas,
   et la page defile. */
.auth-right { display: flex; justify-content: center; padding: 2rem; background: var(--gray-50); }
.auth-form-box { background: #fff; border-radius: 20px; padding: 2.5rem; margin: auto; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); border: 1px solid var(--gray-100); }
.afb-title { font-family: 'DM Sans', sans-serif; font-size: 24px; font-weight: 900; margin-bottom: 4px; }
.afb-sub { font-size: var(--texte-aide); line-height: 1.5; color: var(--gray-500); margin-bottom: 1.75rem; }
.role-toggle { display: grid; grid-template-columns: 1fr 1fr; background: var(--gray-100); border-radius: 12px; padding: 4px; margin-bottom: 1.5rem; gap: 3px; }
.rt-btn {
  border: none; border-radius: 9px; padding: 10px 8px;
  font-size: var(--texte-libelle); line-height: 1.3;
  font-weight: 600; cursor: pointer; background: none; color: var(--gray-400);
  font-family: 'DM Sans', sans-serif; transition: all .2s; position: relative;
}
.rt-btn:hover:not(.on) { color: var(--gray-600); background: rgba(0,0,0,.04); }
.rt-btn.on { background: #fff; color: var(--navy); box-shadow: 0 2px 8px rgba(0,0,0,.12); font-weight: 700; }
.rt-btn.on::after { content: ''; position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%); width: 24px; height: 3px; background: var(--orange); border-radius: 2px 2px 0 0; }
.af-field { margin-bottom: 1rem; }
.af-label { display: block; font-size: var(--texte-libelle); font-weight: 700; color: var(--gray-600); margin-bottom: 7px; }
.af-input { width: 100%; border: 1.5px solid var(--gray-200); border-radius: 10px; padding: 12px 14px; font-size: var(--texte-champ); outline: none; font-family: inherit; transition: border .15s; }
.af-input:focus { border-color: var(--orange); }
.af-forgot { font-size: var(--texte-aide); color: var(--orange); font-weight: 600; text-align: right; margin: -4px 0 1.25rem; cursor: pointer; }
.af-submit { width: 100%; background: var(--orange); color: #fff; border: none; border-radius: 12px; padding: 14px; font-size: var(--texte-bouton); font-weight: 700; cursor: pointer; font-family: inherit; transition: all .15s; }
.af-submit:hover { background: var(--orange-d); }
.af-bottom { text-align: center; font-size: var(--texte-aide); line-height: 1.5; color: var(--gray-500); margin-top: 1.5rem; }
.af-bottom a { color: var(--orange); font-weight: 700; cursor: pointer; }

@media (max-width: 768px) {
  .auth-grid { grid-template-columns: 1fr; }
  .auth-left { display: none; }
}

/* ── Variante "Espace Professionnel" (gabarit tpl-login-pro) ──
   Écran de connexion pro séparé (pas juste un onglet dans le formulaire
   client) : accent teal au lieu d'orange, messages orientés pro. Réutilise
   toutes les classes ci-dessus (mêmes champs/boutons, même JS) — seule
   l'identité visuelle change, pour un rendu "plus dynamique" façon Planity
   Pro sans dupliquer la logique de connexion. */
.auth-left.pro-variant::before { background: radial-gradient(ellipse at 20% 80%, rgba(78,205,196,.25) 0%, transparent 60%); }
.al-h1 em.teal { color: var(--teal); }
.als-n.teal { color: var(--teal); }
.pro-badge {
  display: inline-flex; align-items: center; gap: 6px; background: rgba(78,205,196,.12);
  color: var(--teal); border: 1.5px solid rgba(78,205,196,.35); border-radius: 999px;
  padding: 5px 12px; font-size: var(--texte-pastille); font-weight: 700; margin-bottom: 14px;
}
.auth-form-box.pro-variant .af-submit { background: var(--teal); }
.auth-form-box.pro-variant .af-submit:hover { background: #3bb5ac; }
.auth-form-box.pro-variant .af-input:focus { border-color: var(--teal); }
.af-switch-role { text-align: center; font-size: var(--texte-aide); color: var(--gray-400); margin: -6px 0 18px; }
.af-switch-role a { color: var(--teal); font-weight: 700; cursor: pointer; }


/* ── MENTION JURIDIQUE SOUS LE BOUTON DE CONNEXION ─────────────────────
   Volontairement LISIBLE : la meme taille que les textes d'aide du site,
   sur gris 600, et non le gris presque
   invisible qu'on voit souvent au bas des formulaires. Une information
   qu'on doit lire à la loupe n'informe personne.
   Les deux liens sont soulignés : sans soulignement, un lien de la même
   couleur que le texte n'est pas identifiable comme lien. */
.af-legal {
  margin: 14px 0 0;
  font-size: var(--texte-aide); line-height: var(--interligne);
  color: var(--gray-600); text-align: center;
}
.af-legal a {
  color: var(--navy); font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px;
}
.af-legal a:hover { color: var(--orange); }
.af-legal a:focus-visible {
  outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 3px;
}
@media (max-width: 480px) { .af-legal { font-size: 13.5px; } }

/* ── INSCRIPTION PRO : LE CHOIX DU METIER ──────────────────────────────
   Un vrai selecteur, un champ obligatoire quand « Autre metier » est
   choisi, une zone d'erreur annoncee (role="alert"). Cibles tactiles de
   44 px minimum. */
.ob-metier { display: flex; flex-direction: column; gap: 8px; }
.ob-metier-label { display: block; font-size: var(--texte-libelle); font-weight: 700; color: var(--gray-600); margin-bottom: 2px; }
.ob-metier-select, .ob-metier-champ { width: 100%; min-height: 44px; border: 1.5px solid var(--gray-200); border-radius: 10px; padding: 10px 14px; font-size: var(--texte-champ); font-family: inherit; background: #fff; color: var(--navy); }
.ob-metier-select:focus-visible, .ob-metier-champ:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-color: var(--orange); }
.ob-metier-autre { margin-top: 4px; padding: 12px 14px; border: 1.5px solid #fed7aa; border-radius: 10px; background: #fff7f4; }
.ob-metier-autre[hidden] { display: none; }
.ob-metier-aide { margin: 8px 0 0; font-size: var(--texte-aide); line-height: 1.5; color: var(--gray-500); }
.ob-metier-erreur { min-height: 1.2em; font-size: var(--texte-aide); font-weight: 600; color: #b91c1c; }
.ob-metier-erreur:empty { display: none; }
.ob-metier-invalide { border-color: #dc2626; }
