/* ─────────────────────────────────────────────────────────────────────────────
   Pages d'authentification — rendu MOBILE
   Pages concernées : login.php, inscription.php, mot-de-passe-oublie.php,
   reinitialiser-mot-de-passe.php.

   Chargé APRÈS auth-lg.css (et après le <style> inline de login.php /
   inscription.php). Toutes les règles de mise en forme sont dans le bloc
   @media (max-width: 640px) : le bureau et la tablette ne sont pas modifiés.
   Les sélecteurs sont préfixés par « body.lg-page » pour l'emporter sur les
   règles inline des pages sans dépendre de l'ordre de chargement.
   ───────────────────────────────────────────────────────────────────────────── */

/* Éléments qui n'existent que sur mobile (masqués par défaut) */
.lg-page .lg-badge.lg-badge--m { display: none; }
.lg-page .lg-hint { display: none; }
.lg-page .lg-steps-indicator.lg-steps--mobile { display: none; }

@media (max-width: 640px) {

  /* ───────── Cadre de page ───────── */
  body.lg-page { background: #fff; }
  body.lg-page .lg-form-side { padding: 28px 24px 24px; background: #fff; }
  body.lg-page .lg-form-inner { max-width: none; }

  /* Logo + filet de séparation pleine largeur */
  body.lg-page .lg-brand-logo { height: 66px; width: 126px; }
  body.lg-page .lg-form-container {
    flex: 1;
    margin: 16px 0 0;
    padding: 24px 0 0;
    border-top: 1px solid #e3e8ef;
  }

  /* Utilitaires bureau / mobile */
  body.lg-page .lg-d-only { display: none; }

  /* ───────── Sur-titre (eyebrow) ───────── */
  body.lg-page .lg-eyebrow {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: #5f6f86;
    margin-bottom: 14px;
  }
  body.lg-page .lg-eyebrow--accent { color: var(--accent); font-weight: 700; }

  /* ───────── Barre de progression ───────── */
  body.lg-page .lg-steps-indicator { max-width: 190px; gap: 4px; margin: 0 0 26px; }
  body.lg-page .lg-step-bar { height: 5px; border-radius: 999px; background: #e2e8f0; }
  body.lg-page .lg-step-bar span { border-radius: 999px; }
  /* Pages « mot de passe oublié » / « réinitialiser » : pas de barre sur mobile */
  body.lg-page .lg-steps--no-mobile { display: none; }
  /* Login : la barre mobile est placée sous le sur-titre (dans chaque face) */
  body.lg-page .lg-steps--desktop { display: none; }
  body.lg-page .lg-steps-indicator.lg-steps--mobile { display: flex; }

  /* ───────── Titre + chapô ───────── */
  :root:root body.lg-page h1 {
    font-size: clamp(1.75rem, 8.2vw, 2rem);
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: -0.02em;
    white-space: normal;
    margin: 0 0 14px;
  }
  body.lg-page .lg-lead {
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #5f6f86;
    max-width: none;
    margin: 0 0 26px;
  }

  /* ───────── Pastille d'icône (récupération d'accès) ───────── */
  body.lg-page .lg-badge {
    width: 44px; height: 44px;
    margin-bottom: 14px;
    background: #fde9df; border: 0;
  }
  body.lg-page .lg-badge svg { width: 20px; height: 20px; }
  body.lg-page .lg-badge--warn { background: #fff3d6; }
  body.lg-page .lg-badge.lg-badge--m { display: grid; }

  /* Pastille + sur-titre sur la même ligne (page « réinitialiser ») */
  body.lg-page .lg-head-row { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
  body.lg-page .lg-head-row .lg-badge { margin: 0; flex: none; }
  body.lg-page .lg-head-row .lg-eyebrow { margin: 0; }

  /* ───────── Champs ───────── */
  /* « :root:root » : pro-ui.css (chargé sur login.php) impose 12,5 px aux <label> avec une forte priorité */
  :root:root body.lg-page label.lg-field-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 10px;
    padding-left: 0;
  }
  body.lg-page .lg-field { margin-bottom: 22px; }
  /* « :root:root » : pro-ui.css (login.php) force 12,5 px / min-height sur les champs et le line-height des titres */
  :root:root body.lg-page input[type="text"],
  :root:root body.lg-page input[type="email"],
  :root:root body.lg-page input[type="password"] {
    font-size: 1rem;              /* 16 px : évite le zoom automatique d'iOS */
    line-height: 1.4;
    background: #f6f8fc;
    border-color: #d9e0ea;
    margin-bottom: 22px;
  }
  :root:root body.lg-page .lg-field input[type] { margin-bottom: 0; }
  body.lg-page input::placeholder { color: #7d8aa0; }
  body.lg-page .lg-field > svg.lg-ico { left: 18px; color: #5f6f86; }
  body.lg-page .lg-eye-btn { color: #5f6f86; right: 6px; }

  /* « 8 caractères minimum » sous le champ (page « réinitialiser ») */
  body.lg-page .lg-hint {
    display: block;
    margin: -12px 0 28px;
    font-size: 0.9375rem;
    color: #5f6f86;
  }

  /* ───────── Boutons ───────── */
  body.lg-page button[type="submit"] {
    min-height: 56px;
    font-size: 1.0625rem;
    box-shadow: none;
  }
  /* Flèche collée à droite, libellé centré (oublié / réinitialiser) */
  body.lg-page button[type="submit"].lg-btn--split { position: relative; }
  body.lg-page button[type="submit"].lg-btn--split svg,
  body.lg-page button[type="submit"].lg-btn--split:hover svg {
    position: absolute; right: 22px; top: 50%;
    transform: translateY(-50%);
    width: 22px; height: 22px;
  }

  /* Bouton secondaire « Vous avez un code d'accès ? » */
  body.lg-page .lg-link-btn--cta {
    min-height: 56px;
    margin-top: 14px;
    border: 1.5px solid var(--ink);
    font-size: 1rem;
    font-weight: 500;
  }
  body.lg-page .lg-link-btn--cta svg { color: var(--ink); }
  body.lg-page .lg-link-btn--cta:hover { background: #f6f8fc; border-color: var(--ink); }
  body.lg-page a.lg-cta-dark { border: 0; }

  /* ───────── Liens ───────── */
  body.lg-page .lg-switch-link { margin-top: 26px; font-size: 1rem; color: #5f6f86; }
  body.lg-page .lg-switch-link .lg-link-btn { font-size: 1rem; }
  body.lg-page .lg-switch-link .lg-link-btn.lg-is-accent {
    color: var(--accent);
    font-weight: 500;
    border-bottom: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  /* Login : « Testez-moi ! » passe à la ligne, centré */
  body.lg-page .lg-flip-front .lg-switch-link .lg-link-btn.lg-is-accent {
    display: block; width: fit-content; margin: 8px auto 0;
  }
  /* « Mot de passe oublié ? » : orange, souligné, aligné à droite */
  body.lg-page .lg-switch-link--right { margin: -6px 0 26px; }
  body.lg-page .lg-switch-link--right .lg-link-btn {
    color: var(--accent);
    font-size: 0.9375rem;
    border-bottom: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  /* « ← Retour à la connexion » : aligné à gauche, souligné */
  body.lg-page .lg-back {
    justify-content: flex-start;
    gap: 14px;
    margin-top: 26px;
    font-size: 1rem;
    font-weight: 400;
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 4px;
  }
  body.lg-page .lg-back svg { width: 22px; height: 22px; color: var(--ink); }

  /* ───────── Encadré d'information ───────── */
  body.lg-page .lg-note {
    gap: 16px;
    margin-top: 28px;
    padding: 20px;
    background: #f0f3f9;
    border: 0;
    border-radius: 16px;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #5f6f86;
  }
  body.lg-page .lg-note svg { width: 24px; height: 24px; color: #5f6f86; }
  body.lg-page .lg-note b { display: block; margin-bottom: 4px; font-size: 1rem; font-weight: 600; color: var(--ink); }

  /* ───────── Pied de page : © sur une ligne, liens dessous ───────── */
  body.lg-page .lg-form-footer {
    justify-content: center;
    text-align: center;
    gap: 6px 12px;
    padding-top: 32px;
    font-size: 0.8125rem;
    color: #6b7a90;
  }
  body.lg-page .lg-form-footer > span { flex: 0 0 100%; }
  body.lg-page .lg-form-footer > span + i { display: none; }
  body.lg-page .lg-form-footer a { color: #5f6f86; }
  body.lg-page .lg-form-footer i { width: 3px; height: 3px; }

  /* ───────── Inscription ───────── */
  /* Le sur-titre passe au-dessus de la barre de progression (même ordre que le login) */
  body.lg-page--signup .lg-form-container { display: flex; flex-direction: column; }
  body.lg-page--signup .lg-eyebrow { order: -2; }
  body.lg-page--signup .lg-steps-indicator { order: -1; }

  /* Prénom / Nom côte à côte (le <style> inline les empile sous 520 px) */
  body.lg-page .lg-row2 { grid-template-columns: 1fr 1fr; gap: 0 14px; }

  body.lg-page .lg-trial-pill {
    align-self: flex-start;
    margin: 0 0 30px;
    padding: 12px 20px 12px 16px;
    background: #fdeedf;
    border: 0;
    color: var(--accent);
    font-size: 0.9375rem;
  }

  /* Jauge de robustesse : 4 segments, « 8 caractères minimum » dessous */
  body.lg-page .lg-field--pwd { margin-bottom: 14px; }
  body.lg-page .lg-pwd-meter { flex-wrap: wrap; gap: 10px; margin: 0 0 28px; }
  body.lg-page .lg-pwd-meter i { flex: 0 0 13%; height: 5px; border-radius: 999px; background: #e2e8f0; }
  body.lg-page .lg-pwd-meter i.on { background: var(--accent); }
  body.lg-page .lg-pwd-meter span { flex: 0 0 100%; margin: 2px 0 0; font-size: 0.9375rem; color: #5f6f86; }

  /* Case « conditions d'utilisation » */
  body.lg-page .lg-check { gap: 16px; margin: 0 0 26px; }
  body.lg-page .lg-check input { width: 28px; height: 28px; }
  body.lg-page .lg-check .lg-box { width: 28px; height: 28px; border: 1.5px solid #cbd5e1; border-radius: 8px; }
  body.lg-page .lg-check .lg-check-text { font-size: 0.9375rem; line-height: 1.5; color: #5f6f86; }
  body.lg-page .lg-check .lg-check-text a {
    color: var(--accent);
    border-bottom: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}
