/* MidiSys Consulting — feuille de style unique du site vitrine */

:root {
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --bg: #ffffff;
  --soft: #f5f6f8;
  --line: #e2e8f0;
  /* Rouge aligné sur le logo (#fa0000), assombri juste assez pour rester lisible sur blanc */
  --accent: #e00000;
  --accent-dark: #b80000;
  --accent-soft: #fdeaea;
  --navy: #0b0b0d;
  --navy-2: #1c1c21;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --max: 1160px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 650; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #fff; /* blanc plein : le logo PNG a un fond blanc opaque */
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.brand img.logo { width: auto; height: 48px; }
.brand small { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink); font-size: .95rem; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.nav a:hover { background: var(--soft); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); }
.nav .btn { margin-left: 8px; color: #fff; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; width: 44px; height: 44px; cursor: pointer; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 20px; height: 2px; background: var(--ink); margin: 0 auto; position: relative; content: ""; transition: .2s;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .nav .btn { margin: 8px 0 0; text-align: center; }
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: .98rem;
  padding: 13px 22px; border-radius: 10px; border: 2px solid var(--accent);
  transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--soft); border-color: var(--line); }
.btn-light { background: #fff; color: var(--navy); border-color: #fff; }
.btn-light:hover { background: #f1f5f9; border-color: #f1f5f9; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- Sections ---------- */
section { padding: 96px 0; }
.section-soft { background: var(--soft); }
.section-dark { background: radial-gradient(900px 520px at 85% 0%, #24242a, transparent 70%), radial-gradient(700px 500px at 0% 100%, #161619, transparent 70%), var(--navy); color: #d4d4d8; }
.section-dark h2, .section-dark h3 { color: #fff; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.section-dark .eyebrow { color: #ff8095; }
.section-dark .lead, .section-dark p { color: #d4d4d8; }
.lead { font-size: 1.2rem; color: var(--text); max-width: 680px; }
.section-head { max-width: 720px; margin-bottom: 52px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .lead { margin-left: auto; margin-right: auto; }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 88px; background:
  radial-gradient(900px 400px at 85% 0%, var(--accent-soft), transparent 70%),
  linear-gradient(#fff, #fff); }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: center; }
.hero h1 span { color: var(--accent); }
.hero .lead { font-size: 1.25rem; }
.hero-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 28px;
}
.hero-card h3 { font-size: 1rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.hero-card ul { list-style: none; }
.hero-card li { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.hero-card li:first-child { border-top: 0; }
.hero-card .num { flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; font-size: .9rem; }
.hero-card strong { color: var(--ink); display: block; }
.hero-card span { color: var(--muted); font-size: .94rem; }

.page-hero { padding: 80px 0 64px; background: var(--soft); border-bottom: 1px solid var(--line); }
.page-hero .lead { margin-bottom: 0; }
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); }

/* ---------- Chiffres ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-top: 64px; }
.stat { padding: 26px 24px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font-size: 2rem; color: var(--ink); line-height: 1.1; }
.stat > span { font-size: .92rem; color: var(--muted); }
.stat b span { font: inherit; color: inherit; font-variant-numeric: tabular-nums; }
/* Case « cœur technique » : liste de technos, un peu plus petite pour tenir sur une ligne,
   même hauteur que les chiffres voisins pour garder l'alignement */
.stat-tech b { font-size: min(1.5rem, 1.75vw); line-height: 2.2rem; white-space: nowrap; }
@media (max-width: 960px) { .stat-tech b { font-size: 1.5rem; white-space: normal; } }

/* ---------- Cartes ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px;
  transition: box-shadow .2s, transform .2s, border-color .2s; display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow); border-color: #cbd5e1; }
.card .icon { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 20px; }
.card .icon svg { width: 24px; height: 24px; }
.card p { color: var(--text); }
.card .more { margin-top: auto; font-weight: 600; padding-top: 8px; }
.card-tag { font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.section-dark .card { background: var(--navy-2); border-color: rgba(255,255,255,.08); color: #d4d4d8; }
.section-dark .card p { color: #d4d4d8; }
.section-dark .card .icon { background: rgba(255,128,149,.12); color: #ff8095; }

.checklist { list-style: none; margin: 4px 0 20px; }
.checklist li { position: relative; padding-left: 28px; margin: 8px 0; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .45em; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23e00000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}
.section-dark .checklist li::before { background-color: rgba(255,128,149,.15); }

/* ---------- Tech ---------- */
.tech-group { margin-bottom: 26px; }
.tech-group h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: .9rem; color: var(--ink); font-weight: 500; }

/* ---------- Étapes ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: step; }
.step { position: relative; padding-top: 22px; border-top: 2px solid var(--line); }
.step::before { counter-increment: step; content: "0" counter(step); position: absolute; top: -14px; left: 0; background: var(--bg); padding-right: 10px; font-weight: 700; color: var(--accent); font-size: .95rem; }
.section-soft .step::before { background: var(--soft); }

/* ---------- Bloc deux colonnes ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.split-media {
  border-radius: 18px; background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #e4e4e7; padding: 36px;
}
.split-media h3 { color: #fff; }
.entity { padding: 18px 0; border-top: 1px solid rgba(255,255,255,.12); }
.entity:first-of-type { border-top: 0; padding-top: 0; }
.entity small { color: #ff8095; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: .74rem; }

/* ---------- FAQ ---------- */
.faq details { border-bottom: 1px solid var(--line); padding: 20px 0; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--accent); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 12px 0 0; }

/* ---------- CTA ---------- */
.cta { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); color: #d4d4d8; border-radius: 22px; padding: 56px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; }
.cta h2 { color: #fff; }
.cta-contact { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 24px; }
.cta-contact a { color: #fff; font-weight: 600; }
.cta-contact p { margin: 0 0 6px; font-size: .95rem; }

/* ---------- Références ---------- */
.ref-card .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ref-card dl { margin: 0; }
.ref-card dt { font-weight: 650; color: var(--ink); font-size: .92rem; margin-top: 12px; }
.ref-card dd { margin: 2px 0 0; }
.ref-card .ref-logo { align-self: flex-start; height: 48px; width: auto; max-width: 190px; object-fit: contain; object-position: left center; margin-bottom: 20px; }
.logo-wall { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-around; gap: 32px 48px; padding: 32px; margin-bottom: 48px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.logo-wall img { height: 48px; width: auto; max-width: 190px; object-fit: contain; filter: grayscale(1); opacity: .75; transition: filter .2s, opacity .2s; }
.logo-wall img:hover { filter: none; opacity: 1; }
.note { font-size: .85rem; color: var(--muted); margin-top: 24px; }

/* Contenu à compléter (visible en local, à retirer avant mise en ligne) */
.todo { background: #fff7d6; outline: 1px dashed #d4a20b; border-radius: 4px; padding: 0 4px; color: #6b5200; }

/* ---------- Pages légales ---------- */
.prose { max-width: 780px; }
.prose h2 { font-size: 1.4rem; margin-top: 2em; }
.prose ul { padding-left: 1.2em; margin-bottom: 1em; }

/* ---------- Footer ---------- */
.site-footer { background: linear-gradient(180deg, #17171b 0%, var(--navy) 60%); color: #a1a1aa; padding: 64px 0 28px; font-size: .94rem; }
.site-footer a { color: #d4d4d8; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.site-footer h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; }
.site-footer ul { list-style: none; }
.site-footer li { margin: 8px 0; }
.site-footer .brand { color: #fff; margin-bottom: 14px; }
.site-footer .brand small { color: #a1a1aa; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 48px; padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* =========================================================
   Motion : hero particules, apparitions, halo, méthode, carte
   ========================================================= */

/* ---------- Hero sombre avec nuage de particules ---------- */
.hero-dark {
  background:
    radial-gradient(800px 500px at 78% 40%, rgba(224, 0, 0, .14), transparent 65%),
    radial-gradient(900px 600px at 10% 0%, #2a2a31, transparent 70%),
    var(--navy);
  color: #d4d4d8;
  overflow: hidden;
}
.hero-dark h1 { color: #fff; }
.hero-dark h1 span { color: #ff4d4d; }
.hero-dark .eyebrow { color: #ff8095; }
.hero-dark .lead { color: #d4d4d8; }
.hero-dark .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .25); }
.hero-dark .btn-ghost:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .4); }
.hero-dark .stats { background: rgba(255, 255, 255, .03); border-color: rgba(255, 255, 255, .1); backdrop-filter: blur(6px); }
.hero-dark .stat { border-color: rgba(255, 255, 255, .1); }
.hero-dark .stat b { color: #fff; }
.hero-dark .stat > span { color: #a1a1aa; }
.hero-visual { position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: 560px; margin: -40px -40px -40px auto; }
.hero-visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-visual.no-webgl { display: none; }

/* ---------- 1. Apparition au défilement ---------- */
.js .reveal {
  opacity: 0;
  translate: 0 26px;
  transition-property: opacity, translate, box-shadow, border-color, transform;
  transition-duration: .8s, .8s, .2s, .2s, .2s;
  transition-timing-function: cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--d, 0ms), var(--d, 0ms), 0s, 0s, 0s;
}
.js .reveal.in { opacity: 1; translate: 0 0; }

/* ---------- 2. Halo lumineux sur les cartes ---------- */
.card { position: relative; will-change: transform; }
.card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(224, 0, 0, .75), transparent 65%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s;
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(224, 0, 0, .05), transparent 60%);
  opacity: 0; transition: opacity .3s;
}
.card:hover::before, .card:hover::after { opacity: 1; }
.section-dark .card::before { background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 128, 149, .8), transparent 65%); }
.section-dark .card::after { background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 128, 149, .08), transparent 60%); }

/* ---------- 3. Rideau de transition entre les pages (piloté par transition.js) ---------- */
/* Panneau blanc cassé, liserés rouges, logo au centre. Caché hors transition. */
body::before, body::after {
  content: ""; position: fixed; left: 0; right: 0; z-index: 1000; pointer-events: none;
  transform: translateY(102%); visibility: hidden; will-change: transform;
}
body::before {
  top: 0; bottom: 0;
  background:
    radial-gradient(600px 400px at 50% 50%, rgba(224, 0, 0, .06), transparent 70%),
    #f7f5f1;
  border-top: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
}
body::after {
  top: 50%; height: 84px; margin-top: -42px;
  background: url("/assets/img/curtain-mark-light.svg") center / 100px 84px no-repeat;
}
/* Départ : le rideau monte et couvre l'écran */
html.curtain-leave body::before, html.curtain-leave body::after {
  visibility: visible; animation: curtain-in .45s cubic-bezier(.7, 0, .3, 1) forwards;
}
html.curtain-leave body::after { animation-name: curtain-in, curtain-mark-in; animation-duration: .45s, .45s; }
/* Arrivée : la page démarre couverte, puis le rideau repart vers le haut */
html.curtain-enter body::before, html.curtain-enter body::after {
  visibility: visible; transform: translateY(0);
  animation: curtain-out .6s cubic-bezier(.7, 0, .3, 1) .15s forwards;
}
@keyframes curtain-in { from { transform: translateY(102%); } to { transform: translateY(0); } }
@keyframes curtain-out { from { transform: translateY(0); } to { transform: translateY(-102%); } }
@keyframes curtain-mark-in { from { opacity: 0; scale: .8; } to { opacity: 1; scale: 1; } }

/* ---------- 4. Méthode : ligne de progression ---------- */
.js .steps .step > * { opacity: .45; transition: opacity .5s; }
.js .steps .step::before { color: var(--muted); transition: color .4s; }
.js .steps .step.on > *, .js .steps.done .step > * { opacity: 1; }
.js .steps .step.on::before, .js .steps.done .step::before { color: var(--accent); }
@media (min-width: 961px) {
  .js .steps { position: relative; }
  .js .steps .step { border-top-color: transparent; }
  .js .steps::before, .js .steps::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; z-index: 0; }
  .js .steps .step::before { z-index: 1; padding-right: 12px; }
  .js .steps::before { background: var(--line); }
  .js .steps::after { background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); }
  .js .steps.done::after { transform: none; }
}
@media (max-width: 960px) {
  .js .steps .step.on, .js .steps.done .step { border-top-color: var(--accent); }
}

/* ---------- 5. Carte France · Tunisie ---------- */
.geo { margin: -8px -8px 26px; }
.geo svg { width: 100%; height: auto; overflow: visible; }
.geo-arc { fill: none; stroke: url(#geo-grad); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 420; stroke-dashoffset: 420; }
.geo-arc-glow { fill: none; stroke: rgba(255, 77, 77, .25); stroke-width: 8; stroke-linecap: round; filter: blur(4px); stroke-dasharray: 420; stroke-dashoffset: 420; }
.js .geo.in .geo-arc, .js .geo.in .geo-arc-glow { transition: stroke-dashoffset 1.8s cubic-bezier(.6, 0, .2, 1) .3s; stroke-dashoffset: 0; }
html:not(.js) .geo-arc, html:not(.js) .geo-arc-glow { stroke-dashoffset: 0; }
.geo-city { fill: #fff; }
.geo-ping { fill: none; stroke: #ff4d4d; stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: geo-ping 2.4s ease-out infinite; }
.geo-ping.late { animation-delay: 1.2s; }
@keyframes geo-ping { from { transform: scale(1); opacity: .9; } to { transform: scale(4); opacity: 0; } }
.geo-label { fill: #e4e4e7; font: 600 12px var(--font); }
.geo-sub { fill: #a1a1aa; font: 500 10px var(--font); letter-spacing: .08em; text-transform: uppercase; }
.geo-packet { fill: #fff; filter: drop-shadow(0 0 4px #ff4d4d); }
.geo-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.geo-facts span { font-size: .8rem; color: #e4e4e7; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px; padding: 4px 12px; }

/* =========================================================
   Popups de formulaire (forms.js)
   ========================================================= */
html.mf-open { overflow: hidden; }
.mf-dialog {
  width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0;
  border-radius: 18px; background: #fff; color: var(--text); overflow: auto; overscroll-behavior: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45); border-top: 4px solid var(--accent);
  animation: mf-in .35s cubic-bezier(.16, 1, .3, 1);
}
.mf-dialog::backdrop { background: rgba(8, 8, 10, .6); backdrop-filter: blur(4px); animation: mf-fade .3s ease; }
.mf-dialog.closing { animation: mf-out .18s ease-in forwards; }
.mf-dialog.closing::backdrop { animation: mf-fade .18s ease-in reverse forwards; }
@keyframes mf-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes mf-out { to { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes mf-fade { from { opacity: 0; } }
.mf-body { padding: 32px 36px 28px; }
.mf-close {
  position: sticky; top: 12px; float: right; margin: 12px 12px 0 0; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  font-size: 1.5rem; line-height: 1; color: var(--ink); cursor: pointer;
}
.mf-close:hover { background: var(--soft); }
.mf-eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.mf-body h2 { font-size: 1.6rem; margin-bottom: .4em; padding-right: 32px; }
.mf-intro { color: var(--muted); margin-bottom: 24px; }
.mf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.mf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mf-full { grid-column: 1 / -1; }
.mf-field label, .mf-checks legend { font-size: .86rem; font-weight: 600; color: var(--ink); }
.mf-field input, .mf-field select, .mf-field textarea {
  font: inherit; font-size: .95rem; color: var(--ink); background: #fff;
  border: 1px solid #cbd5e1; border-radius: 10px; padding: 11px 13px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.mf-field textarea { resize: vertical; min-height: 110px; }
.mf-field input[type=file] { padding: 9px; background: var(--soft); }
.mf-field input:focus, .mf-field select:focus, .mf-field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(224, 0, 0, .12);
}
.mf-tried :invalid { border-color: var(--accent); }
.mf-checks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mf-checks legend { margin-bottom: 8px; padding: 0; }
.mf-checks { min-width: 0; }
.mf-check { flex: none; white-space: nowrap; font-weight: 500 !important; display: inline-flex; align-items: center; gap: 8px; border: 1px solid #cbd5e1; border-radius: 999px; padding: 7px 14px; font-size: .9rem; cursor: pointer; }
.mf-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.mf-check input { accent-color: var(--accent); }
.mf-consent { display: flex; gap: 10px; align-items: flex-start; margin: 22px 0 6px; font-size: .85rem; color: var(--muted); cursor: pointer; }
.mf-consent input { margin-top: 3px; accent-color: var(--accent); flex: none; }
.mf-tried .mf-consent:has(input:invalid) { color: var(--accent-dark); }
.mf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mf-status { min-height: 1.4em; margin: 10px 0 0; font-size: .9rem; }
.mf-status.err { color: var(--accent-dark); font-weight: 600; }
.mf-actions { display: flex; align-items: center; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.mf-note { font-size: .8rem; color: var(--muted); }
.mf-submit.loading { opacity: .7; cursor: progress; }
.mf-done { text-align: center; padding: 24px 0 8px; }
.mf-done h2 { padding: 0; }
.mf-done p { color: var(--muted); margin-bottom: 24px; }
.mf-check-icon {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 2rem; font-weight: 700;
  animation: mf-pop .5s cubic-bezier(.16, 1.4, .3, 1);
}
@keyframes mf-pop { from { transform: scale(.4); opacity: 0; } }
@media (max-width: 640px) {
  .mf-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .mf-body { padding: 20px 16px 28px; }
  .mf-grid { grid-template-columns: 1fr; }
  .mf-body h2 { font-size: 1.35rem; }
}

/* =========================================================
   Références : cartes cliquables et popup de détail (references.js)
   ========================================================= */
.ref-card { cursor: pointer; }
.ref-card .ref-teaser { color: var(--text); }
.ref-card .ref-more { background: none; border: 0; padding: 8px 0 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; text-align: left; }
.ref-card:hover .ref-more { text-decoration: underline; }
.logo-btn { background: none; border: 0; padding: 6px; border-radius: 10px; cursor: pointer; }
.logo-btn:focus-visible, .ref-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.logo-btn:hover img { filter: none; opacity: 1; }

.ref-dialog { width: min(860px, calc(100vw - 32px)); }
.ref-head { display: flex; gap: 24px; align-items: center; padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.ref-plate {
  flex: none; width: 168px; height: 112px; display: grid; place-items: center; padding: 18px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow);
}
.ref-plate img { width: 100%; height: 100%; object-fit: contain; margin: 0; max-width: none; }
.ref-head h2 { margin-bottom: .5em; }
.ref-head .meta { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-body { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: start; }
.ref-body > dl { margin: 0; }
.ref-body > dl dt { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-top: 20px; }
.ref-body > dl dt:first-child { margin-top: 0; }
.ref-body > dl dd { margin: 6px 0 0; color: var(--text); }
.ref-body .checklist { margin: 8px 0 0; }
.ref-facts { background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.ref-facts h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 12px; }
.ref-facts dl { margin: 0; }
.ref-facts dt { font-size: .8rem; color: var(--muted); margin-top: 12px; }
.ref-facts dt:first-of-type { margin-top: 0; }
.ref-facts dd { margin: 2px 0 0; font-weight: 600; color: var(--ink); font-size: .95rem; }
.ref-facts dd.chips { margin-top: 8px; font-weight: 500; }
.ref-facts .chip { font-size: .8rem; padding: 4px 10px; }
.ref-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.ref-foot p { margin: 0; color: var(--muted); }
@media (max-width: 640px) {
  .ref-dialog { width: 100vw; max-width: 100vw; }
}
@media (max-width: 760px) {
  .ref-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .ref-plate { width: 140px; height: 92px; }
  .ref-body { grid-template-columns: 1fr; gap: 24px; }
}

/* =========================================================
   Bandeau de consentement cookies (analytics.js)
   ========================================================= */
.cookie-banner {
  position: fixed; left: 24px; bottom: 24px; z-index: 900; width: min(460px, calc(100vw - 32px));
  background: #fff; color: var(--text); border-radius: 16px; padding: 22px 24px 20px;
  border-top: 4px solid var(--accent); box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
  font-size: .9rem; animation: cb-in .45s cubic-bezier(.16, 1, .3, 1);
}
.cookie-banner strong { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 6px; }
.cookie-banner p { margin: 0 0 16px; line-height: 1.55; }
.cookie-actions { display: flex; gap: 10px; }
.cookie-actions .btn { flex: 1; justify-content: center; padding: 11px 16px; font-size: .92rem; }
.cookie-banner.cb-out { animation: cb-out .25s ease-in forwards; }
@keyframes cb-in { from { opacity: 0; transform: translateY(24px); } }
@keyframes cb-out { to { opacity: 0; transform: translateY(16px); } }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: #d4d4d8; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .cookie-banner { left: 8px; right: 8px; bottom: 8px; width: auto; }
  .cookie-actions .btn { width: auto; }
}

/* ---------- Réduction des animations ---------- */
@media (prefers-reduced-motion: reduce) {
  .geo-ping, .geo-packet { display: none; }
  .geo-arc, .geo-arc-glow { stroke-dashoffset: 0; }
  body::before, body::after { display: none; }
  .mf-dialog, .mf-dialog::backdrop, .mf-check-icon, .cookie-banner { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  section { padding: 72px 0; }
  .hero { padding: 64px 0; }
  .hero-grid, .split, .cta { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { margin: -20px auto -40px; max-width: 440px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cta { padding: 40px 28px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  section { padding: 56px 0; }
  .grid-2, .grid-3, .grid-4, .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .card { padding: 24px; }
  .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
