:root {
  --navy: #0f3557;
  --navy-dark: #0a2540;
  --accent: #e0a100;
  --text: #1f2933;
  --muted: #5b6875;
  --light: #f3f6f9;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html { color-scheme: light; }
body { margin: 0; background: #fff; font: 17px/1.65 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--text); }
img { max-width: 100%; height: auto; }
a { color: var(--navy); }
h1, h2, h3, h4 { line-height: 1.25; color: var(--navy-dark); }
h1 { font-size: 2.3rem; margin: .4em 0 .6em; }
h2 { font-size: 1.6rem; margin-top: 2em; }
h3 { font-size: 1.2rem; margin-top: 1.6em; }

/* En-tête */
.site-header { background: var(--navy); position: sticky; top: 0; z-index: 10; }
.bar { max-width: 1200px; margin: auto; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.brand { display: flex; align-items: center; padding: 10px 0; flex-shrink: 0; }
.brand img { display: block; height: 46px; width: auto; }
.site-header nav > ul { list-style: none; margin: 0; padding: 0; display: flex; }
.site-header nav a { display: block; color: #fff; text-decoration: none; padding: 20px 12px; font-size: .92rem; }
.site-header nav a:hover, .site-header nav a.active { color: var(--accent); }
.has-sub { position: relative; }
.has-sub ul { display: none; position: absolute; left: 0; top: 100%; background: var(--navy-dark); list-style: none; padding: 6px 0; margin: 0; min-width: 210px; }
.has-sub:hover ul, .has-sub:focus-within ul { display: block; }
.has-sub ul a { padding: 10px 16px; }
.has-sub .sub-title { display: block; color: #fff; padding: 10px 16px 4px; font-size: .92rem; }
.has-sub ul.sub-sub { display: block; position: static; background: none; padding: 0 0 4px 14px; min-width: 0; }
.has-sub ul.sub-sub a { padding: 6px 16px; font-size: .88rem; }
.menu-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; }

/* Contenu */
.page { max-width: 900px; margin: 0 auto; padding: 30px 20px 50px; }
.page.wide, .wide .page { max-width: 1200px; }
.hero { background: var(--navy) center/cover no-repeat; position: relative; color: #fff; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,37,64,.88), rgba(10,37,64,.45)); }
.hero-inner { position: relative; max-width: 1200px; margin: auto; padding: 110px 20px 90px; }
.hero h1 { color: #fff; font-size: 2.8rem; max-width: 760px; margin: .2em 0; }
.hero p { max-width: 680px; font-size: 1.15rem; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .85rem !important; color: var(--accent); }
.lead { font-size: 1.2rem; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 24px; margin: 30px 0; }
/* Cartes centrées, largeur fixe (quand il y en a moins de 3) */
.cards.centered { grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 270px)); justify-content: center; }
.card { background: #fff; border: 1px solid #e2e8ee; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.card div { padding: 18px 20px 22px; flex: 1; }
.card h3 { margin-top: 0; }
.card a.more { font-weight: 600; text-decoration: none; }

.figure { margin: 30px 0; text-align: center; }
.figure img { border-radius: var(--radius); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; margin: 30px 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 20px; margin: 24px 0; }
.stat { background: var(--light); border-radius: var(--radius); padding: 20px; text-align: center; }
.stat b { display: block; font-size: 2.4rem; color: var(--navy); }
.logos { display: flex; flex-wrap: wrap; gap: 16px; background: var(--navy-dark); padding: 20px; border-radius: var(--radius); justify-content: center; }
.logos img { width: 130px; }
.course-list li { margin: .4em 0; }

.button { display: inline-block; background: var(--accent); color: var(--navy-dark); padding: 12px 24px; border-radius: 6px; font-weight: 600; text-decoration: none; margin: 4px 8px 4px 0; }
.button.ghost { background: transparent; color: #fff; border: 2px solid #fff; }
.cta { background: var(--navy); color: #fff; text-align: center; }
.cta h2 { color: #fff; margin-top: 0; }
.cta .page { padding: 50px 20px; }

form.contact { display: grid; gap: 14px; max-width: 600px; }
form.contact label { font-weight: 600; font-size: .95rem; }
form.contact input, form.contact textarea, form.contact select { width: 100%; padding: 11px; border: 1px solid #c8d1da; border-radius: 6px; font: inherit; }
form.contact button { justify-self: start; border: 0; cursor: pointer; font-size: 1rem; }
.hidden { display: none; }
/* Tableau trop large sur téléphone : il défile horizontalement dans son cadre */
.defile { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Pied de page */
.site-footer { background: var(--navy-dark); color: #cfd8e2; font-size: .92rem; }
.site-footer a { color: #fff; }
.site-footer .cols { max-width: 1200px; margin: auto; padding: 40px 20px 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 30px; }
.site-footer img { background: #fff; padding: 8px; border-radius: 6px; }
.copy { text-align: center; padding: 10px 0 24px; margin: 0; color: #8fa0b3; }

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .brand img { height: 40px; }
  .site-header nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--navy); }
  .nav-open .site-header nav { display: block; }
  .site-header nav > ul { flex-direction: column; }
  .has-sub ul { display: block; position: static; background: none; padding-left: 16px; }
  .has-sub .sub-title { padding: 12px 20px 4px; }
  .site-header nav a { padding: 12px 20px; }
  .split { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  h1 { font-size: 1.9rem; }
  /* Menu ouvert plus long que l'écran : il défile */
  .site-header nav { max-height: calc(100vh - 60px); overflow-y: auto; }
}

/* Téléphones */
@media (max-width: 600px) {
  body { font-size: 16.5px; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.4rem; margin-top: 1.5em; }
  h3 { margin-top: 1.3em; }
  .page { padding: 20px 18px 36px; }
  .bar { padding: 0 14px 0 18px; }
  .menu-toggle { padding: 8px 6px; min-width: 44px; min-height: 44px; }
  /* Bandeau photo moins haut : le texte et le début de la page restent visibles */
  .hero-inner { padding: 48px 18px 40px; }
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 1.05rem; }
  .lead { font-size: 1.08rem; }
  .cards { gap: 18px; margin: 20px 0; }
  .split { gap: 20px; margin: 20px 0; }
  .stat b { font-size: 2rem; }
  .logos img { width: 110px; }
  /* Boutons faciles à toucher, sur toute la largeur */
  p > a.button { display: block; text-align: center; padding: 14px 20px; margin: 10px 0; }
  form.contact button { justify-self: stretch; padding: 14px 20px; }
  /* Champs à 16 px minimum : sinon l'iPhone zoome automatiquement pendant la saisie */
  input, select, textarea { font-size: 16px !important; }
  .assistant .lien-btn, .apercu .lien-btn { padding: 9px 0; }
  .cta .page { padding: 36px 18px; }
  /* Pied de page : liens espacés pour le doigt */
  .site-footer .cols { padding: 30px 18px 6px; gap: 22px; }
  .site-footer a { display: inline-block; padding: 7px 0; }
}

/* Assistant formation continue et demande de formation */
.alerte { background: #fff6dd; border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 6px; font-size: .95rem; }
.assistant { margin-top: 20px; }
.assistant-barre { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: center; background: var(--light, #f3f6f9); padding: 10px 14px; border-radius: 8px; font-size: .92rem; }
.assistant-outils { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.lien-btn { background: none; border: 0; color: var(--navy); text-decoration: underline; cursor: pointer; font: inherit; padding: 2px 0; }
.badge { font-size: .75rem; color: #6b7a89; transition: color .3s; }
.badge.ok { color: #1a7f37; }
.etapes { list-style: none; padding: 0; margin: 18px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.etapes button { border: 1px solid #c8d1da; background: #fff; border-radius: 20px; padding: 7px 14px; cursor: pointer; font: inherit; font-size: .88rem; color: var(--navy-dark); }
.etapes button.actif { background: var(--navy); border-color: var(--navy); color: #fff; }
.etape { border: 1px solid #e2e8ee; border-radius: var(--radius); padding: 6px 22px 20px; background: #fff; }
.etape .aide { color: var(--muted); font-size: .95rem; margin-top: -4px; }
.info-formation { background: #eef2f7; padding: 10px 14px; border-radius: 6px; }
.champs { display: grid; gap: 14px; }
.champ { display: grid; gap: 5px; font-weight: 600; font-size: .95rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.champ legend { padding: 0; margin-bottom: 4px; }
.champ input, .champ textarea, .champ select, .tableau-saisie input, .tableau-saisie select { width: 100%; padding: 10px; border: 1px solid #c8d1da; border-radius: 6px; font: inherit; font-weight: 400; box-sizing: border-box; }
.radio { display: flex; gap: 8px; align-items: baseline; font-weight: 400; padding: 3px 0; }
.radio input, form.contact .radio input, form.contact input[type=checkbox] { width: auto; }
.req { color: #b42318; }
.nav-etapes { display: flex; justify-content: space-between; margin-top: 22px; gap: 10px; }
button.button { border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.button.secondaire { background: #fff; color: var(--navy); border: 1px solid var(--navy); padding: 9px 16px; }
.tableau-saisie { width: 100%; border-collapse: collapse; }
.tableau-saisie th { text-align: left; font-size: .85rem; color: var(--muted); padding: 4px; }
.tableau-saisie td { padding: 4px; vertical-align: middle; }
.docs { display: grid; gap: 10px; }
.doc-ligne { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid #e2e8ee; border-radius: 8px; padding: 10px 14px; }
.doc-ligne small { color: var(--muted); }
.doc-actions .button { margin: 2px 0 2px 6px; padding: 8px 14px; font-size: .9rem; }
.apercu { margin-top: 20px; border: 1px solid #c8d1da; border-radius: 8px; overflow: hidden; }
.apercu-tete { display: flex; justify-content: space-between; padding: 8px 14px; background: #eef2f7; }
.apercu iframe { width: 100%; height: 75vh; border: 0; background: #fff; }
/* L'attribut hidden doit l'emporter sur display des boutons (.button, form.contact button) */
.demande [hidden], .assistant [hidden] { display: none !important; }
.demande-progress { color: var(--muted); font-size: .9rem; }
@media (max-width: 700px) {
  .tableau-saisie thead { display: none; }
  .tableau-saisie tr { display: grid; gap: 4px; border: 1px solid #e2e8ee; border-radius: 8px; padding: 8px; margin-bottom: 10px; }
  .tableau-saisie td { display: grid; gap: 2px; }
  .tableau-saisie td[data-label]::before { content: attr(data-label); font-size: .8rem; color: var(--muted); }
  .etape { padding: 4px 14px 16px; }
  .doc-actions .button { margin: 2px 6px 2px 0; }
}

/* Assistant : liste des dossiers et tableau de suivi */
.grille-suivi { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 10px 0 16px; }
.grille-suivi th, .grille-suivi td { border: 1px solid #e2e8ee; padding: 7px 8px; text-align: left; vertical-align: middle; }
.grille-suivi th { background: var(--light); color: var(--navy-dark); font-weight: 600; }
.grille-suivi tr.courant td { background: #fff6dd; }
.grille-suivi td.actions { white-space: nowrap; }
.filtres { display: flex; flex-wrap: wrap; gap: 12px 20px; margin: 10px 0 16px; }
.filtres .champ { min-width: min(240px, 100%); }
.assistant .stats { margin: 16px 0; }
.assistant .stat small { color: var(--muted); }
