/* ============================================================
   PAGES DE COMPTE — connexion, Diagnostic Essence (inscription),
   mot de passe oublié, nouveau mot de passe.
   Couleurs : uniquement les variables de theme.css. Préfixe « cp- ».
   ============================================================ */

.cp-page { max-width: 480px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.cp-page.cp-large { max-width: 560px; }

.cp-carte {
  background: var(--satin), var(--carte);
  border: 1px solid var(--contour);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-carte);
  padding: 2.2rem 2rem;
}
.cp-titre { font-family: var(--police-titre); font-weight: 300; font-size: clamp(2.2rem, 7vw, 2.8rem); line-height: 1.1; color: var(--texte); margin: 0 0 0.6rem; }
.cp-titre:focus { outline: none; }
.cp-sous { color: var(--texte-2); font-size: 1rem; line-height: 1.7; margin: 0 0 1.8rem; }

/* Bouton Google : fond blanc cassé, logo officiel */
.cp-google {
  display: flex; align-items: center; justify-content: center; gap: 0.75rem; width: 100%;
  min-height: 52px; padding: 0 1.2rem; border-radius: 999px; border: 1px solid transparent;
  /* Version sombre du bouton Google (autorisée par Google) : aucun fond clair sur le site */
  background: var(--re-carte-haut); color: var(--re-texte); border-color: color-mix(in srgb, var(--re-texte-3) 45%, var(--re-bordure));
  font: 500 1rem var(--police-texte); cursor: pointer; transition: background .2s ease, border-color .2s ease;
}
.cp-google:hover:not(:disabled) { background: var(--re-carte-haut); border-color: var(--re-vert); }
.cp-google svg { width: 20px; height: 20px; flex-shrink: 0; }
.cp-google:disabled { cursor: not-allowed; opacity: 0.55; }
.cp-google .cp-bientot { font-size: 0.85rem; color: var(--texte-3); }

/* Séparateur « OU » */
.cp-ou { display: flex; align-items: center; gap: 0.9rem; margin: 1.5rem 0; color: var(--texte-3); font-size: 0.78rem; letter-spacing: 0.24em; }
.cp-ou::before, .cp-ou::after { content: ''; flex: 1; height: 1px; background: var(--contour-fort); }

/* Champs */
.cp-champ { margin-bottom: 1.2rem; }
.cp-libelle { display: block; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--texte-2); margin-bottom: 0.5rem; }
.cp-champ input {
  width: 100%; min-height: 52px; padding: 0.8rem 1rem; border-radius: var(--rayon-moyen);
  background: var(--carte-2); border: 1px solid var(--contour-fort); color: var(--texte);
  font: 400 16px var(--police-texte); outline: none; transition: border-color .2s ease;
}
.cp-champ input::placeholder { color: var(--texte-3); }
.cp-champ input:focus { border-color: var(--vert-contour); }
.cp-champ input[aria-invalid="true"] { border-color: var(--alerte); }
.cp-aide { font-size: 0.88rem; color: var(--texte-2); line-height: 1.6; margin: 0.5rem 0 0; }
.cp-aide a, .cp-mention a { color: var(--vert-clair); }

/* Bouton principal pleine largeur */
.cp-bouton {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%;
  min-height: 54px; margin-top: 0.6rem; border: none; border-radius: 999px;
  background: var(--vert); color: var(--sur-vert); font: 500 1.02rem var(--police-texte);
  cursor: pointer; text-decoration: none; transition: background .2s ease, transform .2s ease;
}
.cp-bouton:hover:not(:disabled) { background: var(--vert-clair); }
.cp-bouton:disabled { opacity: 0.6; cursor: wait; }
.cp-bouton-contour { background: transparent; color: var(--texte); border: 1px solid var(--contour-fort); }
.cp-bouton-contour:hover:not(:disabled) { background: transparent; border-color: var(--vert-contour); color: var(--vert-clair); }

/* Messages intégrés à la page (jamais de fenêtre du navigateur) */
.cp-message { border-radius: var(--rayon-moyen); padding: 0.9rem 1.1rem; margin: 0 0 1.4rem; font-size: 0.95rem; line-height: 1.6; }
.cp-message[hidden] { display: none; }
.cp-erreur { background: var(--alerte-fond); border: 1px solid var(--alerte); color: var(--alerte); }
.cp-succes { background: var(--vert-fond); border: 1px solid var(--vert-contour); color: var(--texte); }
.cp-info { background: var(--carte-2); border: 1px solid var(--contour-fort); color: var(--texte-2); }

.cp-lien { text-align: center; margin: 1.2rem 0 0; }
.cp-lien a, .cp-bas a { display: inline-flex; align-items: center; min-height: 44px; color: var(--vert-clair); }
.cp-bas { text-align: center; color: var(--texte-2); margin: 1.6rem 0 0; }
.cp-mention { font-size: 0.85rem; color: var(--texte-2); line-height: 1.6; margin: 1rem 0 0; text-align: center; }
.cp-rassurance { display: flex; justify-content: center; align-items: center; gap: 0.5rem; color: var(--texte-2); font-size: 0.95rem; margin: 0 0 1.6rem; }
.cp-rassurance::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--vert-vif); box-shadow: 0 0 10px color-mix(in srgb, var(--re-vert) 45%, transparent); }

/* ---------- Diagnostic Essence ---------- */
.cp-diag-tete { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.6rem; }
.cp-retour {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
  border-radius: 999px; border: 1px solid var(--contour-fort); background: transparent; color: var(--texte);
  font-size: 1.1rem; cursor: pointer; flex-shrink: 0;
}
.cp-retour:hover { border-color: var(--vert-contour); color: var(--vert-clair); }
.cp-retour[hidden] { visibility: hidden; display: inline-flex; }
.cp-progression { flex: 1; }
.cp-progression-texte { display: block; font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--texte-2); margin-bottom: 0.45rem; }
.cp-piste { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--re-texte) 8%, transparent); overflow: hidden; }
.cp-piste span { display: block; height: 100%; border-radius: 99px; background: var(--vert); transition: width .35s ease; }

.cp-etiquette { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.78rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--texte-2); margin: 0 0 1rem; }
.cp-etiquette::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--vert-vif); }

.cp-choix-liste { display: grid; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.cp-choix {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%;
  min-height: 64px; padding: 1rem 1.2rem; border-radius: var(--rayon-moyen); text-align: left; cursor: pointer;
  background: var(--carte-2); border: 1px solid var(--contour-fort); color: var(--texte);
  font: 400 1.05rem var(--police-texte); transition: border-color .2s ease, background .2s ease, transform .15s ease;
}
.cp-choix::after { content: ''; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--contour-fort); flex-shrink: 0; }
.cp-choix:hover { border-color: var(--vert-contour); }
.cp-choix:active { transform: scale(0.99); }
.cp-choix[aria-pressed="true"] { border-color: var(--vert); background: var(--vert-fond); }
.cp-choix[aria-pressed="true"]::after { background: var(--vert); border-color: var(--vert); box-shadow: inset 0 0 0 4px var(--carte-2); }

.cp-resultat-pilier { font-family: var(--police-titre); font-weight: 300; font-size: clamp(2.8rem, 10vw, 3.6rem); line-height: 1; color: var(--texte); margin: 0 0 1.4rem; }
.cp-resultat-pilier em { font-style: italic; color: var(--texte-2); font-size: 0.5em; display: block; margin-bottom: 0.4rem; letter-spacing: 0.01em; }
.cp-phrases { display: grid; gap: 0.9rem; margin: 0 0 1.8rem; padding: 0; list-style: none; }
.cp-phrases li { color: var(--texte-2); line-height: 1.7; padding-left: 1.1rem; border-left: 2px solid var(--contour-fort); }
.cp-phrases li:first-child { color: var(--texte); border-left-color: var(--vert); }
.cp-pret { display: flex; align-items: center; gap: 0.6rem; color: var(--texte); margin: 0 0 1.2rem; }
.cp-pret::before { content: '✓'; color: var(--vert); }

.cp-ecran[hidden] { display: none; }

/* Un élément masqué reste masqué, même s'il a un affichage « flex » */
.cp-page .cp-bouton[hidden], .cp-page .cp-google[hidden], .cp-page form[hidden] { display: none !important; }
/* Le titre reçoit le focus à chaque écran (lecteurs d'écran) : pas de cadre visible */
.cp-page [tabindex="-1"]:focus { outline: none; }

/* Tailles tactiles garanties (la règle générale de nav-compte.js met 44 px à tous les boutons et champs) */
.cp-page .cp-champ input { min-height: 52px !important; }
.cp-page .cp-bouton { min-height: 54px !important; }
.cp-page .cp-google { min-height: 52px !important; }
.cp-page .cp-choix { min-height: 64px !important; }
.cp-page .btn-voir-mdp { min-height: 48px !important; }

@media (max-width: 520px) {
  .cp-page { padding: 0.5rem 1rem 3rem; }
  .cp-carte { padding: 1.7rem 1.25rem; border-radius: var(--rayon-moyen); }
}
@media (prefers-reduced-motion: reduce) {
  .cp-piste span, .cp-choix { transition: none; }
}
