/*
 * LOGIN-C (28/10/2026) — pages d authentification au theme de la page d accueil (layouts.auth_c) :
 * /login, /password/reset, /password/reset/{token}, /password/force. Polices locales
 * (frontend/assets/fonts, SIL OFL 1.1) : Plus Jakarta Sans 700 (titres), Inter 400/500/600.
 * Deux colonnes ; sous 900 px le panneau passe sous le formulaire, sous 600 px ses telephones sont masques.
 */

@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../../../frontend/assets/fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../../../frontend/assets/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../../../frontend/assets/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../../../frontend/assets/fonts/inter-latin-600-normal.woff2") format("woff2"); }

:root {
    --ac-encre: #0D2238;
    --ac-texte: #44546A;
    --ac-lien: #0A6FB8;          /* 5,2:1 sur blanc, 5:1 sur #F5FAFE */
    --ac-bouton: #D63A3A;        /* texte blanc 4,6:1 */
    --ac-bouton-survol: #BE2F2F;
    --ac-corail-titre: #C83434;
    --ac-ciel: #38B6FF;
    --ac-champ: #C8D8EA;
    --ac-panneau: #F5FAFE;
    --ac-bordure: #E5EDF5;
    --ac-erreur-fond: #FFF1F0;
    --ac-erreur-texte: #9E2626;
    /* TYPO-MENU (28/10/2026) : echelle de texte (ordinateur -> telephone, bascule fluide entre 600 et 1 280 px). */
    --ac-t-h1: clamp(26px, calc(24.235px + 0.2941vw), 28px);
    --ac-t-accroche: clamp(24px, 2.8vh, 30px);
    --ac-t-bouton: clamp(15px, calc(16.882px - 0.1471vw), 16px);
    --ac-h-bouton: clamp(44px, calc(51.529px - 0.5882vw), 48px);
    --ac-titres: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --ac-corps: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.ac { margin: 0; background: #FFFFFF; color: var(--ac-texte); font-family: var(--ac-corps); font-size: 16px; line-height: 1.55; overflow-x: hidden; }
.ac p { margin: 0; }
.ac img { max-width: 100%; }
.ac a { color: var(--ac-lien); }
.ac a:focus-visible, .ac button:focus-visible, .ac input:focus-visible {
    outline: 3px solid var(--ac-lien); outline-offset: 2px;
}

/* ---------- Grille : panneau a gauche, colonne de droite en trois rangees ---------- */
.ac-page {
    min-height: 100vh; display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "panneau haut" "panneau main" "panneau pied";
}
.ac-haut { grid-area: haut; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 40px 0; }
.ac-main { grid-area: main; display: flex; align-items: center; justify-content: center; padding: 32px 40px; }
.ac-pied { grid-area: pied; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 12px; padding: 0 40px 20px; font-size: 14px; }
.ac-panneau { grid-area: panneau; background: var(--ac-panneau); border-right: 1px solid var(--ac-bordure); padding: 40px 48px 0; display: flex; flex-direction: column; overflow: hidden; min-height: 100vh; }

.ac-lien-haut, .ac-pied-liens a, .ac .ac-lien {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; color: var(--ac-lien); text-decoration: none;
}
.ac-lien-haut:hover, .ac-pied-liens a:hover, .ac .ac-lien:hover { text-decoration: underline; text-underline-offset: 4px; }
.ac-pied-liens { display: flex; gap: 4px 12px; flex-wrap: wrap; }
.ac-pied-liens a { padding: 0 4px; font-weight: 500; }
.ac-pied > span::after { content: "·"; margin-left: 12px; color: var(--ac-texte); }

/* ---------- Panneau ---------- */
.ac-logo { display: inline-flex; align-items: center; min-height: 44px; align-self: flex-start; }
.ac-logo img { display: block; height: 44px; width: auto; }
.ac-accroche { font-family: var(--ac-titres); font-weight: 700; font-size: var(--ac-t-accroche); line-height: 1.2; letter-spacing: -0.015em; color: var(--ac-encre); margin: 36px 0 24px !important; max-width: 14em; }
.ac-bleu { color: var(--ac-lien); white-space: nowrap; }
.ac-corail { color: var(--ac-corail-titre); }
.ac-coches { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ac-coches li { position: relative; padding-left: 34px; color: var(--ac-encre); font-weight: 500; }
.ac-coches li::before { content: ""; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; background: var(--ac-lien); }
.ac-coches li::after { content: ""; position: absolute; left: 8px; top: 5px; width: 6px; height: 11px; border: solid #FFFFFF; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }

.ac-telephones { margin-top: auto; padding-top: 40px; display: flex; justify-content: center; align-items: flex-start; }
.ac-tel { background: var(--ac-encre); border-radius: 30px; padding: 7px; flex: none; }
.ac-tel img { display: block; width: 100%; height: 100%; border-radius: 24px; object-fit: cover; object-position: top center; background: #FFFFFF; }
.ac-tel-eleve { width: 170px; height: 350px; margin-top: 20px; margin-right: -18px; box-shadow: 0 16px 36px rgba(13, 34, 56, .16); }
.ac-tel-parent { width: 200px; height: 410px; position: relative; z-index: 1; box-shadow: 0 28px 60px rgba(13, 34, 56, .28); margin-bottom: -60px; }

/* ---------- Formulaire ---------- */
.ac-zone { width: 100%; max-width: 400px; }
.ac-titre { font-family: var(--ac-titres); font-weight: 700; font-size: var(--ac-t-h1); line-height: 1.2; letter-spacing: -0.01em; color: var(--ac-encre); margin: 0 0 10px; }
.ac-aide { font-size: 14px; margin-bottom: 24px !important; }
.ac-titre + .ac-encadre, .ac-titre + .ac-form { margin-top: 24px; }
.ac-form { display: grid; gap: 18px; }
.ac-champ { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ac-champ label { font-weight: 600; color: var(--ac-encre); font-size: 14px; }
.ac-libelle-ligne { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ac-libelle-ligne .ac-lien { font-size: 14px; }
.ac-champ input {
    width: 100%; min-height: 50px; padding: 14px; border: 1px solid var(--ac-champ); border-radius: 12px;
    font-family: var(--ac-corps); font-size: 16px; line-height: 1.3; color: var(--ac-encre); background: #FFFFFF;
}
.ac-champ input[readonly] { background: var(--ac-panneau); color: var(--ac-texte); }
.ac-champ input[aria-invalid="true"] { border-color: var(--ac-bouton); background: #FFFAFA; }
.ac-mdp { position: relative; }
.ac-mdp input { padding-right: 56px; }
.ac-oeil {
    position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--ac-texte);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.ac-oeil[hidden] { display: none; }
.ac-oeil:hover { background: var(--ac-panneau); color: var(--ac-encre); }
.ac-oeil .ac-oeil-barre, .ac-oeil[aria-pressed="true"] .ac-oeil-ouvert { display: none; }
.ac-oeil[aria-pressed="true"] .ac-oeil-barre { display: block; }
.ac-erreur { color: var(--ac-erreur-texte); font-size: 14px; font-weight: 600; }
.ac-regles { font-size: 14px; margin-top: 2px !important; }
.ac-regles strong { color: var(--ac-encre); font-weight: 600; }

.ac-bouton {
    width: 100%; min-height: var(--ac-h-bouton); padding: 10px 20px; border: 0; border-radius: 12px; cursor: pointer;
    background: var(--ac-bouton); color: #FFFFFF; font-family: var(--ac-corps); font-weight: 600; font-size: var(--ac-t-bouton);
}
.ac-bouton:hover { background: var(--ac-bouton-survol); }
.ac-bouton-lien { background: none; border: 0; padding: 0 8px; cursor: pointer; font-family: var(--ac-corps); font-size: 15px; }

.ac-encadre { border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; font-size: 14px; }
.ac-encadre-erreur { background: var(--ac-erreur-fond); color: var(--ac-erreur-texte); border: 1px solid #F6CBC7; font-weight: 600; }
.ac-encadre-info { background: var(--ac-panneau); color: var(--ac-encre); border: 1px solid var(--ac-bordure); }
.ac-sans-compte { margin: 24px 0 0; display: grid; gap: 4px; color: var(--ac-texte); }
.ac-retour, .ac-deconnexion { margin-top: 14px !important; display: flex; justify-content: center; }

/* ---------- Sous 900 px : une colonne, panneau sous le formulaire ---------- */
@media (max-width: 899px) {
    .ac-page { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto auto; grid-template-areas: "haut" "main" "panneau" "pied"; }
    .ac-haut { padding: 14px 20px 0; }
    .ac-main { padding: 24px 20px 40px; }
    .ac-panneau { min-height: 0; border-right: 0; border-top: 1px solid var(--ac-bordure); padding: 36px 24px 0; }
    .ac-pied { padding: 16px 20px 20px; background: var(--ac-panneau); }
    .ac-tel-parent { margin-bottom: -80px; }
    .ac-telephones { max-height: 380px; }
}
@media (max-width: 600px) {
    .ac-accroche { margin-top: 24px !important; }
    .ac-telephones { display: none; }
    .ac-panneau { padding-bottom: 32px; }
    .ac-pied { flex-direction: column; gap: 0; }
    .ac-pied > span::after { content: none; }
}

/* ---------- LOGIN-FIT (28/10/2026) : sur ordinateur (>= 900 px de large ET >= 640 px de haut),
   la page tient dans UN ecran : hauteur exacte de la fenetre, aucun defilement de page.
   Panneau : telephones entierement visibles, tailles et espacements indexes sur la hauteur (vh).
   Colonne droite : le formulaire defile DANS sa colonne si un message l allonge, jamais la page.
   Sous 900 px de large ou 640 px de haut : rien ne change (defilement normal). ---------- */
@media (min-width: 900px) and (min-height: 640px) {
    html, body.ac { height: 100%; overflow: hidden; }
    .ac-page { height: 100vh; height: 100dvh; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; }
    .ac-haut { padding-top: clamp(10px, 2vh, 20px); }
    .ac-main { min-height: 0; overflow-y: auto; align-items: flex-start; padding-top: clamp(8px, 2.4vh, 32px); padding-bottom: clamp(8px, 2.4vh, 32px); }
    .ac-zone { margin: auto 0; }
    .ac-pied { padding-bottom: clamp(8px, 2vh, 20px); }
    .ac-titre { margin-bottom: clamp(6px, 1vh, 10px); }
    .ac-aide { margin-bottom: clamp(14px, 2.4vh, 24px) !important; }
    .ac-form { gap: clamp(12px, 1.9vh, 18px); }
    .ac-encadre { margin-bottom: clamp(12px, 1.9vh, 18px); }
    .ac-sans-compte { margin-top: clamp(14px, 2.4vh, 24px); }

    .ac-panneau { min-height: 0; height: 100%; overflow: hidden; padding-top: clamp(20px, 4vh, 40px); }
    .ac-accroche { margin: clamp(14px, 3.4vh, 36px) 0 clamp(12px, 2.4vh, 24px) !important; }
    .ac-coches { gap: clamp(6px, 1.2vh, 12px); }
    .ac-telephones { padding-top: clamp(12px, 2.5vh, 40px); padding-bottom: clamp(16px, 3.5vh, 40px); }
    .ac-tel-parent { height: min(410px, 46vh); width: auto; aspect-ratio: 200 / 410; margin-bottom: 0; }
    .ac-tel-eleve { height: min(350px, 39vh); width: auto; aspect-ratio: 170 / 350; margin-top: min(20px, 2.2vh); }
}

/* ---------- LOGIN-FIT2 (28/10/2026) : formulaire de 480 px, aide et encadre en 14 px (toutes largeurs ;
   sous 900 px la zone reste bornee par l ecran). ---------- */
@media (min-width: 900px) and (min-height: 640px) {
    .ac-zone { max-width: 480px; }
    .ac-aide { font-size: 14px; }
    .ac-encadre { font-size: 14px; }
    /* 480 px de formulaire meme a 1 024 px : marges laterales de la colonne ramenees jusqu a 16 px. */
    .ac-main { padding-left: clamp(16px, calc((50vw - 480px) / 2), 40px); padding-right: clamp(16px, calc((50vw - 480px) / 2), 40px); }
}

/* ---------- LOGIN-FIT2 : alignement des deux colonnes (mode une page, navigateurs avec subgrid).
   Rangees de la page : en-tete | espace | titre | coches | telephones | espace | pied.
   Le panneau reprend ces rangees (subgrid) : logo au niveau de « Retour a l accueil », titre au niveau
   du H1 (le formulaire occupe les rangees titre a telephones, aligne en haut), telephones juste sous les
   coches, decales vers la droite. Le couple formulaire + panneau est centre par les deux rangees d espace.
   Sans subgrid : mise en page LOGIN-FIT inchangee. ---------- */
@supports (grid-template-rows: subgrid) {
    @media (min-width: 900px) and (min-height: 640px) {
        .ac-page {
            --ac-h-parent: min(410px, 46vh);
            --ac-h-eleve: min(350px, 39vh);
            --ac-l-groupe: calc(var(--ac-h-parent) * 200 / 410 + var(--ac-h-eleve) * 170 / 350 - 18px);
            grid-template-rows: auto minmax(0, 1fr) auto auto auto minmax(0, 1fr) auto;
            grid-template-areas: none;
        }
        .ac-haut { grid-column: 2; grid-row: 1; }
        .ac-main { grid-column: 2; grid-row: 3 / 6; align-self: start; max-height: 100%; padding-top: 0; padding-bottom: 0; }
        .ac-zone { margin: 0; }
        .ac-pied { grid-column: 2; grid-row: 7; }

        .ac-panneau { grid-column: 1; grid-row: 1 / -1; display: grid; grid-template-rows: subgrid; padding-top: 0; padding-bottom: 0; }
        .ac-logo { grid-row: 1; align-self: center; padding-top: clamp(10px, 2vh, 20px); }
        .ac-accroche { grid-row: 3; margin: 0 0 clamp(12px, 2.4vh, 24px) !important; }
        .ac-coches { grid-row: 4; align-self: start; }
        .ac-telephones {
            grid-row: 5; margin-top: 0; padding-top: clamp(12px, 2.6vh, 28px); padding-bottom: 0;
            justify-content: flex-start;
            /* centre du groupe au milieu de la moitie droite, sans jamais depasser le bord droit */
            padding-left: max(0px, min(calc(75% - var(--ac-l-groupe) / 2), calc(100% - var(--ac-l-groupe))));
        }
    }
}

/* ---------- LOGIN-DEMO (28/10/2026) : fenetre « Demander une demonstration » de /login (<dialog>).
   Theme auth-c ; fond assombri ; defile a l interieur ; plein ecran sous 600 px. ---------- */
.ac-dialog {
    width: calc(100% - 32px); max-width: 560px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
    margin: auto; padding: 24px 28px 28px; border: 0; border-radius: 18px; overflow-y: auto;
    background: #FFFFFF; color: var(--ac-texte); font-family: var(--ac-corps); font-size: 16px; line-height: 1.55;
    box-shadow: 0 30px 80px rgba(13, 34, 56, .35);
}
.ac-dialog::backdrop { background: rgba(13, 34, 56, .55); }
.ac-dialog-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.ac-dialog-tete form { margin: 0; }
.ac-dialog-titre { font-family: var(--ac-titres); font-weight: 700; font-size: 22px; line-height: 1.25; color: var(--ac-encre); margin: 8px 0 0; }
.ac-dialog-fermer {
    width: 44px; height: 44px; flex: none; border: 0; border-radius: 10px; background: var(--ac-panneau); color: var(--ac-encre);
    font-size: 26px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; margin: -4px -8px 0 0;
}
.ac-dialog-fermer:hover { background: var(--ac-bordure); }
.ac-dialog .ac-aide { font-size: 14px; margin-bottom: 18px !important; }
.ac-dialog .ac-form { gap: 14px; }
.ac-champs-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ac-champ select, .ac-champ textarea {
    width: 100%; min-height: 50px; padding: 14px; border: 1px solid var(--ac-champ); border-radius: 12px;
    font-family: var(--ac-corps); font-size: 16px; line-height: 1.3; color: var(--ac-encre); background: #FFFFFF;
}
.ac-champ textarea { resize: vertical; min-height: 96px; }
.ac-champ select[aria-invalid="true"], .ac-champ textarea[aria-invalid="true"] { border-color: var(--ac-bouton); background: #FFFAFA; }
.ac .ac-champ select:focus-visible, .ac .ac-champ textarea:focus-visible { outline: 3px solid var(--ac-lien); outline-offset: 2px; }
.ac-piege { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.ac-mention { font-size: 14px; text-align: center; }
@media (max-width: 600px) {
    .ac-dialog { width: 100%; max-width: 100%; max-height: 100vh; max-height: 100dvh; height: 100%; margin: 0; border-radius: 0; padding: 18px 16px 24px; }
    .ac-champs-2 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- TYPO-MENU (28/10/2026) : message de succes de la fenetre de demo, meme style que l accueil
   (fond vert clair, texte vert fonce : 5,8:1). ---------- */
.ac-dialog .ac-encadre-info[role="status"] { background: #E7F6EE; color: #146C3C; border-color: #BFE6CF; font-weight: 600; }
