/* =============================================================================
   Santélite Académie - FORMATIONS INSTITUTIONNELLES (07/11/2026)
   1. Section de la page d'accueil (après le catalogue, avant « Devenir formateur ») : grande image à gauche,
      titre, paragraphe et bouton à droite ; une colonne sur mobile (image d'abord, sans déformation).
   2. Page « Demande de formation » : formulaire (classes existantes du formulaire de contact), information
      sur les frais du présentiel en rouge sur fond rouge très pâle (apparition progressive, sans saut), champ piège.
   Variables de la charte (site.php) : --bleu, --bleu-voile, --gris, --rayon-lg, --t-titre, --t-sous-titre…
   ========================================================================== */

/* 1. Section de l'accueil (disposition corrigée le 07/11/2026) ---------------
   Grande image à GAUCHE (proportions d'origine 1199 x 1312, sans recadrage sur ordinateur et tablette), bloc de texte
   à DROITE (titre, paragraphe, bouton) centré verticalement sur l'image. Fond : .accueil-fond--gris (site.php).
   Mobile : une colonne, image en tête, toujours en grand et sans déformation. */
.institution__grille {
    display: grid;
    grid-template-columns: 52fr 48fr;
    gap: clamp(2rem, 1rem + 4vw, 4.5rem);
    align-items: center;
}
.institution__visuel {
    border-radius: var(--rayon-lg);
    overflow: hidden;
    aspect-ratio: 1199 / 1312;           /* proportions de la photo : aucune déformation, aucun recadrage */
    background: #87C5F1;                 /* fond bleu ciel de la photo, visible pendant le chargement */
}
.institution__visuel img { display: block; width: 100%; height: 100%; object-fit: cover; }
.institution__contenu { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.institution__contenu > .institution__titre, .institution__contenu > .institution__texte { align-self: stretch; }   /* pleine largeur de la colonne : lignes équilibrées */
.institution__titre { font-size: var(--t-titre); margin: 0 0 var(--gap-md); text-wrap: balance; }   /* même taille que les autres grands titres */
.institution__texte {
    font-size: var(--t-sous-titre);
    font-weight: var(--poids-light);
    color: var(--texte-secondaire);
    line-height: 1.55;
    margin: 0 0 var(--gap-lg);
    max-width: 52ch;
}

@media (max-width: 760px) {
    .institution__grille { grid-template-columns: 1fr; gap: var(--gap-lg); }
    .institution__visuel { width: 100%; max-width: 520px; margin-inline: auto; aspect-ratio: 1199 / 1312; }
}
@media (max-width: 560px) {
    .institution__visuel { max-width: none; }                             /* pleine largeur, proportions d'origine */
    .institution__contenu .bouton { width: 100%; justify-content: center; }
}

/* 2. Page « Demande de formation » ----------------------------------------- */
.demande-formation__obligatoires { margin: 0; font-size: var(--t-mini); color: var(--texte-tertiaire); }
.demande-formation__formulaire .alerte { margin-bottom: 0; }
.demande-formation__formats { display: flex; flex-wrap: wrap; gap: var(--gap-sm); }
.demande-formation__format {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    min-height: 48px;
    padding: .7rem 1.1rem;
    border: 1px solid var(--bordure-forte);
    border-radius: var(--rayon);
    background: var(--blanc);
    font-size: var(--t-petit);
    font-weight: var(--poids-semibold);
    cursor: pointer;
    transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
}
.demande-formation__format input { width: 18px; height: 18px; margin: 0; accent-color: var(--bleu); }
.demande-formation__format:hover { border-color: var(--bleu); }
.demande-formation__format:has(input:checked) { border-color: var(--bleu); background: var(--bleu-voile); }
.demande-formation__format:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--bleu-voile); border-color: var(--bleu); }
.demande-formation__formats--erreur .demande-formation__format { border-color: var(--niveau-avance); }

/* Information « présentiel » : la hauteur passe de 0 à la hauteur du texte (grille 0fr -> 1fr), les champs suivants
   descendent progressivement au lieu de sauter ; aucune réserve d'espace quand l'option « En ligne » est choisie. */
.demande-formation__info-presentiel {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    visibility: hidden;
    transition: grid-template-rows 220ms ease, opacity 220ms ease, visibility 0s linear 220ms;
}
.demande-formation__info-presentiel.est-visible {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
    transition: grid-template-rows 220ms ease, opacity 220ms ease, visibility 0s;
}
.demande-formation__info-interieur { min-height: 0; overflow: hidden; }
.demande-formation__info {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    margin: var(--gap-sm) 0 0;
    padding: .85rem 1rem;
    border: 1px solid #F3C4BF;
    border-left: 4px solid #B42318;
    border-radius: var(--rayon);
    background: #FEF3F2;                  /* rouge très pâle (correction du 07/11/2026) */
    color: #B42318;                       /* texte rouge, contraste AA sur ce fond */
    font-size: var(--t-petit);
    line-height: 1.55;
}
.demande-formation__info strong { color: #912018; font-weight: var(--poids-semibold); }
.demande-formation__info-icone { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; fill: none; stroke: #B42318; stroke-width: 2; stroke-linecap: round; }
@media (prefers-reduced-motion: reduce) {
    .demande-formation__info-presentiel, .demande-formation__info-presentiel.est-visible { transition: none; }
}

.demande-formation__date { max-width: 320px; }
.demande-formation__certification { align-items: flex-start; font-size: var(--t-petit); line-height: 1.5; }
.demande-formation__certification input { flex-shrink: 0; margin-top: .2rem; }
.demande-formation__certification--erreur { color: var(--niveau-avance); }

/* Champ piège : hors écran (pas display:none, que certains robots repèrent), jamais atteint au clavier. */
.demande-formation__piege { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.demande-formation__confirmation:focus { outline: none; }
.demande-formation__confirmation .contact-confirmation__texte { margin: 0; }

@media (max-width: 560px) {
    .demande-formation__format { flex: 1 1 100%; }
    .demande-formation__date { max-width: none; }
    .demande-formation .contact__actions .bouton { width: 100%; justify-content: center; }
}

/* 3. Fenêtre de confirmation de la demande (08/11/2026) ------------------------
   Pop-up : textes et boutons alignés à gauche, espacements réguliers, boutons compacts côte à côte. */
.df-pop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, .55);
}
.df-pop[hidden] { display: none; }
html.df-pop-ouverte { overflow: hidden; }
.df-pop__boite {
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 1.5rem;
    border-radius: var(--rayon-lg);
    background: var(--blanc);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
    text-align: left;
}
.df-pop__boite:focus { outline: none; }
.df-pop__icone { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 1rem; border-radius: 50%; background: #E7F6EC; color: #157A3B; }
.df-pop__titre { margin: 0 0 .5rem; font-size: 1.25rem; line-height: 1.3; }
.df-pop__texte p { margin: 0 0 .5rem; font-size: var(--t-petit); line-height: 1.55; color: var(--texte-secondaire); }
.df-pop__texte p:last-child { margin-bottom: 0; }
.df-pop__actions { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: .75rem; margin-top: 1.25rem; }
.df-pop__actions .bouton { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 400px) {
    .df-pop__boite { padding: 1.25rem; }
    .df-pop__actions { gap: .5rem; }
    .df-pop__actions .bouton { padding-inline: .8rem; font-size: .875rem; }
}
