/* ============================================================
   ERC Transmission — Design system partagé
   Base : navy #172b4d · 2 thèmes (bleu classique · charte officielle pétrole+or)
   Police : DM Sans
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:        #172b4d;
  --navy-2:      #1e3a5f;
  --ink:         #22304a;
  --muted:       #6b7a99;
  --border:      #dde1ea;
  --white:       #ffffff;

  /* Thème par défaut : bleu ERC */
  --accent:      #2563eb;
  --accent-d:    #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-bord: #bfdbfe;
  --bg:          #f5f7fa;
  --hero-a:      #142647;
  --hero-b:      #1e3a5f;
  --hero-glow:   rgba(37,99,235,.28);
}

/* ── Thème officiel ERC Transmission — charte Christophe Latard ──
   Pantone 309 pétrole #002D39 · Pantone 7536 or/taupe #9A8E74 · Pantone 425 gris #444444
   Action sur fond clair = pétrole ; action sur fond sombre = or (voir overrides plus bas). */
:root[data-theme="charte"] {
  --navy:        #002D39;   /* pétrole = base sombre (texte, footer, filets) */
  --ink:         #2b2b2b;   /* corps de texte, famille gris #444 */
  --muted:       #5f6b6d;   /* gris-pétrole désaturé */
  --border:      #dfe3e2;
  --accent:      #002D39;   /* accent d'action lisible sur blanc */
  --accent-d:    #0a4a5b;   /* survol (pétrole éclairci) */
  --accent-soft: #eef3f3;
  --accent-bord: #c2d2d4;
  --gold:        #E8CC82;   /* or décoratif — candidat D (champagne clair) */
  --gold-ink:    #9a7d33;   /* or foncé lisible en texte (sur fond clair) */
  --bg:          #f7f4ec;   /* ivoire chaud (rappel or) */
  --hero-a:      #00212b;
  --hero-b:      #003a49;
  --hero-glow:   color-mix(in srgb, var(--gold) 30%, transparent);   /* halo or */
}

/* ── Touches or, portée limitée au thème officiel — tout dérivé de var(--gold) ── */
:root[data-theme="charte"] .nav-mark,
:root[data-theme="charte"] .fb-mark { background: var(--gold); color: #002D39; }
:root[data-theme="charte"] .hero-eyebrow { background: color-mix(in srgb, var(--gold) 16%, transparent); border-color: color-mix(in srgb, var(--gold) 55%, transparent); color: var(--gold); }
:root[data-theme="charte"] .hero h1 em::after { background: var(--gold); opacity: .85; }
:root[data-theme="charte"] .section-label { color: var(--gold-ink); }
:root[data-theme="charte"] .card-icon { background: color-mix(in srgb, var(--gold) 15%, transparent); border-color: color-mix(in srgb, var(--gold) 42%, transparent); }
/* Boutons d'action sur fond sombre → or (le pétrole y serait invisible) */
:root[data-theme="charte"] .hero .btn-primary,
:root[data-theme="charte"] .cta-band .btn-primary { background: var(--gold); color: #002D39; }
:root[data-theme="charte"] .hero .btn-primary:hover,
:root[data-theme="charte"] .cta-band .btn-primary:hover { background: color-mix(in srgb, var(--gold) 82%, #000); }

html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--white); color: var(--navy); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

/* ============================================================
   NAV
   ============================================================ */
nav.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px; height: 66px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.nav-mark { width: 36px; height: 36px; background: var(--navy); border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .5px; }
.nav-name { display: flex; flex-direction: column; line-height: 1.15; }
.nav-name b { font-size: 15px; font-weight: 700; color: var(--navy); }
.nav-name span { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .3px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link { padding: 8px 13px; font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; border-radius: 8px; transition: background .15s, color .15s; white-space: nowrap; }
.nav-link:hover, .nav-link.active { background: var(--bg); color: var(--navy); }
.nav-cta { padding: 9px 18px; background: var(--accent); color: #fff; border-radius: 9px; font-size: 14px; font-weight: 600; text-decoration: none; transition: background .15s; white-space: nowrap; }
.nav-cta:hover { background: var(--accent-d); }

/* Sélecteur de thème (A/B/C) */
.theme-switch { display: flex; gap: 4px; align-items: center; margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--border); }
.theme-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; transition: transform .12s, border-color .12s; }
.theme-dot:hover { transform: scale(1.12); }
.theme-dot.active { border-color: var(--navy); }
.theme-dot[data-set="bleu"]   { background: #2563eb; }
.theme-dot[data-set="charte"] { background: #E8CC82; }

.nav-burger { display: none; background: none; border: none; font-size: 22px; color: var(--navy); cursor: pointer; }

@media (max-width: 900px) {
  nav.site-nav { padding: 0 20px; }
  .nav-links { position: fixed; inset: 66px 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px; background: var(--white); border-bottom: 1px solid var(--border); padding: 12px 20px 20px; box-shadow: 0 12px 24px rgba(23,43,77,.08); display: none; }
  .nav-links.open { display: flex; }
  .nav-link { padding: 12px 14px; font-size: 15px; }
  .nav-cta { text-align: center; margin-top: 6px; }
  .theme-switch { justify-content: center; margin: 8px 0 0; padding: 12px 0 0; border-left: none; border-top: 1px solid var(--border); }
  .nav-burger { display: block; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: linear-gradient(150deg, var(--hero-a) 0%, var(--hero-b) 100%);
  padding: 94px 24px 84px; text-align: center; color: #fff;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 100%, var(--hero-glow) 0%, transparent 60%),
              radial-gradient(ellipse at 85% 15%, rgba(255,255,255,.06) 0%, transparent 45%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.22);
  border-radius: 20px; padding: 6px 18px;
  font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 30px;
}
.hero h1 {
  font-size: clamp(31px, 5.2vw, 55px); font-weight: 700;
  line-height: 1.1; margin: 0 auto 22px; max-width: 840px;
}
.hero h1 em { font-style: normal; color: #fff; position: relative; white-space: nowrap; }
.hero h1 em::after { content: ''; position: absolute; left: 0; right: 0; bottom: 4px; height: 8px; background: var(--accent); opacity: .5; border-radius: 2px; z-index: -1; }
.hero-sub { font-size: 18.5px; color: rgba(255,255,255,.74); max-width: 600px; margin: 0 auto 38px; line-height: 1.68; }
@media (max-width: 560px) { .hero h1 br { display: none; } }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 22px; font-size: 13px; color: rgba(255,255,255,.45); }

/* ============================================================
   BOUTONS
   ============================================================ */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 28px; border-radius: 10px; font-size: 15px; font-weight: 600; font-family: inherit; text-decoration: none; cursor: pointer; border: none; transition: background .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-d); }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: #eef1f6; }
.btn-ghost { background: rgba(255,255,255,.10); border: 1.5px solid rgba(255,255,255,.24); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.18); }
.btn-outline { background: none; border: 1.5px solid var(--border); color: var(--navy); }
.btn-outline:hover { border-color: var(--navy); }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ============================================================
   SECTIONS génériques
   ============================================================ */
.section { padding: 72px 24px; }
.section.alt { background: var(--bg); }
.section-inner { max-width: 1040px; margin: 0 auto; }
.section-narrow { max-width: 820px; margin: 0 auto; }
.section-label { font-size: 11px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.section-title { font-size: clamp(26px, 3.4vw, 34px); font-weight: 700; margin-bottom: 16px; line-height: 1.22; }
.section-sub { font-size: 17px; color: var(--muted); line-height: 1.72; max-width: 600px; }
@media (max-width: 560px) { .section { padding: 52px 20px; } }
.center { text-align: center; }
.center .section-sub { margin-left: auto; margin-right: auto; }

/* Bande stats */
.stats { padding: 46px 24px; background: var(--bg); }
.stats-grid { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: repeat(4,1fr); gap: 2px; }
.stat { text-align: center; padding: 26px 16px; background: var(--white); }
.stat:first-child { border-radius: 14px 0 0 14px; }
.stat:last-child { border-radius: 0 14px 14px 0; }
.stat-val { font-size: 32px; font-weight: 700; color: var(--navy); }
.stat-val span { color: var(--accent); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
@media (max-width: 640px) { .stats-grid { grid-template-columns: repeat(2,1fr); } .stat:nth-child(1){border-radius:14px 0 0 0} .stat:nth-child(2){border-radius:0 14px 0 0} .stat:nth-child(3){border-radius:0 0 0 14px} .stat:nth-child(4){border-radius:0 0 14px 0} }

/* Grille de cartes */
.cards { display: grid; gap: 20px; margin-top: 38px; }
.cards.c2 { grid-template-columns: repeat(2,1fr); }
.cards.c3 { grid-template-columns: repeat(3,1fr); }
.cards.c4 { grid-template-columns: repeat(4,1fr); }
@media (max-width: 860px) { .cards.c3, .cards.c4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 620px) { .cards.c2, .cards.c3, .cards.c4 { grid-template-columns: 1fr; } }

.card { background: var(--white); border: 1.5px solid var(--border); border-radius: 16px; padding: 28px; transition: border-color .15s, box-shadow .2s, transform .2s; }
.card:hover { border-color: var(--accent-bord); box-shadow: 0 8px 26px rgba(23,43,77,.08); transform: translateY(-2px); }
.card-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent-bord); display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 16px; }
.card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; color: var(--navy); }
.card p { font-size: 14px; color: var(--muted); line-height: 1.65; }

/* Feature list */
.feature-list { list-style: none; margin-top: 12px; }
.feature-list li { font-size: 15px; padding: 9px 0; display: flex; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--border); }
.feature-list li:last-child { border-bottom: none; }
.feature-list li::before { content: '✓'; color: var(--accent); font-weight: 700; flex-shrink: 0; }

/* Split (texte + visuel/aside) */
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; gap: 36px; } }
.aside-card { background: var(--white); border: 1.5px solid var(--border); border-radius: 18px; padding: 30px; box-shadow: 0 10px 32px rgba(23,43,77,.06); }

/* Timeline (histoire) */
.timeline { margin-top: 40px; position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 30px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ''; position: absolute; left: -30px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--white); border: 3px solid var(--accent); }
.tl-year { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .5px; }
.tl-item h3 { font-size: 17px; font-weight: 700; margin: 4px 0 6px; }
.tl-item p { font-size: 14.5px; color: var(--muted); line-height: 1.65; }

/* Bandeau CTA sombre */
.cta-band { background: linear-gradient(150deg, var(--hero-a) 0%, var(--hero-b) 100%); padding: 74px 24px; text-align: center; position: relative; overflow: hidden; }
.cta-band::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 100%, var(--hero-glow) 0%, transparent 60%); pointer-events: none; }
.cta-band-inner { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.cta-band h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 700; color: #fff; margin-bottom: 14px; line-height: 1.25; }
.cta-band p { font-size: 16px; color: rgba(255,255,255,.68); margin-bottom: 34px; }
.cta-band .hero-actions { }

/* Pastille confidentialité / badges */
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent-d); border: 1px solid var(--accent-bord); }
.pill-muted { background: var(--bg); color: var(--muted); border-color: var(--border); }

/* ============================================================
   FOOTER
   ============================================================ */
footer.site-footer { background: var(--navy); color: rgba(255,255,255,.6); padding: 52px 40px 26px; }
.footer-grid { max-width: 1040px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { footer.site-footer { padding: 40px 24px 24px; } .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 460px) { .footer-grid { grid-template-columns: 1fr; } }
.fb-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.fb-mark { width: 34px; height: 34px; background: rgba(255,255,255,.12); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; }
.fb-name { font-size: 15px; font-weight: 700; color: #fff; }
.footer-brand p { font-size: 13px; line-height: 1.7; max-width: 280px; }
.footer-col h4 { font-size: 11px; font-weight: 700; color: rgba(255,255,255,.85); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .8px; }
.footer-col a { display: block; font-size: 13.5px; color: rgba(255,255,255,.55); text-decoration: none; margin-bottom: 10px; transition: color .15s; }
.footer-col a:hover { color: #fff; }
.footer-bottom { max-width: 1040px; margin: 28px auto 0; border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; font-size: 12.5px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer-bottom a { color: rgba(255,255,255,.45); text-decoration: none; }
.footer-bottom a:hover { color: #fff; }

/* ============================================================
   FORMULAIRES (contact, espace, auth)
   ============================================================ */
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 7px; }
.form-field .hint { font-size: 12px; color: var(--muted); font-weight: 500; }
.form-field label .opt { color: var(--muted); font-weight: 500; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 14.5px; font-family: inherit; color: var(--navy);
  outline: none; transition: border-color .15s, box-shadow .15s; background: var(--white);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* Chips mots-clés */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 18px; font-size: 13px; font-weight: 500; background: var(--accent-soft); color: var(--accent-d); border: 1px solid var(--accent-bord); }
.chip button { background: none; border: none; color: var(--accent-d); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.chip-add { border-style: dashed; background: var(--white); color: var(--muted); cursor: pointer; }

/* Messages système */
.msg { padding: 12px 15px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; display: none; line-height: 1.5; }
.msg.show { display: block; }
.msg.error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.msg.success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.msg.info    { background: var(--accent-soft); color: var(--accent-d); border: 1px solid var(--accent-bord); }

.spinner { width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Page auth centrée */
.auth-wrap { min-height: calc(100vh - 66px); display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-card { background: var(--white); border-radius: 18px; box-shadow: 0 8px 30px rgba(23,43,77,.10); padding: 44px 40px; width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.auth-card .subtitle { font-size: 14px; color: var(--muted); margin-bottom: 26px; }
.tabs { display: flex; gap: 4px; background: var(--bg); border-radius: 11px; padding: 4px; margin-bottom: 26px; }
.tab-btn { flex: 1; padding: 9px; border: none; background: none; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; transition: .15s; font-family: inherit; }
.tab-btn.active { background: var(--white); color: var(--navy); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.panel { display: none; } .panel.active { display: block; }
.pwd-rules { margin: 8px 0 16px; display: flex; flex-direction: column; gap: 3px; }
.pwd-rule { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pwd-rule::before { content: '○'; font-size: 10px; }
.pwd-rule.ok { color: #16a34a; } .pwd-rule.ok::before { content: '●'; }

/* Bandeau projet (légal) */
.projet-banner { display: flex; align-items: center; gap: 10px; background: #fef3c7; border: 1px solid #fde68a; border-radius: 10px; padding: 12px 16px; margin-bottom: 28px; font-size: 13px; color: #92400e; }

/* Article / prose */
.prose { max-width: 720px; margin: 0 auto; }
.prose h2 { font-size: 24px; font-weight: 700; margin: 40px 0 14px; }
.prose h3 { font-size: 18px; font-weight: 700; margin: 28px 0 10px; }
.prose p { font-size: 16px; line-height: 1.8; color: var(--ink); margin-bottom: 16px; }
.prose ul, .prose ol { margin: 0 0 16px 22px; }
.prose li { font-size: 16px; line-height: 1.8; color: var(--ink); margin-bottom: 6px; }
.prose blockquote { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 14px 20px; border-radius: 0 10px 10px 0; margin: 20px 0; font-size: 15.5px; color: var(--navy); }
.prose strong { color: var(--navy); }

/* ============================================================
   MODALE (partagée)
   ============================================================ */
.modal-bg { position: fixed; inset: 0; background: rgba(23,43,77,.5); backdrop-filter: blur(3px); z-index: 200; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-bg.open { display: flex; }
.modal { background: var(--white); border-radius: 18px; padding: 32px; width: 100%; max-width: 460px; box-shadow: 0 20px 60px rgba(23,43,77,.28); }
.modal h3 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.modal > p { font-size: 14px; color: var(--muted); margin-bottom: 18px; line-height: 1.6; }
