/* Thème du site public et des pages de connexion : dégradés bleus, cartes givrées, boutons en pilule. */
:root {
  --primaire: #255ffd;
  --primaire-fonce: #1a47cc;
  --primaire-doux: #e6eeff;
  --accent-clair: #9cc5ff;
  --encre: #0a1f4f;
  --encre-2: #012265;
  --encre-3: #0b3fb0;
  --texte: #16264d;
  --texte-doux: #4a5a7d;
  --trait: #dfe7f5;
  --trait-fort: #c3d0e8;
  --fond: #f5f8fd;
  --rayon: 16px;
  --rayon-sm: 12px;
  --ombre: 0 8px 24px rgba(16, 58, 150, .08);
  --ombre-haute: 0 18px 44px rgba(16, 58, 150, .18);
  --anneau: rgba(37, 95, 253, .2);
  --focus: #255ffd;
  --fond-non-lu: #f0f5ff;
  --fond-survol: #f3f7ff;
  --fond-entete-table: #f5f8fe;
  --degrade: linear-gradient(115deg, #012265 0%, #0b3fb0 45%, #2f74ee 80%, #5b9bf5 100%);
  --carte-image-fond: linear-gradient(120deg, #0b3fb0, #3b7eed);

  --bs-body-color: var(--texte);
  --bs-body-bg: var(--fond);
  --bs-border-color: var(--trait);
  --bs-primary: var(--primaire);
  --bs-primary-rgb: 37, 95, 253;
  --bs-link-color: var(--primaire);
  --bs-link-color-rgb: 37, 95, 253;
  --bs-link-hover-color: var(--primaire-fonce);
  --bs-link-hover-color-rgb: 26, 71, 204;
}

h1, h2, h3, .titre-serif { font-weight: 700; letter-spacing: -.02em; }
.btn { --bs-btn-border-radius: 999px; padding-inline: 1.15rem; }
.btn-primary { box-shadow: 0 8px 20px rgba(37, 95, 253, .28); }
.btn-primary:hover { box-shadow: 0 10px 24px rgba(37, 95, 253, .36); }

/* Barre de navigation */
.nav-public { background: var(--degrade); border-bottom: 1px solid rgba(255, 255, 255, .16); }
.nav-public .navbar-brand, .nav-public .navbar-brand:hover { color: #fff; }
.nav-public .navbar-brand img { background: #fff; border-radius: 50%; padding: 2px; }
.nav-public .navbar-brand small { color: #d6e4ff; }
.nav-public .nav-link { color: #fff; border-radius: 999px; font-size: .92rem; }
.nav-public .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .14); }
.nav-public .nav-link.actif { color: #fff; background: var(--primaire); }
.nav-public :focus-visible, .heros :focus-visible, .auth-visuel :focus-visible, .pied-public :focus-visible, .bandeau-page :focus-visible { outline-color: #fff; }

/* Héros */
.heros { background: var(--degrade); padding: 4.5rem 0 8.5rem; }
/* Halos décoratifs de la maquette */
.heros::before, .heros::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.heros::before { width: 460px; height: 460px; top: -150px; right: 6%; background: radial-gradient(circle, rgba(255, 255, 255, .24), transparent 68%); }
.heros::after { width: 340px; height: 340px; bottom: -120px; left: -80px; background: radial-gradient(circle, rgba(120, 180, 255, .45), transparent 70%); }
.heros h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); max-width: 16ch; }
.heros h1 em { font-style: normal; color: var(--accent-clair); }
.heros .accroche { color: #e4edff; }
.heros .surtitre { display: inline-flex; align-items: center; gap: .45rem; text-transform: none; letter-spacing: 0; font-size: .85rem; color: #fff; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28); padding: .35rem .85rem; border-radius: 999px; }
.btn-givre { --bs-btn-color: #fff; --bs-btn-bg: rgba(255, 255, 255, .1); --bs-btn-border-color: rgba(255, 255, 255, .6); --bs-btn-hover-color: var(--encre); --bs-btn-hover-bg: #fff; --bs-btn-hover-border-color: #fff; --bs-btn-active-color: var(--encre); --bs-btn-active-bg: #fff; }
.medaillon { position: relative; width: min(340px, 78vw); aspect-ratio: 1; margin-inline: auto; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .3); box-shadow: 0 0 0 26px rgba(255, 255, 255, .06), 0 0 0 58px rgba(255, 255, 255, .04); }
.medaillon img { width: 62%; height: auto; border-radius: 50%; background: #fff; padding: 8px; box-shadow: var(--ombre-haute); }
.trace-ecg { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='120' viewBox='0 0 480 120'%3E%3Cpath d='M0 70h150l14-18 14 18h24l10 14 16-74 18 92 12-32h36l18-14 16 14h152' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E"); opacity: .28; }

html[dir="rtl"] .heros::before { right: auto; left: 6%; }
html[dir="rtl"] .heros::after { left: auto; right: -80px; }

/* Cartes d'accès, à cheval sur le héros */
.cartes-acces { position: relative; z-index: 2; margin-top: -5.5rem; }
.carte-acces { display: flex; gap: .9rem; align-items: flex-start; height: 100%; padding: 1.15rem; border-radius: var(--rayon); text-decoration: none; color: var(--texte); background: rgba(255, 255, 255, .86); border: 1px solid rgba(255, 255, 255, .9); box-shadow: var(--ombre-haute); backdrop-filter: blur(10px); transition: box-shadow var(--duree), background-color var(--duree); }
.carte-acces:hover { color: var(--texte); background: #fff; box-shadow: 0 22px 50px rgba(16, 58, 150, .26); }
.carte-acces strong { display: block; color: var(--encre); margin-bottom: .15rem; }
.carte-acces small { color: var(--texte-doux); display: block; line-height: 1.4; }
.carte-acces .fleche { margin-top: .4rem; color: var(--primaire); display: block; }
.tuile { width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.2rem; }
.tuile-bleu { background: #255ffd; }
.tuile-teal { background: #0d8f85; }
.tuile-orange { background: #d9730a; }
.tuile-violet { background: #7c3fe0; }

/* À propos et chiffres */
.surtitre-section { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--primaire); margin-bottom: .5rem; }
.titre-section h2 em, .a-propos h2 em { font-style: normal; color: var(--primaire); }
.a-propos h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); }
.liste-departements { list-style: none; padding: 0; margin: 1.25rem 0 1.5rem; display: grid; gap: .6rem; }
.liste-departements li { display: flex; gap: .6rem; align-items: center; }
.liste-departements i { color: var(--primaire); }
.chiffre-ligne { display: flex; align-items: center; gap: .9rem; padding: .9rem 0; border-bottom: 1px solid var(--trait); }
.chiffre-ligne:last-child { border-bottom: 0; }
.chiffre-ligne strong { font-size: 1.5rem; color: var(--encre); display: block; line-height: 1.15; font-variant-numeric: tabular-nums; }
.chiffre-ligne span.libelle { color: var(--texte-doux); font-size: .88rem; }
.tuile-douce { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; background: var(--primaire-doux); color: var(--primaire); }

/* Parcours et actualités */
.section-publique.alt { background: linear-gradient(180deg, #eef4ff, #f5f8fd); border: 0; }
.parcours-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .75rem; }
.parcours-item { display: flex; align-items: center; gap: .7rem; padding: .8rem .9rem; border-radius: var(--rayon-sm); background: #fff; box-shadow: var(--ombre); font-weight: 500; font-size: .92rem; color: var(--encre); }
.annonce { display: block; padding: .85rem 0; border-bottom: 1px solid var(--trait); text-decoration: none; color: var(--texte); }
.annonce:last-child { border-bottom: 0; }
.annonce:hover strong { color: var(--primaire); }
.annonce strong { display: block; color: var(--encre); transition: color var(--duree); }

/* Cartes de contenu et pages intérieures */
.carte, .carte-contenu { border-color: transparent; box-shadow: var(--ombre); }
a.carte-contenu:hover { border-color: transparent; box-shadow: var(--ombre-haute); }
.carte-contenu h3 { font-weight: 600; font-size: 1.05rem; letter-spacing: -.01em; }
.carte-image { background: var(--carte-image-fond); }
.etiquette { background: var(--primaire-doux); color: var(--primaire-fonce); border-radius: 999px; padding: .15rem .65rem; font-weight: 500; }
.bandeau-page { background: var(--degrade); border: 0; color: #fff; padding: 2.75rem 0; }
.bandeau-page h1 { color: #fff; }
.bandeau-page p { color: #e4edff; }
.bandeau-page .fil-ariane a { color: #d6e4ff; }
.bandeau-page .fil-ariane a:hover { color: #fff; }
.pied-public { background: var(--degrade); color: #dbe7ff; }
.pied-public a { color: #fff; }
.pied-public hr { border-color: rgba(255, 255, 255, .3) !important; }

/* Connexion et inscription */
.page-auth { background: var(--fond); }
.auth-visuel { background: var(--degrade); }
.auth-visuel p { color: #e4edff; }
.choix-profil { background: #fff; border-color: transparent; box-shadow: var(--ombre); }

@media (max-width: 575.98px) {
  .heros { padding: 3rem 0 7.5rem; }
  .cartes-acces { margin-top: -4.5rem; }
  .medaillon { width: 58vw; box-shadow: 0 0 0 16px rgba(255, 255, 255, .06); }
}

/* Téléphone : site public et connexion. La barre du bas (.nav-mobile) porte la navigation, l'en-tête la langue et l'inscription. */
@media (max-width: 767.98px) {
  .nav-public .navbar-toggler, .nav-public .navbar-collapse { display: none !important; }
  .nav-public .container { flex-wrap: nowrap; }
  .nav-public .navbar-brand { margin-inline-end: .5rem; }
  .nav-public .navbar-brand img { width: 44px; height: 44px; }
  .actions-tel { display: flex; align-items: center; gap: .4rem; margin-inline-start: auto; }
  .actions-tel .btn { padding-inline: .7rem; font-size: .85rem; }
  body:has(.nav-mobile) .sb-barre { bottom: calc(66px + env(safe-area-inset-bottom)); }

  .section-publique { padding: 2rem 0; }
  .titre-section { margin-bottom: 1rem; }
  .titre-section h2, .a-propos h2 { font-size: 1.55rem; }
  .bandeau-page { padding: 1.4rem 0; }
  .bandeau-page h1 { font-size: 1.55rem; }
  .fil-ariane { margin-bottom: 0; }
  .fil-ariane a { display: inline-flex; align-items: center; min-height: 44px; }

  /* Listes : la recherche et le bouton Filtres sur une ligne, les résultats arrivent tout de suite. */
  .filtres-publics > .form-control { flex: 1 1 0; min-width: 0; max-width: none !important; }
  .filtres-publics:not(.ouverte) .zone-filtres { display: none; }
  .filtres-publics.ouverte .zone-filtres { display: flex; flex-wrap: wrap; gap: .5rem; width: 100%; }
  .filtres-publics .zone-filtres > * { flex: 1 1 100%; width: 100% !important; max-width: none !important; }

  /* Accueil */
  .heros { padding: 1.75rem 0 6.5rem; }
  .heros h1 { font-size: 1.9rem; }
  .heros .accroche { font-size: 1rem; margin-bottom: 1.1rem; }
  .heros .btn-lg { flex: 1 1 100%; }
  .cartes-acces { margin-top: -4.5rem; }
  .carte-acces { flex-direction: column; gap: .5rem; padding: .85rem; }
  .carte-acces small, .carte-acces .fleche { display: none; }
  .carte-acces strong { margin-bottom: 0; line-height: 1.25; }
  .carte-acces .tuile { width: 40px; height: 40px; font-size: 1.05rem; }
  .grille-chiffres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem .75rem; }
  .grille-chiffres .chiffre-ligne { border: 0; padding: .4rem 0; gap: .55rem; }
  .grille-chiffres .tuile-douce { width: 36px; height: 36px; font-size: 1rem; }
  .grille-chiffres .chiffre-ligne span.libelle { display: block; font-size: .78rem; line-height: 1.2; }
  .parcours-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .parcours-item { padding: .6rem .7rem; font-size: .82rem; line-height: 1.25; }
  .parcours-item .tuile { display: none; }

  .carte-corps > .d-flex > a.small { display: inline-flex; align-items: center; min-height: 44px; flex-shrink: 0; }

  /* Offres et formations de l'accueil : on les fait défiler du doigt plutôt que de tout empiler. */
  .rail-mobile { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: .75rem; scrollbar-width: none; }
  .rail-mobile::-webkit-scrollbar { display: none; }
  .rail-mobile > * { flex: 0 0 82%; width: 82%; max-width: 82%; scroll-snap-align: start; }

  /* Fiches : l'action principale reste à portée de pouce, juste au-dessus de la barre du bas. */
  .action-fiche { position: fixed; inset-inline: 0; bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 1025; padding: .6rem .8rem; background: var(--surface); border-top: 1px solid var(--trait); box-shadow: var(--ombre); }
  body:has(.action-fiche) { padding-bottom: calc(124px + env(safe-area-inset-bottom)); }

  /* Pied de page : la navigation est déjà dans la barre du bas. */
  .pied-public { padding: 1.75rem 0 1rem; }
  .pied-public li { padding: 0; }
  .pied-public li a { display: flex; align-items: center; min-height: 44px; }

  /* Connexion */
  .auth-formulaire { padding: 3.75rem 1rem 1.5rem; }
  .auth-logo-mobile { width: 60px; height: 60px; padding: 3px; margin-bottom: .75rem; border-radius: 50%; background: var(--surface); box-shadow: var(--ombre); }
  .auth-boite h1 { font-size: 1.55rem; }
  [data-voir-mdp] { min-width: 44px; min-height: 44px; }
  .auth-boite p a, .auth-boite .text-end a { display: inline-flex; align-items: center; min-height: 44px; }
  .auth-boite .text-end { margin-bottom: .5rem !important; }
  .auth-boite .mt-4 { margin-top: .75rem !important; }
  .auth-boite .mt-2 { margin-top: 0 !important; }
}

/* Très petits écrans : le logo seul laisse la place à la langue et à l'inscription. */
@media (max-width: 359.98px) {
  .nav-public .navbar-brand span { display: none; }
}
