/* compte.css : connexion, inscription, mot de passe oublié, complétion du profil, fenêtre de connexion de la navbar (2026-11-19).
   Gabarit compact validé par l'utilisateur, sur le modèle de l'ancienne connexion : carte vitrée de 320 px,
   champs de 38 px à coins de 12 px, texte indicatif dans les champs, Quicksand, orange #FFA600.
   Pas de style en ligne ni de script en ligne dans ces pages (compatibles avec une politique de sécurité stricte). */

.cpt {
    --cpt-orange: #FFA600;
    --cpt-texte-doux: rgba(255, 255, 255, 0.78);
    --cpt-erreur: #ffb4a8;
    --cpt-valide: #8ee59a;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 0 auto;   /* occupe la hauteur libre : le pied de page reste en bas, sans barre de défilement */
    gap: 14px;
    padding: 76px 12px 30px;
    box-sizing: border-box;
    color: #fff;
    font-family: "Quicksand", sans-serif;
    font-size: 15px;
    line-height: 1.4;
}

/* La page fait au moins la hauteur de l'écran (base.css, padding compris : charte.css) : contenu puis pied de page en colonne */
body[data-compte] .page { display: flex; flex-direction: column; }

.cpt *, .cpt *::before, .cpt *::after { box-sizing: border-box; }
:where(.cpt) :is(h1, h2, p, fieldset, legend, ul, ol) { margin: 0; padding: 0; }
:where(.cpt) fieldset { min-width: 0; border: 0; }
.cpt [hidden] { display: none !important; }
.cpt-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; clip-path: inset(50%); white-space: nowrap; }
/* Piège à robots : hors de l'écran, ignoré par les lecteurs d'écran et la navigation au clavier */
.cpt-piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.cpt-carte {
    width: min(320px, 100%);
    padding: 20px 20px 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    backdrop-filter: brightness(40%);
    -webkit-backdrop-filter: brightness(40%);
    box-shadow: 0 5px 45px rgba(0, 0, 0, 0.1);
}

.cpt-carte h1 { font-size: 1.35rem; font-weight: 700; text-align: center; }
.cpt-sous-titre { margin: 2px 0 14px; color: var(--cpt-texte-doux); font-size: 0.8rem; text-align: center; }

/* Étapes (à partir de la 2e partie) */
.cpt-etapes { display: flex; gap: 4px; margin-bottom: 14px; list-style: none; counter-reset: etape; }
.cpt-etapes li { flex: 1; display: grid; justify-items: center; gap: 3px; color: rgba(255, 255, 255, 0.5); font-size: 0.64rem; font-weight: 700; text-align: center; line-height: 1.2; counter-increment: etape; }
.cpt-etapes li::before { content: counter(etape); display: grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid rgba(255, 255, 255, 0.45); border-radius: 50%; font-size: 0.72rem; }
.cpt-etapes li.cpt-faite::before { content: "✓"; border-color: var(--cpt-valide); background: var(--cpt-valide); color: #1f1f1f; }
.cpt-etapes li[aria-current="step"] { color: #fff; }
.cpt-etapes li[aria-current="step"]::before { border-color: var(--cpt-orange); background: var(--cpt-orange); color: #1f1f1f; }

/* Champs : icône à gauche, texte indicatif dans le champ */
.cpt-champ { margin-bottom: 9px; }
.cpt-saisie { position: relative; }
.cpt-saisie > i:first-child { position: absolute; top: 50%; left: 11px; transform: translateY(-50%); color: #fff; font-size: 0.85rem; pointer-events: none; }
.cpt-saisie input {
    width: 100%;
    height: 38px;
    padding: 0 34px 0 32px;
    border: 1px solid #fff;
    border-radius: 12px;
    outline: none;
    background: none;
    color: #fff;
    font: inherit;
    font-size: 0.92rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.cpt-saisie input::placeholder { color: rgba(255, 255, 255, 0.85); }
.cpt-saisie input:focus { border-color: var(--cpt-orange); box-shadow: 0 0 0 2px rgba(255, 166, 0, 0.35); }
.cpt-oeil { position: absolute; top: 50%; right: 4px; padding: 5px 7px; border: 0; background: none; color: #fff; font-size: 0.85rem; cursor: pointer; transform: translateY(-50%); }
.cpt-oeil:focus-visible { border-radius: 6px; outline: 2px solid #fff; }
.cpt-aide { margin: 3px 4px 0; color: var(--cpt-texte-doux); font-size: 0.7rem; line-height: 1.3; }
.cpt-aide--rapprochee { margin: -5px 4px 9px; }
.cpt-message { margin: 3px 4px 0; color: var(--cpt-erreur); font-size: 0.72rem; font-weight: 700; }
.cpt-champ.cpt-invalide .cpt-saisie input { border-color: var(--cpt-erreur); }
.cpt-libelle { display: block; margin: 2px 2px 5px; font-size: 0.78rem; font-weight: 700; }

/* Recherche de commune : barre de recherche, puis champ validé quand la commune vient de la liste */
.cpt-commune { position: relative; }
.cpt-commune .cpt-coche { position: absolute; top: 50%; right: 11px; color: var(--cpt-valide); font-size: 0.9rem; opacity: 0; transform: translateY(-50%); transition: opacity 0.15s; pointer-events: none; }
.cpt-commune.cpt-commune--valide .cpt-coche { opacity: 1; }
.cpt-commune.cpt-commune--valide .cpt-saisie input { border-color: var(--cpt-valide); }
.cpt-suggestions {
    position: absolute;
    z-index: 5;
    top: calc(100% + 3px);
    right: 0;
    left: 0;
    max-height: 210px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    background: rgba(20, 24, 30, 0.96);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    list-style: none;
}
.cpt-suggestions li { padding: 6px 10px; border-radius: 8px; font-size: 0.86rem; cursor: pointer; }
.cpt-suggestions li[aria-selected="true"], .cpt-suggestions li:hover { background: rgba(255, 166, 0, 0.25); }
.cpt-suggestions li mark { background: none; color: var(--cpt-orange); font-weight: 700; }
.cpt-suggestions .cpt-aucune { color: var(--cpt-texte-doux); cursor: default; }
.cpt-suggestions .cpt-aucune:hover { background: none; }

/* Mot de passe : jauge et règles cochées en direct */
.cpt-force { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin: 5px 4px 0; }
.cpt-force span { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.2); }
.cpt-force[data-niveau="1"] span:nth-child(-n+1) { background: #ff8a7a; }
.cpt-force[data-niveau="2"] span:nth-child(-n+2) { background: #ffb347; }
.cpt-force[data-niveau="3"] span:nth-child(-n+3) { background: #ffd166; }
.cpt-force[data-niveau="4"] span { background: var(--cpt-valide); }
.cpt-regles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 8px; margin: 5px 4px 0; color: var(--cpt-texte-doux); font-size: 0.7rem; list-style: none; }
.cpt-regles li[data-regle="longueur"] { grid-column: 1 / -1; }
.cpt-regles li::before { content: "○"; display: inline-block; width: 14px; }
.cpt-regles li.cpt-ok { color: #c8f7cd; }
.cpt-regles li.cpt-ok::before { content: "✓"; }

/* Choix (type de compte, sexe, habitation) */
.cpt-choix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.cpt-choix--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cpt-type { margin-bottom: 16px; }   /* de l'air entre le type de compte et l'adresse e-mail */
.cpt-option { position: relative; display: block; cursor: pointer; }
.cpt-option span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 100%; min-height: 34px; padding: 5px 6px; border: 1px solid #fff; border-radius: 12px; font-size: 0.8rem; font-weight: 700; line-height: 1.2; text-align: center; transition: background-color 0.15s, border-color 0.15s; }
.cpt-option span i { font-size: 0.85rem; }
.cpt-option:hover span { background: rgba(255, 255, 255, 0.1); }
.cpt-option input:checked + span { border-color: var(--cpt-orange); background: rgba(255, 166, 0, 0.25); }
.cpt-option input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }

/* Interrupteur (« Rester connecté », newsletter) : piste arrondie, pastille qui glisse, orange quand il est activé */
.cpt-interrupteur { position: relative; display: flex; align-items: center; gap: 10px; margin: 4px 2px 12px; font-size: 0.8rem; cursor: pointer; user-select: none; }
.cpt-piste { position: relative; flex: none; width: 36px; height: 20px; border: 1px solid #fff; border-radius: 999px; transition: background-color 0.2s, border-color 0.2s; }
.cpt-piste::before { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 0.2s, background-color 0.2s; }
.cpt-interrupteur:hover input:not(:checked) + .cpt-piste { background: rgba(255, 255, 255, 0.12); }
.cpt-interrupteur input:checked + .cpt-piste { border-color: var(--cpt-orange); background: var(--cpt-orange); }
.cpt-interrupteur input:checked + .cpt-piste::before { background: #1f1f1f; transform: translateX(16px); }
.cpt-interrupteur input:focus-visible + .cpt-piste { outline: 2px solid #fff; outline-offset: 2px; }
.cpt-interrupteur .cpt-discret { display: block; color: var(--cpt-texte-doux); font-size: 0.7rem; line-height: 1.2; }

.cpt-legal { margin: 0 2px 10px; color: var(--cpt-texte-doux); font-size: 0.7rem; }
.cpt a { color: var(--cpt-orange); font-weight: 700; }
.cpt a:focus-visible { border-radius: 4px; outline: 2px solid #fff; }

.cpt-boutons { display: flex; gap: 8px; margin-top: 4px; }
.cpt-bouton {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #fff;
    border-radius: 12px;
    background: none;
    color: #fff;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}
.cpt-bouton:hover { background: rgba(255, 255, 255, 0.12); }
.cpt-bouton--plein { border-color: var(--cpt-orange); background: var(--cpt-orange); color: #1f1f1f; }
.cpt-bouton--plein:hover { background: #ffb833; }
.cpt-bouton--etroit { flex: 0 0 auto; }
.cpt-bouton:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cpt-bouton:disabled { opacity: 0.55; cursor: not-allowed; }
.cpt a.cpt-bouton { color: #fff; text-decoration: none; }
.cpt a.cpt-bouton--plein { color: #1f1f1f; }
.cpt-liens { display: grid; gap: 4px; margin-top: 12px; font-size: 0.8rem; text-align: center; }

.cpt-alerte { margin-bottom: 10px; padding: 7px 10px; border-left: 3px solid var(--cpt-erreur); border-radius: 8px; background: rgba(255, 90, 70, 0.2); font-size: 0.78rem; font-weight: 600; }
.cpt-info { margin-bottom: 10px; padding: 7px 10px; border-left: 3px solid var(--cpt-orange); border-radius: 8px; background: rgba(255, 166, 0, 0.15); font-size: 0.76rem; }
.cpt-succes { margin-bottom: 10px; padding: 7px 10px; border-left: 3px solid var(--cpt-valide); border-radius: 8px; background: rgba(126, 231, 135, 0.15); font-size: 0.78rem; }
.cpt-info button, .cpt-lien-bouton { padding: 0; border: 0; background: none; color: var(--cpt-orange); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.cpt-lien-bouton:focus-visible { border-radius: 4px; outline: 2px solid #fff; }
.cpt-brouillon { margin-top: 10px; color: var(--cpt-texte-doux); font-size: 0.68rem; text-align: center; }
.cpt-separateur { margin: 12px 0 9px; border: 0; border-top: 1px solid rgba(255, 255, 255, 0.2); }

/* Code de confirmation */
.cpt-mail { display: grid; justify-items: center; gap: 8px; font-size: 0.86rem; text-align: center; }
.cpt-mail > i { color: var(--cpt-orange); font-size: 2rem; }
.cpt-mail > i.cpt-bienvenue { color: var(--cpt-valide); }
.cpt-mail h2 { font-size: 1.05rem; }
.cpt-mail strong { overflow-wrap: anywhere; }
#mail-envoye { display: block; }   /* l'adresse sur sa propre ligne, plutôt que coupée après la première lettre */
.cpt-mail .cpt-champ { width: 100%; }
.cpt-plein { width: 100%; }
.cpt-saisie--code input { padding-right: 32px; font-size: 1.05rem; font-weight: 700; letter-spacing: 0.3em; text-align: center; }
.cpt-saisie--code input::placeholder { font-size: 0.85rem; font-weight: 400; letter-spacing: normal; }

/* Fenêtre de connexion ouverte depuis la navbar, par-dessus n'importe quelle page (navbar.php) */
.cpt-fenetre { width: min(320px, calc(100% - 24px)); max-width: none; max-height: calc(100% - 24px); margin: auto; padding: 0; overflow: visible; border: 0; background: none; color: #fff; }
.cpt-fenetre::backdrop { background: rgba(0, 0, 0, 0.55); }
.cpt--fenetre { padding: 0; }
.cpt--fenetre .cpt-carte { position: relative; width: 100%; max-height: calc(100vh - 24px); overflow-y: auto; background: rgba(15, 18, 24, 0.6); }
.cpt-titre { font-size: 1.35rem; font-weight: 700; text-align: center; }
.cpt-fermer { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: #fff; font-size: 1rem; cursor: pointer; }
.cpt-fermer:hover { background: rgba(255, 255, 255, 0.12); }
.cpt-fermer:focus-visible { outline: 2px solid #fff; }

/* Carte posée dans une autre page (inscription express de la chasse au trésor) */
.cpt--integre { padding: 0; }
.cpt--integre .cpt-carte { margin: 0 auto; padding: 6px 4px 4px; border: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }   /* la page hôte fournit déjà le cadre */

@media (prefers-reduced-motion: reduce) {
    .cpt *, .cpt *::before { transition: none !important; }
}
