/*
 * Page de connexion (www/index.php) et mot de passe oublié (www/mot-de-passe-oublie.php, même
 * gabarit, lib/connexion_gabarit.php), refonte UX du 24/09/2026, maquette Connexion.dc.html :
 * panneau de marque Nuit à gauche (560 px), carte de 400 px à droite. Préfixe cx-, jetons de
 * style.css seulement. Même page pour les deux profils. Doc : docs/ux-simple/connexion.md.
 * Contrastes (mesurés par tests/test_connexion_page.php) : --nuit-encre sur --nuit 10,24:1 ;
 * --text-muted sur --card 5,12:1 ; encres des bandeaux sur leur fond pâle 4,5:1 au moins.
 */

.cx-body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
    font-family: var(--font-ui); font-size: 15px; line-height: 24px; }
.cx-page { display: flex; min-height: 100vh; }

/* ─── Panneau de marque ─── */
.cx-marque { position: relative; flex: 0 0 560px; box-sizing: border-box; padding: 64px;
    display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
    background: var(--nuit); color: var(--nuit-actif); overflow: hidden; }
.cx-decor { position: absolute; right: -150px; bottom: -170px; width: 520px; height: 520px; opacity: .06; pointer-events: none; }
.cx-marque__haut { position: relative; display: flex; flex-direction: column; gap: 24px; }
/* Logo de Voyager (gemme détourée de logo-voyager.png), jamais l'icône générique sur aplat */
.cx-gemme { width: 56px; height: 56px; flex-shrink: 0; display: block; }
.cx-marque__textes { display: flex; flex-direction: column; gap: 8px; }
.cx-nom { margin: 0; font-family: var(--font-display); font-size: 40px; line-height: 48px; font-weight: 700;
    letter-spacing: -0.02em; color: var(--nuit-actif); }
.cx-sous-titre { margin: 0; max-width: 400px; font-size: 17px; line-height: 26px; color: var(--nuit-encre); }
.cx-promesse { position: relative; margin: 0; max-width: 400px; font-size: 15px; line-height: 24px; color: var(--nuit-encre); text-wrap: pretty; }
.cx-promesse__fin { color: var(--nuit-actif); font-weight: 600; }

/* ─── Panneau du formulaire ─── */
.cx-principal { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center;
    padding: 48px 24px; background: var(--bg); }
.cx-carte { width: 400px; max-width: 100%; box-sizing: border-box; padding: 40px 36px 36px;
    display: flex; flex-direction: column; gap: 20px; background: var(--card); border: 1px solid var(--border);
    border-radius: 16px; box-shadow: var(--shadow-carte-seule); }
.cx-titre { margin: 0; font-family: var(--font-display); font-size: 26px; line-height: 32px; font-weight: 700;
    letter-spacing: -0.02em; color: var(--text); }

/* Bandeaux d'état */
.cx-bandeau { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 10px;
    font-size: 14px; line-height: 20px; color: var(--text); }
.cx-bandeau p { margin: 0; }
.cx-bandeau__textes { display: flex; flex-direction: column; gap: 4px; }
.cx-bandeau__ico { flex-shrink: 0; display: inline-flex; padding-top: 1px; }
.cx-bandeau__fort { font-weight: 600; }
.cx-bandeau--rouge { background: var(--danger-soft); }
.cx-bandeau--rouge .cx-bandeau__ico { color: var(--danger-ink); }
.cx-bandeau--ambre { background: var(--warning-soft); }
.cx-bandeau--ambre .cx-bandeau__ico { color: var(--warning-ink); }
.cx-bandeau--neutre { background: var(--surface-inert); }
.cx-bandeau--neutre .cx-bandeau__ico { color: var(--text-quote); }

/* Formulaire */
.cx-form { display: flex; flex-direction: column; gap: 20px; margin: 0; }
.cx-form .cx-champs { display: flex; flex-direction: column; gap: 16px; }
.cx-form .cx-champ-bloc { display: flex; flex-direction: column; gap: 6px; }
.cx-label { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text); }
.cx-mdp-bloc { position: relative; }
.cx-form .cx-champ { width: 100%; height: 44px; box-sizing: border-box; margin: 0; padding: 0 12px;
    border: 1.5px solid var(--border-control); border-radius: 10px; background: var(--card);
    font-family: var(--font-ui); font-size: 15px; color: var(--text); box-shadow: none; }
.cx-form .cx-champ--mdp { padding-right: 48px; }
.cx-form .cx-champ:focus { outline: none; border-color: var(--violet); box-shadow: var(--anneau-focus); }
.cx-form .cx-champ[aria-invalid="true"] { border-color: var(--danger-ink); }
.cx-form .cx-champ[aria-invalid="true"]:focus { box-shadow: var(--anneau-erreur); }
.cx-form .cx-champ[readonly] { background: var(--surface-sunk); }
.cx-oeil { position: absolute; top: 2px; right: 2px; width: 40px; height: 40px; padding: 0; border: 0;
    border-radius: 8px; background: transparent; color: var(--text-quote); display: grid; place-items: center; cursor: pointer; }
.cx-oeil:hover { background: var(--surface-inert); }
.cx-oeil:focus-visible { outline: 2px solid var(--violet-ink); outline-offset: 0; }
.cx-oeil [hidden] { display: none; }
.cx-maj { margin: 6px 0 0; display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px;
    font-weight: 600; color: var(--warning-ink); }
.cx-maj[hidden] { display: none; }

/* Bouton principal */
.cx-bouton { width: 100%; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 0 16px; border: 0; border-radius: 10px; background: var(--accent-fill); color: var(--on-accent);
    font-family: var(--font-ui); font-size: 15px; font-weight: 600; line-height: 1; cursor: pointer; box-shadow: var(--shadow-raise); }
.cx-bouton:hover { background: var(--violet-deep); }
.cx-bouton:focus-visible { outline: 2px solid var(--violet-ink); outline-offset: 2px; }
/* Désactivé (verrou) : sans opacité (D-172 à D-175), comme .vs-btn--principal[disabled]. */
.cx-bouton[disabled] { background: var(--track-2); color: var(--text); box-shadow: none; cursor: not-allowed; }
/* En cours : le violet reste, le rond tourne. */
.cx-bouton[aria-busy="true"], .cx-bouton[aria-busy="true"]:hover { background: var(--accent-fill); color: var(--on-accent); cursor: progress; }
.cx-rond { width: 14px; height: 14px; box-sizing: border-box; border: 2px solid var(--on-accent-voile);
    border-top-color: var(--on-accent); border-radius: 50%; animation: cx-tourne .8s linear infinite; }
.cx-rond[hidden] { display: none; }
@keyframes cx-tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cx-rond { animation: none; } }

/* Phrase de confiance, filet, mot de passe oublié */
.cx-confiance { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 18px; color: var(--text-muted); }
.cx-confiance p { margin: 0; }
.cx-confiance__ico { flex-shrink: 0; display: inline-flex; padding-top: 1px; }
.cx-confiance__textes { display: flex; flex-direction: column; gap: 4px; }
.cx-filet { height: 1px; background: var(--border); }
.cx-oubli { margin: 0; font-size: 14px; line-height: 20px; color: var(--text); }
.cx-lien { color: var(--violet-ink); font-weight: 600; text-decoration: none; }
.cx-lien:hover { color: var(--violet-deep); text-decoration: underline; }
.cx-lien:focus-visible { outline: 2px solid var(--violet-ink); outline-offset: 2px; border-radius: 4px; }

/* ─── Mot de passe oublié (www/mot-de-passe-oublie.php, Q-125 du 25/09/2026) ─── */
.cx-phrase { margin: -8px 0 0; font-size: 14px; line-height: 20px; color: var(--text-muted); }
.cx-aide { margin: 6px 0 0; font-size: 13px; line-height: 18px; color: var(--text-muted); }
.cx-erreur { margin: 6px 0 0; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--danger-ink); }
.cx-bandeau--vert { background: var(--success-soft); }
.cx-bandeau--vert .cx-bandeau__ico { color: var(--success-ink); }
/* Lien en bouton : couleurs de .cx-bouton (qui l'emporte sur a), jamais souligné (a:hover). */
.cx-bouton--lien { box-sizing: border-box; text-decoration: none; }
.cx-bouton--lien:hover { text-decoration: none; }
.cx-cache { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ─── Tablette : panneau de marque plus étroit ─── */
@media (max-width: 1100px) {
    .cx-marque { flex-basis: 420px; padding: 48px; }
    .cx-decor { width: 420px; height: 420px; }
}

/* ─── Téléphone (sous 768 px) : bande de marque de 160 px, carte pleine largeur ─── */
@media (max-width: 767px) {
    .cx-page { flex-direction: column; }
    .cx-marque { flex: 0 0 auto; min-height: 160px; padding: 24px 16px; justify-content: center; }
    .cx-marque__haut { flex-direction: row; align-items: center; gap: 16px; }
    .cx-gemme { width: 40px; height: 40px; }
    .cx-nom { font-size: 28px; line-height: 34px; }
    .cx-sous-titre { font-size: 15px; line-height: 22px; }
    .cx-promesse, .cx-decor { display: none; }
    .cx-principal { align-items: flex-start; padding: 16px 16px 32px; }
    .cx-carte { width: 100%; padding: 28px 20px 24px; }
    .cx-form .cx-champ { font-size: 16px; } /* pas de zoom automatique sur iPhone */
}
