/* ==========================================================================
   SCPE CRÉSUS — maquette. Charte graphique CRÉSUS 2025 :
   Raleway uniquement (titres ExtraBold, sous-titres Bold, corps Medium),
   texte en bleu nuit (jamais de noir), jaune or par touches,
   bleu lapis-lazuli en grands fonds structurants.
   ========================================================================== */

@font-face { font-family: "Raleway"; font-weight: 300; font-display: swap; src: url("../fonts/Raleway-Light.woff2") format("woff2"); }
@font-face { font-family: "Raleway"; font-weight: 500; font-display: swap; src: url("../fonts/Raleway-Medium.woff2") format("woff2"); }
@font-face { font-family: "Raleway"; font-weight: 600; font-display: swap; src: url("../fonts/Raleway-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Raleway"; font-weight: 700; font-display: swap; src: url("../fonts/Raleway-Bold.woff2") format("woff2"); }
@font-face { font-family: "Raleway"; font-weight: 800; font-display: swap; src: url("../fonts/Raleway-ExtraBold.woff2") format("woff2"); }

:root {
  /* Couleurs principales */
  --nuit: #081343;
  --or: #ffbe34;
  --lapis: #004a91;
  /* Couleurs secondaires */
  --brume: #eaeef8;
  --ciel: #89b1d2;
  --anthracite: #3c4446;
  /* Dérivés (teintés depuis la charte, jamais de gris neutre ni de noir) */
  --nuit-70: rgb(8 19 67 / 0.72);
  --nuit-12: rgb(8 19 67 / 0.12);
  --blanc-72: rgb(255 255 255 / 0.78);
  --blanc-16: rgb(255 255 255 / 0.16);
  --lapis-deep: #00366b;

  --font: "Raleway", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  --radius-lg: 24px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --wrap: 72rem;
  --shadow: 0 1px 2px rgb(8 19 67 / 0.08), 0 12px 32px -8px rgb(8 19 67 / 0.22);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--nuit);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 2px; }
a:hover { text-decoration-color: var(--or); }
:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; text-wrap: balance; }
h1 { font-weight: 800; font-size: clamp(2.4rem, 5.6vw, 4.4rem); letter-spacing: -0.02em; }
h2 { font-weight: 800; font-size: clamp(1.9rem, 3.6vw, 2.9rem); letter-spacing: -0.015em; }
h3 { font-weight: 700; font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.25; }
p { margin: 0; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 1em; }
.prose { max-width: 68ch; }
.prose-full { max-width: none; margin-bottom: clamp(3rem, 6vw, 5rem); }
.lead { font-size: clamp(1.2rem, 2vw, 1.4rem); line-height: 1.5; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--or); color: var(--nuit); padding: .6rem 1rem; border-radius: 8px; font-weight: 700; z-index: 100; }
.skip:focus { top: 1rem; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  padding: .95rem 1.6rem; border-radius: 999px; border: 2px solid transparent;
  transition: transform .25s var(--ease), background-color .2s, box-shadow .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn-or { background: var(--or); color: var(--nuit); box-shadow: 0 8px 20px -8px rgb(255 190 52 / 0.7); }
.btn-or:hover { background: #ffcb5c; }
.btn-lapis { background: var(--lapis); color: #fff; }
.btn-lapis:hover { background: var(--lapis-deep); }
.btn-ligne { border-color: currentColor; background: transparent; }
.btn-ligne:hover { background: var(--blanc-16); }
.on-light .btn-ligne:hover { background: var(--nuit-12); }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }

/* ---------- Bandeau utilitaire + en-tête ---------- */
.topbar { background: var(--nuit); color: #fff; font-size: .95rem; }
.topbar .wrap { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; justify-content: space-between; padding-block: .55rem; }
.topbar a { text-decoration: none; font-weight: 700; }
.topbar a:hover { text-decoration: underline; text-decoration-color: var(--or); }
.topbar .tel { color: var(--or); }
.demo-flag { font-weight: 700; color: var(--or); }

.site-header { background: #fff; border-bottom: 1px solid var(--nuit-12); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding-block: .9rem; }
.brand { display: flex; align-items: center; gap: 1.1rem; text-decoration: none; }
/* Taille mini charte : 20 mm ≈ 76 px de large. */
.brand img { width: 76px; height: auto; }
.brand-txt { font-weight: 700; font-size: 1rem; line-height: 1.25; max-width: 15ch; }
.brand-txt::before { content: ""; display: block; width: 2rem; height: 4px; border-radius: 2px; background: var(--or); margin-bottom: .45rem; }
.nav ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; align-items: center; }
.nav a { display: block; padding: .6rem .95rem; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 1rem; }
.nav a:hover { background: var(--brume); }
.nav a[aria-current="page"] { background: var(--brume); box-shadow: inset 0 -3px 0 var(--or); border-radius: 12px 12px 4px 4px; }
.nav .cta a { background: var(--lapis); color: #fff; margin-left: .5rem; }
.nav .cta a:hover { background: var(--lapis-deep); }
.menu-btn { display: none; font: inherit; font-weight: 700; background: var(--brume); border: 0; color: var(--nuit); padding: .7rem 1.1rem; border-radius: 999px; cursor: pointer; }


/* ---------- Sections ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section-brume { background: var(--brume); }
.section-nuit { background: var(--nuit); color: #fff; }
.section-lapis { background: var(--lapis); color: #fff; }
.kicker { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1rem; margin-bottom: 1rem; }
.kicker::before { content: ""; width: .7rem; height: .7rem; background: var(--or); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3.2rem); }
.section-head p { margin-top: 1rem; }
.on-dark .section-head p, .section-nuit .section-head p, .section-lapis .section-head p { color: var(--blanc-72); }

/* ---------- Pages intérieures ---------- */
.page-head { background: var(--lapis); color: #fff; position: relative; overflow: hidden; isolation: isolate; }
.page-head::before { content: ""; position: absolute; z-index: -1; right: -9rem; top: -9rem; width: 28rem; aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--blanc-16), inset 0 0 0 3rem rgb(255 255 255 / 0.03), inset 0 0 0 3.1rem var(--blanc-16); }
.page-head .wrap { padding-block: clamp(3rem, 6vw, 5rem); }
.page-head h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); max-width: 20ch; }
.page-head .lead { margin-top: 1.2rem; max-width: 46ch; color: var(--blanc-72); }
.crumbs { font-size: .95rem; font-weight: 600; color: var(--ciel); margin-bottom: 1.2rem; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.split { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); }
.split + .split { margin-top: clamp(3rem, 6vw, 5rem); padding-top: clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--nuit-12); }
.split > h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); position: sticky; top: 1.5rem; align-self: start; }
.split > h2::after { content: ""; display: block; width: 3rem; height: 4px; background: var(--or); margin-top: .8rem; border-radius: 2px; }
.list-check { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .8rem; }
.list-check li { padding-left: 2rem; position: relative; }
.list-check li::before { content: ""; position: absolute; left: 0; top: .4em; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--or); }
.list-check li::after { content: ""; position: absolute; left: .36rem; top: .62em; width: .36rem; height: .6rem; border: solid var(--nuit); border-width: 0 2.5px 2.5px 0; transform: rotate(40deg); }

.callout { background: var(--brume); border-radius: var(--radius); padding: 1.5rem 1.7rem; margin-top: 1.5rem; }
.callout.mention { background: var(--nuit); color: #fff; text-align: center; font-weight: 600; line-height: 1.55; }
.callout.mention b { color: var(--or); }
.callout h3 { margin-bottom: .5rem; }

.hint { font-size: .95rem; color: var(--nuit-70); }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--nuit); color: #fff; font-size: 1rem; }
.site-footer .wrap { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 3rem; padding-block: 3.5rem 2.5rem; }
.site-footer img { width: 76px; height: auto; margin-bottom: 1rem; }
.site-footer h2 { font-size: 1rem; font-weight: 800; color: var(--or); letter-spacing: 0; margin-bottom: .8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-decoration-color: var(--or); }
.site-footer p { color: var(--blanc-72); }
.legal { border-top: 1px solid var(--blanc-16); padding-block: 1.2rem; font-size: .9rem; color: var(--blanc-72); }
.legal .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; padding-block: 0; grid-template-columns: none; }

/* ---------- Apparition au scroll (contenu visible par défaut) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 62rem) {
  .site-footer .wrap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 52rem) {
  .menu-btn { display: inline-block; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--nuit-12); display: none; padding: 1rem var(--gutter) 1.5rem; z-index: 20; box-shadow: var(--shadow); }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; }
  .nav .cta a { margin: .5rem 0 0; text-align: center; }
  .site-header { position: relative; }
  .brand-txt { display: none; }
  .split { grid-template-columns: 1fr; }
  .split > h2 { position: static; }
}
@media (max-width: 34rem) {
  body { font-size: 1.0625rem; }
  .site-footer .wrap { grid-template-columns: 1fr; gap: 2rem; }
  .topbar .wrap { flex-direction: column; }
}
/* Flash messages */
.flashes { padding-block: 1.2rem 0; scroll-margin-top: 6rem; }
.flash { margin: 0 0 .6rem; padding: 1rem 1.3rem; border-radius: var(--radius); border-left: 6px solid var(--lapis); background: var(--brume); font-weight: 700; }
.flash-success { border-left-color: #1e7a46; background: #e6f4ec; }
.flash-error, .flash-danger { border-left-color: #b3261e; background: #fbeae8; }
.flash-warning { border-left-color: var(--or); background: #fff4d9; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
