:root {
  --navy: #0f2742;
  --navy-2: #173a5e;
  --ink: #1b2430;
  --muted: #5b6878;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --accent: #f2a93b;
  --accent-ink: #7a4a00;
  --green: #1f9d6b;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 39, 66, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
}
a { color: var(--navy-2); }
img { max-width: 100%; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* Barre du haut */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, 0.92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--navy); text-decoration: none; font-size: 18px; }
.brand-mark { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle, var(--accent) 0 3px, transparent 4px), radial-gradient(circle, transparent 0 7px, var(--accent) 8px 9px, transparent 10px), var(--navy); }
.topnav { display: flex; gap: 22px; margin-left: auto; }
.topnav a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.topnav a:hover { color: var(--navy); }

/* Boutons */
.btn { display: inline-block; background: var(--navy); color: #fff; padding: 14px 22px; border-radius: 10px; font-weight: 600; text-decoration: none; border: 2px solid var(--navy); cursor: pointer; font-size: 16px; font-family: inherit; transition: transform 0.15s, background 0.15s; }
.btn:hover { background: var(--navy-2); transform: translateY(-1px); }
.btn:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--bg-alt); }
.btn-small { padding: 9px 16px; font-size: 15px; }
.btn-full { width: 100%; background: var(--accent); border-color: var(--accent); color: #2b1a00; }
.btn-full:hover { background: #e79b25; }

/* Accroche */
.hero { background: linear-gradient(180deg, #f3f6fa 0%, #fff 100%); padding: 72px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px; font-weight: 700; color: var(--accent-ink); margin: 0 0 12px; }
h1 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.1; margin: 0 0 20px; color: var(--navy); letter-spacing: -0.02em; }
.accent { color: var(--navy-2); box-shadow: inset 0 -0.35em 0 rgba(242, 169, 59, 0.45); }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.fineprint { font-size: 14px; color: var(--muted); margin-top: 18px; }

/* Visuel agenda des échéances */
.agenda { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.agenda-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; color: var(--navy); }
.agenda-tag { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent-ink); background: #fdf1de; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.agenda-list { list-style: none; margin: 0; padding: 0; }
.agenda-list li { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.agenda-list strong { display: block; color: var(--ink); font-size: 15px; }
.agenda-list small { color: var(--muted); font-size: 13px; }
.agenda-date { display: grid; place-items: center; background: var(--navy); color: #fff; border-radius: 10px; padding: 6px 0; font-size: 12px; line-height: 1.2; }
.agenda-date b { font-size: 14px; }
.agenda-foot { margin: 8px 0 0; font-size: 13px; color: var(--muted); text-align: right; }
.pill-mid { background: #fdf1de; color: #7a4a00; }
.pill-low { background: #eef2f7; color: var(--muted); }

/* Extrait de lettre */
.letter { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 28px 30px; box-shadow: var(--shadow); font-size: 15px; line-height: 1.65; position: relative; }
.letter p { margin: 0 0 12px; }
.letter-to { color: var(--muted); font-size: 14px; }
.letter-fade { color: var(--muted); -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Chiffres clés */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 56px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.stat strong { display: block; font-size: 34px; color: var(--navy); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 15px; }

/* Sections */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--navy); color: #fff; }
.section-dark h2, .section-dark .section-lead { color: #fff; }
h2 { font-size: clamp(26px, 3.2vw, 36px); line-height: 1.2; margin: 0 0 12px; color: var(--navy); letter-spacing: -0.01em; }
h3 { font-size: 19px; margin: 0 0 8px; color: var(--navy); }
h1, h2, h3 { font-weight: 700; }
.section-lead { color: var(--muted); font-size: 18px; margin: 0 0 32px; max-width: 40em; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }

/* Outil département */
.dep-tool { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.dep-label { font-weight: 600; display: block; margin-bottom: 6px; }
.dep-select { font: inherit; padding: 12px 14px; border-radius: 10px; border: 1px solid #cbd5e1; min-width: 280px; max-width: 100%; background: #fff; }
.dep-sentence { font-size: 19px; margin: 22px 0 18px; min-height: 4.8em; }
.dep-sentence strong { color: var(--navy); }
.dep-figures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.dep-figures div { background: var(--bg-alt); border-radius: 10px; padding: 14px 16px; }
.dep-figures strong { display: block; font-size: 26px; color: var(--navy); font-variant-numeric: tabular-nums; }
.dep-figures span { font-size: 14px; color: var(--muted); }
.chart-fig { margin: 0 0 24px; }
.chart-fig figcaption { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 180px; }
.bar { display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.bar-track { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar-fill { width: 100%; max-width: 44px; background: #c8d3e1; border-radius: 6px 6px 0 0; min-height: 3px; }
.bar-peak .bar-fill { background: var(--accent); }
.bar-value { font-size: 12px; color: var(--muted); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.bar-label { font-size: 12px; color: var(--muted); margin-top: 6px; text-transform: capitalize; }

/* Étapes */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.step-num { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; margin-bottom: 14px; }
.steps p, .card p { color: var(--muted); margin: 0; }

/* Listes à coches */
.checks { list-style: none; padding: 0; margin: 0 0 24px; }
.checks li { padding-left: 30px; position: relative; margin-bottom: 10px; }
.checks li::before { content: ""; position: absolute; left: 0; top: 5px; width: 18px; height: 18px; border-radius: 50%; background: var(--green); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.4 14.2-4-4 1.4-1.4 2.6 2.6 5.6-5.6 1.4 1.4-7 7z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.4 14.2-4-4 1.4-1.4 2.6 2.6 5.6-5.6 1.4 1.4-7 7z'/%3E%3C/svg%3E") center / contain no-repeat; }
.checks-light li::before { background: var(--accent); }

/* Exemple de fiche */
.sample { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); position: relative; }
.sample-tag { position: absolute; top: 18px; right: 18px; margin: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-ink); background: #fdf1de; padding: 4px 10px; border-radius: 999px; }
.sample-addr { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.sample-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin: 0 0 18px; }
.sample-grid dt { font-size: 13px; color: var(--muted); }
.sample-grid dd { margin: 0; font-weight: 600; }
.pill { background: #e7f6ef; color: #146c4a; padding: 2px 10px; border-radius: 999px; font-size: 14px; }
.sample-arg { background: var(--bg-alt); border-radius: 10px; padding: 12px 14px; margin: 0; font-size: 15px; }

/* Cartes */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }

/* Tarifs */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; position: relative; background: #fff; }
.plan .checks { flex: 1; }
.plan-featured { border: 2px solid var(--navy); box-shadow: var(--shadow); }
.plan-badge { position: absolute; top: -13px; left: 24px; margin: 0; background: var(--accent); color: #2b1a00; font-size: 13px; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.price { font-size: 38px; font-weight: 800; color: var(--navy); margin: 4px 0 18px; letter-spacing: -0.02em; }
.price small { font-size: 15px; font-weight: 500; color: var(--muted); }
.pricing-note { text-align: center; color: var(--muted); margin: 24px 0 0; }

/* Formulaire */
.form { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 28px; display: grid; gap: 14px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.form label { display: block; font-weight: 600; font-size: 15px; }
.form label > input, .form label > select { display: block; margin-top: 6px; }
.form input, .form select { font: inherit; font-weight: 400; padding: 12px 14px; border-radius: 10px; border: 1px solid #cbd5e1; width: 100%; background: #fff; }
.form .consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; color: var(--muted); }
.form .consent input { width: auto; margin-top: 4px; }
.form .consent[hidden] { display: none; }
.opt { font-weight: 400; color: var(--muted); }
.hp { position: absolute; left: -9999px; }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding: 18px 0; }
summary { cursor: pointer; font-weight: 600; font-size: 18px; color: var(--navy); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::after { content: "+"; font-weight: 400; font-size: 24px; line-height: 1; color: var(--muted); }
details[open] summary::after { content: "−"; }
summary::-webkit-details-marker { display: none; }
details p { color: var(--muted); margin: 12px 0 0; }

/* Pied de page */
.footer { background: var(--bg-alt); border-top: 1px solid var(--line); padding: 32px 0; font-size: 14px; color: var(--muted); }
.footer p { margin: 4px 0; }

/* Pages simples (mentions, merci) */
.page { padding: 64px 0; }
.page h1 { font-size: 36px; }
.page h2 { font-size: 22px; margin-top: 32px; }
.todo { background: #fdf1de; padding: 2px 6px; border-radius: 4px; }

/* Mobile */
@media (max-width: 900px) {
  .hero-grid, .two-col { grid-template-columns: 1fr; gap: 36px; }
  .agenda { max-width: 520px; }
  .stats, .steps, .cards, .pricing { grid-template-columns: 1fr; }
  .dep-figures { grid-template-columns: 1fr 1fr; }
  .topnav { display: none; }
  .topbar-inner { justify-content: space-between; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .hero { padding-top: 44px; }
  .section { padding: 56px 0; }
  .dep-tool, .form, .sample, .plan { padding: 20px; }
  .dep-select { min-width: 0; width: 100%; }
  .chart { height: 150px; gap: 3px; }
  .bar-value { font-size: 10px; }
  .bar-label { font-size: 10px; }
  .sample-grid { grid-template-columns: 1fr; }
}

/* Pages de contenu (guides, départements) */
.article { padding: 48px 20px 72px; }
.article h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 16px; }
.article h2 { font-size: 24px; margin: 40px 0 12px; }
.article h3 { margin-top: 24px; }
.article p, .article li { color: var(--ink); }
.article ul, .article ol { padding-left: 22px; }
.article li { margin-bottom: 6px; }
.article table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 15px; }
.article th, .article td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.article th { color: var(--muted); font-weight: 600; font-size: 14px; }
.article td.num, .article th.num { text-align: right; font-variant-numeric: tabular-nums; }
.article blockquote { margin: 16px 0; padding: 12px 16px; border-left: 4px solid var(--accent); background: var(--bg-alt); border-radius: 0 10px 10px 0; }
.breadcrumb { font-size: 14px; color: var(--muted); margin: 0 0 18px; }
.breadcrumb a { color: var(--muted); }
.maj { font-size: 14px; color: var(--muted); margin: -6px 0 24px; }
.cta-box { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 24px; margin: 36px 0; }
.cta-box h2, .cta-box h3 { color: #fff; margin-top: 0; }
.cta-box p { color: #dbe3ee; }
.cta-box .btn { background: var(--accent); border-color: var(--accent); color: #2b1a00; }
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; padding: 0; list-style: none; }
.link-grid a { text-decoration: none; }
.sources { font-size: 14px; color: var(--muted); }
.mini-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; height: 140px; margin: 12px 0 4px; }
.mini-chart span { display: block; background: #c8d3e1; border-radius: 4px 4px 0 0; min-height: 2px; }
.mini-chart span.pic { background: var(--accent); }
.mini-labels { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; font-size: 11px; color: var(--muted); text-align: center; }

/* Résultats de l'aperçu gratuit */
.resultats { background: var(--bg-alt); }
.res-actions { margin: 0 0 24px; }
.res-liste { display: grid; gap: 14px; }
.fiche-res { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; break-inside: avoid; }
.fiche-res header { display: flex; gap: 12px; align-items: flex-start; }
.fiche-res header div { flex: 1; }
.fiche-res h3 { margin: 0; font-size: 17px; }
.fiche-res header p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.fiche-res dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 16px; margin: 12px 0; }
.fiche-res dt { font-size: 12px; color: var(--muted); }
.fiche-res dd { margin: 0; font-weight: 600; font-size: 14px; }
.num { background: var(--navy); color: #fff; border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.notice { background: #e7f6ef; color: #146c4a; border-radius: 10px; padding: 12px 16px; font-weight: 500; }
@media (max-width: 640px) { .fiche-res dl { grid-template-columns: 1fr 1fr; } }
@media print {
  body.imprime-resultats > *:not(main), body.imprime-resultats main > *:not(#resultats) { display: none !important; }
  body.imprime-resultats .res-actions { display: none !important; }
  body.imprime-resultats .resultats { background: #fff; padding: 0; }
}

/* Tableaux des pages de contenu sur petit écran */
.article td, .article th { overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .article table { font-size: 14px; display: block; max-width: 100%; overflow-x: auto; }
  .article th, .article td { padding: 8px 6px; }
  .mini-labels { font-size: 9px; }
}

/* En-tête sur très petit écran */
.brand, .btn-small { white-space: nowrap; }
@media (max-width: 400px) {
  .topbar-inner { gap: 10px; }
  .brand { font-size: 16px; gap: 8px; }
  .btn-small { padding: 8px 12px; font-size: 14px; }
}

/* Pas de débordement des grilles sur petit écran */
.form > *, .dep-figures > *, .two-col > *, .hero-grid > * { min-width: 0; }
.form select, .form input, .dep-select { max-width: 100%; min-width: 0; }
@media (max-width: 400px) {
  .dep-figures strong { font-size: 22px; }
  .chart { gap: 2px; }
  .bar-value { font-size: 9px; }
}
