/* EST — socle web (complète tokens.css + est.css de la charte) */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
h1, h2, h3, h4, p { margin: 0; }
.w-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.w-saut { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--abysse); color: #fff; padding: 12px 18px; font-weight: 600; text-decoration: none; }
.w-saut:focus { top: 16px; }

/* ---------- Grille ---------- */
.w-conteneur { width: 100%; max-width: 1264px; margin: 0 auto; padding: 0 32px; }
.w-grille { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--space-6); }
.w-section { padding: var(--space-24) 0; position: relative; }
.w-section--serre { padding: var(--space-16) 0; }
.w-section--sunken { background: var(--surface-sunken); }
.w-tete-section { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); align-items: end; margin-bottom: var(--space-12); }
.w-tete-section h2 { margin-top: 14px; font: 800 44px/48px var(--font-titre); font-stretch: 108%; letter-spacing: -.02em; text-wrap: balance; }
.w-tete-section p { font-size: 18px; line-height: 28px; color: var(--ink-muted); max-width: 520px; }
.w-h2 { font: 800 40px/44px var(--font-titre); font-stretch: 108%; letter-spacing: -.02em; text-wrap: balance; }
.w-texte { font-size: 17px; line-height: 28px; color: var(--ink-muted); }
.w-texte + .w-texte { margin-top: 14px; }

/* ---------- En-tête ---------- */
.w-entete { position: sticky; top: 0; z-index: 40; }
.w-entete .est-famille { padding-left: 32px; padding-right: 32px; }
.w-entete .est-entete { padding: 14px 32px; gap: 32px; transition: box-shadow .3s ease; }
.w-entete.is-defile .est-entete { box-shadow: 0 10px 30px -18px rgba(8,18,51,.45); }
.w-entete .est-entete img { height: 48px; }
.w-burger { display: none; margin-left: auto; width: 48px; height: 48px; border: 0; background: var(--abysse); cursor: pointer; position: relative; }
.w-burger span { position: absolute; left: 13px; right: 13px; height: 3px; border-radius: var(--radius-trait); background: #fff; transition: transform .3s var(--ease-est), top .3s var(--ease-est), width .3s var(--ease-est); }
.w-burger span:nth-child(1) { top: 18px; }
.w-burger span:nth-child(2) { top: 27px; right: 21px; background: var(--est-rouge); }
.w-burger[aria-expanded="true"] span:nth-child(1) { top: 23px; transform: rotate(45deg); }
.w-burger[aria-expanded="true"] span:nth-child(2) { top: 23px; right: 13px; transform: rotate(-45deg); background: #fff; }

/* Tiroir mobile */
.w-tiroir { position: fixed; inset: 0; z-index: 35; padding: 150px 24px 32px; display: flex; flex-direction: column; gap: 28px; visibility: hidden; opacity: 0; transform: translateY(-12px); transition: opacity .3s ease, transform .4s var(--ease-est), visibility 0s .4s; }
.w-tiroir.is-ouvert { visibility: visible; opacity: 1; transform: none; transition: opacity .3s ease, transform .4s var(--ease-est); }
.w-tiroir nav { display: flex; flex-direction: column; }
.w-tiroir nav a { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,.12); color: #fff; text-decoration: none; font: 800 28px/34px var(--font-titre); font-stretch: 108%; letter-spacing: -.01em; }
.w-tiroir nav a::after { content: ""; width: 10px; height: 10px; border-top: 2px solid var(--mot-lumiere); border-right: 2px solid var(--mot-lumiere); transform: rotate(45deg); }
.w-tiroir .est-btn { justify-content: center; }

/* ---------- Fil d'Ariane ---------- */
.w-ariane { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 600 11px/16px var(--font-signal); letter-spacing: .16em; text-transform: uppercase; list-style: none; margin: 0; padding: 0; }
.w-ariane a { color: inherit; opacity: .72; text-decoration: none; }
.w-ariane a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.w-ariane li + li::before { content: ""; display: inline-block; width: 14px; height: 2px; border-radius: var(--radius-trait); background: var(--est-rouge); vertical-align: middle; margin-right: 10px; }
.w-ariane [aria-current] { opacity: 1; }

/* ---------- Photo à fournir ---------- */
.w-photo { position: relative; isolation: isolate; overflow: hidden; background: var(--est-marine); color: #fff; min-height: 320px; display: flex; align-items: flex-end; padding: 20px; }
.w-photo::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--tex-niveaux-clair); background-size: 1100px; background-position: 30% 60%; opacity: .16; }
.w-photo::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 40%, rgba(8,18,51,.75)); }
.w-photo figcaption { font: 600 11px/16px var(--font-signal); letter-spacing: .16em; text-transform: uppercase; display: flex; gap: 10px; align-items: center; }
.w-photo figcaption::before { content: ""; width: 18px; height: 14px; border: 2px solid var(--mot-lumiere); border-radius: 2px; flex: 0 0 18px; }
.w-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }

/* ---------- Preuve (emplacement réservé) ---------- */
.w-preuve { padding: 28px 32px; outline: 1.5px dashed var(--line-strong); outline-offset: -1.5px; background: repeating-linear-gradient(-45deg, transparent 0 8px, rgba(133,144,168,.08) 8px 10px); display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.w-preuve__guillemet { font: 800 72px/56px var(--font-titre); color: var(--est-rouge); height: 40px; }
.w-preuve p { font-size: 15px; line-height: 23px; color: var(--ink-muted); }
.w-preuve strong { display: block; color: var(--ink); font: 600 12px/16px var(--font-signal); letter-spacing: .16em; text-transform: uppercase; margin-bottom: 6px; }
.est-matiere .w-preuve { outline-color: rgba(255,255,255,.3); background: repeating-linear-gradient(-45deg, transparent 0 8px, rgba(255,255,255,.04) 8px 10px); }
.est-matiere .w-preuve p { color: var(--ink-inverse-muted); }
.est-matiere .w-preuve strong { color: #fff; }

/* ---------- Carte formation ---------- */
.w-carte-formation { display: flex; flex-direction: column; gap: 12px; padding: 26px 26px 22px; background: var(--surface-raised); color: var(--ink); text-decoration: none; position: relative; transition: transform .35s var(--ease-est), box-shadow .35s var(--ease-est); min-height: 250px; }
.w-carte-formation:hover { transform: translateY(-6px); box-shadow: var(--shadow-strate); z-index: 2; }
.w-carte-formation h3 { font: 700 21px/26px var(--font-titre); }
.w-carte-formation p { font-size: 15px; line-height: 23px; color: var(--ink-muted); }
.w-carte-formation dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: auto 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; line-height: 20px; }
.w-carte-formation dt { font: 600 11px/20px var(--font-signal); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); }
.w-carte-formation dd { margin: 0; }
.w-carte-formation .w-voir { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: var(--accent); }
.w-carte-formation .w-voir .est-fleche { transition: width .25s var(--ease-est); }
.w-carte-formation:hover .w-voir .est-fleche { width: 28px; }

/* ---------- Formulaire ---------- */
.w-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
.w-form .est-champ { max-width: none; }
.w-form .w-plein { grid-column: 1 / -1; }
.w-form textarea { min-height: 140px; resize: vertical; }
.w-form select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.w-requis { color: var(--signal); }
.w-case { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.w-case input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: 0 0 20px; }
.w-form__pied { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }

/* ---------- FAQ ---------- */
.w-faq { border-top: 1px solid var(--line); }
.w-faq details { border-bottom: 1px solid var(--line); }
.w-faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 0; font: 700 19px/26px var(--font-titre); }
.w-faq summary::-webkit-details-marker { display: none; }
.w-faq summary::after { content: ""; flex: 0 0 22px; height: 22px; background: linear-gradient(var(--accent), var(--accent)) center/100% 3px no-repeat, linear-gradient(var(--accent), var(--accent)) center/3px 100% no-repeat; border-radius: 2px; transition: transform .3s var(--ease-est); }
.w-faq details[open] summary::after { transform: rotate(45deg); }
.w-faq details > div { padding: 0 0 24px; max-width: 760px; color: var(--ink-muted); font-size: 16px; line-height: 26px; }

/* ---------- Pied de page ---------- */
.w-pied { position: relative; isolation: isolate; overflow: hidden; background: var(--abysse); color: #fff; padding: 72px 0 0; }
.w-pied::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--tex-niveaux-clair); background-size: cover; opacity: .06; }
.w-pied__haut { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.3fr; gap: 40px; padding-bottom: 56px; }
.w-pied__marque img { width: 200px; background: #fff; padding: 10px; }
.w-pied__marque p { margin-top: 20px; color: var(--ink-inverse-muted); font-size: 15px; line-height: 24px; max-width: 300px; }
.w-pied h2 { font: 600 11px/16px var(--font-signal); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-inverse-muted); margin-bottom: 16px; }
.w-pied ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.w-pied a { color: #fff; text-decoration: none; font-size: 15px; }
.w-pied a:hover { text-decoration: underline; text-decoration-color: var(--est-rouge); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.w-pied address { font-style: normal; font-size: 15px; line-height: 24px; color: var(--ink-inverse-muted); }
.w-pied__famille { display: block; position: relative; padding: 22px; background: rgba(255,255,255,.04); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); text-decoration: none; transition: background .3s ease; }
.w-pied__famille:hover { background: rgba(255,255,255,.08); text-decoration: none !important; }
.w-pied__famille img { width: 150px; background: #fff; padding: 8px; margin-bottom: 14px; }
.w-pied__famille span { display: block; font-size: 15px; line-height: 22px; color: var(--ink-inverse-muted); }
.w-pied__famille b { display: inline-flex; gap: 10px; align-items: center; margin-top: 12px; color: var(--mot-lumiere); font-size: 15px; }
.w-pied__bas { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 22px 0 26px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; color: var(--ink-inverse-muted); }
.w-pied__bas ul { flex-direction: row; flex-wrap: wrap; gap: 20px; }
.w-pied__bas a { font-size: 13px; color: var(--ink-inverse-muted); }
.w-pied__legal { margin: 0; padding: 0 0 28px; max-width: 980px; font-size: 12px; line-height: 18px; color: var(--ink-inverse-muted); opacity: .85; }

/* ---------- Apparition au défilement ---------- */
.w-animation .w-reveler { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .9s var(--ease-est); }
.w-animation .w-reveler.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .w-animation .w-reveler { opacity: 1; transform: none; transition: none; } .w-tiroir { transition: none; } }

/* ---------- Mobile ---------- */
@media (max-width: 980px) {
  .w-conteneur { padding: 0 20px; }
  .w-section { padding: var(--space-16) 0; }
  .w-tete-section { grid-template-columns: 1fr; gap: 16px; margin-bottom: 32px; }
  .w-tete-section h2, .w-h2 { font-size: 32px; line-height: 36px; }
  .w-entete .est-famille { padding: 4px 20px; justify-content: flex-start; gap: 18px; }
  .w-entete .est-entete { padding: 10px 20px; }
  .w-entete .est-entete img { height: 40px; }
  .w-entete .est-nav, .w-entete .est-entete > .est-btn { display: none; }
  .w-burger { display: block; }
  .w-form { grid-template-columns: 1fr; }
  .w-pied__haut { grid-template-columns: 1fr 1fr; gap: 32px; }
  .w-pied__marque, .w-pied__famille-col { grid-column: 1 / -1; }
}
@media (min-width: 981px) { .w-tiroir { display: none; } }

/* Chaque marque garde sa lumière, même imbriquée dans l autre */
[data-theme="securite"] { --halo: rgba(141,178,245,.5); --halo-fort: rgba(141,178,245,.2); --mot-lumiere: var(--lueur); }

/* Champs : jamais plus larges que leur colonne (champ fichier inclus) */
.w-form > * { min-width: 0; }
.w-form input, .w-form select, .w-form textarea { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
.w-form input[type="checkbox"], .w-form input[type="radio"] { width: auto; }

/* États d'interface (microtextes D 7) */
.w-alerte { padding: 14px 18px; font-weight: 600; font-size: 15px; line-height: 22px; }
.w-alerte--erreur { background: #fdecec; color: var(--signal); box-shadow: inset 0 0 0 2px var(--signal); }
.w-confirmation { padding: 8px 0; outline: none; }
.w-confirmation h2 { font: 800 30px/34px var(--font-titre); font-stretch: 108%; margin: 12px 0 10px; }
.w-confirmation p { color: var(--ink-muted); font-size: 16px; line-height: 26px; margin-bottom: 18px; }
.w-etapes { list-style: none; counter-reset: e; margin: 0 0 24px; padding: 0; display: grid; gap: var(--joint); }
.w-etapes li { counter-increment: e; position: relative; padding: 14px 16px 14px 56px; background: var(--surface-sunken); font-size: 15px; line-height: 22px; }
.w-etapes li::before { content: counter(e, decimal-leading-zero); position: absolute; left: 16px; top: 12px; font: 600 20px/24px var(--font-signal); color: var(--accent); }
.w-vide { margin-top: 12px; padding: 28px; background: var(--surface-raised); outline: 1.5px dashed var(--line-strong); outline-offset: -1.5px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.w-vide p { font-size: 16px; line-height: 24px; color: var(--ink-muted); }
.w-vide b { color: var(--ink); display: block; }
.w-vide[hidden], .est-session[hidden], .f-domaine[hidden], .est-cal__mois[hidden] { display: none !important; }
