/* Mon Document Unique — système de design « registre de prévention ».
   Papier chaud, vert sapin, accent ambre (signalétique de prévention, sans imiter l'État).
   Polices auto-hébergées (OFL) : Newsreader (titres), Atkinson Hyperlegible Next (texte). */

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-latin-wght-italic.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Atkinson Next";
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Next";
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: italic; font-display: swap;
}

:root {
  --paper: #f6f2ea;
  --paper-2: #eee7d9;
  --card: #fffdf8;
  --ink: #1b2422;
  --ink-soft: #4b5754;
  --pine: #0e3b36;
  --pine-2: #17584e;
  --pine-3: #d7e6e1;
  --amber: #d9982a;
  --amber-soft: #f6e3bd;
  --line: #d8cfbf;
  --lvl-faible: #2f8f55;
  --lvl-modere: #c99a22;
  --lvl-eleve: #d9731f;
  --lvl-critique: #c23b33;
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-body: "Atkinson Next", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(27, 36, 34, .06), 0 12px 32px -18px rgba(14, 59, 54, .35);
  --wrap: 1160px;
  --prose: 70ch;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font-body);
  font-feature-settings: "kern", "liga", "tnum" 0;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--pine-2); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--pine); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-display); color: var(--pine); line-height: 1.12; letter-spacing: -.01em; margin: 0 0 .5em; font-weight: 560; }
h1 { font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.75rem); font-weight: 520; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.35rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }
.eyebrow { font: 700 .78rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--pine-2); }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 60ch; }
.muted { color: var(--ink-soft); }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; background: var(--card); padding: .5rem 1rem; z-index: 99; }

/* En-tête */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--pine); text-decoration: none; font: 600 1.18rem/1 var(--font-display); letter-spacing: -.01em; }
.brand:hover { color: var(--pine); }
.brand svg { width: 30px; height: 30px; }
.brand span { font-style: italic; font-weight: 450; }
.nav { display: flex; gap: 1.4rem; margin-left: auto; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .98rem; }
.nav a:hover { color: var(--pine-2); text-decoration: underline; }
.nav .btn { color: var(--paper); }
@media (max-width: 860px) { .nav a:not(.btn) { display: none; } }
@media (max-width: 480px) { .brand { font-size: 1rem; white-space: nowrap; } .brand svg { width: 26px; height: 26px; } .nav .btn { white-space: nowrap; padding: .5rem .8rem; font-size: .85rem; } }

/* Boutons */
.btn { display: inline-flex; align-items: center; gap: .55rem; padding: .85rem 1.3rem; border-radius: 999px; font: 700 1rem/1.1 var(--font-body); text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.btn--primary { background: var(--pine); color: var(--paper); box-shadow: 0 8px 20px -10px rgba(14, 59, 54, .6); }
.btn--primary:hover { background: var(--pine-2); color: var(--paper); transform: translateY(-1px); }
.btn--secondary { background: transparent; color: var(--pine); border-color: var(--pine); }
.btn--secondary:hover { background: var(--pine-3); color: var(--pine); }
.btn--small { padding: .55rem 1rem; font-size: .92rem; }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* Hero */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 7vw, 6.5rem) 0 clamp(3rem, 6vw, 5rem);
  background-image: linear-gradient(var(--paper-2) 1px, transparent 1px), linear-gradient(90deg, var(--paper-2) 1px, transparent 1px);
  background-size: 28px 28px; background-position: -1px -1px; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 20% 40%, var(--paper) 35%, transparent 75%); pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 em { font-style: italic; color: var(--pine-2); }
.hero .ctas { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 1.4rem; }
.reassure { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; color: var(--ink-soft); font-size: .95rem; }
.reassure li::before { content: "✓"; color: var(--pine-2); font-weight: 800; margin-right: .4rem; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } }

/* Matrice G × F (élément signature) */
.matrix-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 1.4rem; box-shadow: var(--shadow); }
.matrix-card figcaption { font-size: .85rem; color: var(--ink-soft); margin-top: .9rem; }
.matrix { display: grid; grid-template-columns: auto repeat(4, 1fr); gap: 6px; align-items: center; }
.matrix .axis { font: 700 .72rem/1 var(--font-body); color: var(--ink-soft); text-align: center; letter-spacing: .06em; }
.matrix .cell { aspect-ratio: 1; border-radius: 8px; opacity: 0; transform: scale(.85); animation: pop .5s cubic-bezier(.2, .8, .2, 1) forwards; }
.matrix .cell.is-hit { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--ink); }
.lvl-faible { background: var(--lvl-faible); } .lvl-modere { background: var(--lvl-modere); }
.lvl-eleve { background: var(--lvl-eleve); } .lvl-critique { background: var(--lvl-critique); }
.risk-chip { display: grid; gap: .25rem; margin-top: 1.1rem; padding: .9rem 1rem; border-left: 4px solid var(--lvl-critique); background: var(--paper); border-radius: 0 10px 10px 0; }
.risk-chip strong { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); }
.risk-chip .calc { font: 700 .95rem/1.2 var(--font-body); font-variant-numeric: tabular-nums; }
@keyframes pop { to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.reveal { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.reveal-2 { animation-delay: .12s; } .reveal-3 { animation-delay: .24s; } .reveal-4 { animation-delay: .36s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .matrix .cell { opacity: 1; transform: none; } }

/* Bandeau loi */
.lawband { background: var(--pine); color: var(--paper); }
.lawband .wrap { display: flex; gap: 1.2rem; align-items: baseline; padding: 1.1rem 0; flex-wrap: wrap; }
.lawband strong { color: var(--amber-soft); font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.lawband a { color: var(--amber-soft); }

/* Sections */
.section { padding: clamp(3rem, 6vw, 5.5rem) 0; }
.section--alt { background: var(--paper-2); }
.section-head { max-width: 62ch; margin-bottom: 2.2rem; }
.grid { display: grid; gap: 1.2rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } .grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .35em; }
.card p:last-child { margin-bottom: 0; }
.step { counter-increment: step; position: relative; padding-top: 3.2rem; }
.step::before { content: counter(step, decimal-leading-zero); position: absolute; top: 1.1rem; left: 1.4rem; font: 600 1.6rem/1 var(--font-display); color: var(--amber); }
.steps { counter-reset: step; }

/* Cartes métier */
.metier-card { display: flex; flex-direction: column; gap: .3rem; text-decoration: none; color: var(--ink); transition: transform .15s ease, border-color .15s ease; }
.metier-card:hover { transform: translateY(-3px); border-color: var(--pine-2); color: var(--ink); }
.metier-card strong { font: 600 1.2rem/1.2 var(--font-display); color: var(--pine); }
.metier-card .meta { font-size: .88rem; color: var(--ink-soft); }

/* Tarifs */
.price-card { display: flex; flex-direction: column; gap: .6rem; }
.price-card .amount { font: 560 2.8rem/1 var(--font-display); color: var(--pine); }
.price-card .amount small { font: 600 .9rem var(--font-body); color: var(--ink-soft); }
.price-card ul { padding-left: 1.1rem; margin: .4rem 0 1rem; }
.price-card.is-featured { border: 2px solid var(--pine); }
.vat { font-size: .9rem; color: var(--ink-soft); }

/* Tableaux */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: .97rem; }
th, td { padding: .75rem .9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { background: var(--pine); color: var(--paper); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
td.us { background: var(--pine-3); font-weight: 700; }

/* Pages de contenu */
.page-head { padding: 2.4rem 0 1.6rem; border-bottom: 1px solid var(--line); }
.crumbs { font-size: .88rem; color: var(--ink-soft); margin-bottom: 1rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0; }
.crumbs li + li::before { content: "›"; margin-right: .4rem; color: var(--line); }
.updated { font-size: .92rem; color: var(--ink-soft); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 3.5rem; padding: 2.5rem 0 4rem; }
.layout.is-single { grid-template-columns: minmax(0, var(--prose)); }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; } .toc { display: none; } }
.prose { max-width: var(--prose); }
.prose h2 { margin-top: 2.2em; padding-top: .2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .3em 0; }
.prose blockquote { margin: 1.4em 0; padding: 1rem 1.2rem; background: var(--card); border-left: 4px solid var(--amber); border-radius: 0 10px 10px 0; }
.prose table { margin: 1.2em 0; }
.prose strong { color: var(--ink); }
.toc { position: sticky; top: 96px; align-self: start; font-size: .93rem; }
.toc ol { list-style: none; padding: 0; margin: .6rem 0 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: .3rem 0 .3rem .9rem; color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--pine); }
.toc a.btn { display: inline-flex; padding: .55rem 1rem; color: var(--paper); }
.toc a.btn:hover { color: var(--paper); }
.cta-box { margin: 2.5rem 0; padding: 1.6rem; border-radius: 18px; background: var(--pine); color: var(--paper); }
.cta-box h2, .cta-box h3 { color: var(--paper); margin-top: 0; }
.cta-box .btn--primary { background: var(--amber); color: var(--ink); }
.cta-box .btn--primary:hover { background: #e7ab45; color: var(--ink); }
.sources { font-size: .92rem; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 1.2rem; margin-top: 2.5rem; }
.disclaimer { font-size: .9rem; color: var(--ink-soft); font-style: italic; }

/* Risques (pages métier) */
.unite { margin: 2rem 0; }
.unite h3 { display: flex; align-items: baseline; gap: .6rem; }
.unite h3 small { font: 600 .82rem var(--font-body); color: var(--ink-soft); }
.risk { display: grid; grid-template-columns: 6px 1fr auto; gap: 0 1rem; padding: .9rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: .6rem; }
.risk .bar { border-radius: 4px; }
.risk h4 { margin: 0 0 .2rem; font: 700 1rem/1.3 var(--font-body); color: var(--ink); }
.risk p { margin: 0; font-size: .94rem; color: var(--ink-soft); }
.risk .score { text-align: right; font: 700 .82rem/1.3 var(--font-body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.risk .score b { display: block; font-size: .75rem; letter-spacing: .08em; }
.t-faible { color: #1f6b3f; } .t-modere { color: #7d5f0c; } .t-eleve { color: #9a4c0c; } .t-critique { color: #962019; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.faq summary { cursor: pointer; font: 600 1.12rem/1.35 var(--font-display); color: var(--pine); list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.5rem/1 var(--font-body); color: var(--amber); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: .7rem 0 0; }

/* Outils (diagnostic, simulateur) */
.tool { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: clamp(1.2rem, 3vw, 2rem); box-shadow: var(--shadow); }
.tool label { font-weight: 700; display: block; margin-bottom: .4rem; }
.tool input[type="number"], .tool input[type="email"] { width: 100%; max-width: 22rem; padding: .75rem .9rem; font: inherit; border: 2px solid var(--line); border-radius: 10px; background: var(--paper); }
.tool input:focus { border-color: var(--pine-2); outline: none; }
.tool .result { margin-top: 1rem; font-weight: 700; color: var(--pine); }
.progress { height: 6px; background: var(--paper-2); border-radius: 99px; overflow: hidden; margin: .8rem 0 1.4rem; }
.progress > span { display: block; height: 100%; background: var(--pine-2); transition: width .3s ease; }
.options { display: grid; gap: .6rem; }
.options button { text-align: left; padding: 1rem 1.1rem; min-height: 52px; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); font: 600 1rem/1.35 var(--font-body); color: var(--ink); cursor: pointer; }
.options button:hover, .options button[aria-pressed="true"] { border-color: var(--pine); background: var(--pine-3); }
.checkbox { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400 !important; font-size: .95rem; }
.checkbox input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; accent-color: var(--pine); }

/* Pied de page */
.site-footer { background: var(--pine); color: #dfe9e5; padding: 3.5rem 0 2rem; margin-top: 0; }
.site-footer a { color: #f3efe6; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--amber-soft); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
.footer-grid h2 { font: 700 .8rem/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--amber-soft); margin-bottom: 1rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; font-size: .95rem; }
.footer-legal { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 2.5rem; padding-top: 1.4rem; font-size: .85rem; color: #b9ccc5; }
.site-footer .brand { color: var(--paper); }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* Générateur (app) */
.alert { padding: .9rem 1.1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.alert--error { border-color: var(--lvl-critique); color: #8f231d; }
.alert--info { border-color: var(--pine-2); }
.file-list { list-style: none; padding: 0; display: grid; gap: .6rem; }
.page-head h1 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3.1rem); max-width: 26ch; }

/* Générateur (assistant en 5 étapes) */
.generator { padding: 2rem 0 4rem; max-width: 900px; }
.wizard-steps { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0 0 1.8rem; counter-reset: none; }
.wizard-steps li { display: flex; align-items: center; gap: .45rem; padding: .45rem .8rem; border-radius: 99px; background: var(--paper-2); color: var(--ink-soft); font-size: .9rem; font-weight: 600; }
.wizard-steps li span { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--card); font-size: .8rem; }
.wizard-steps li[aria-current="step"] { background: var(--pine); color: var(--paper); }
.wizard-steps li[aria-current="step"] span { background: var(--amber); color: var(--ink); }
.wizard-steps li.is-done { color: var(--pine-2); }
.wizard-steps li.is-done span { background: var(--pine-3); }
@media (max-width: 640px) { .wizard-steps li:not([aria-current="step"]) { font-size: 0; padding: .45rem; } .wizard-steps li:not([aria-current="step"]) span { font-size: .8rem; } }
#duerp-form > section { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: clamp(1.2rem, 3vw, 2rem); box-shadow: var(--shadow); }
#duerp-form h2 { font-size: 1.7rem; outline: none; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.2rem; margin-top: 1rem; }
@media (max-width: 640px) { .fields { grid-template-columns: 1fr; } }
.field label, .field > span { display: block; font-weight: 700; font-size: .93rem; margin-bottom: .35rem; }
.field input, .field textarea, .cot select { width: 100%; padding: .7rem .85rem; font: inherit; border: 2px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); }
.field input:focus, .field textarea:focus, .cot select:focus { border-color: var(--pine-2); outline: none; }
.more { margin-top: 1.4rem; }
.more summary { cursor: pointer; font-weight: 700; color: var(--pine-2); }
.unit-toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-top: 1rem; }
@media (max-width: 640px) { .unit-toggles { grid-template-columns: 1fr; } }
.unit-toggle { display: flex; gap: .8rem; align-items: flex-start; padding: .9rem 1rem; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; }
.unit-toggle:has(input:checked) { border-color: var(--pine-2); background: var(--pine-3); }
.unit-toggle input { width: 1.2rem; height: 1.2rem; margin-top: .15rem; accent-color: var(--pine); }
.unit-toggle small { display: block; color: var(--ink-soft); font-weight: 400; }
.unit { margin-top: 1.6rem; }
.unit__title { font-size: 1.25rem; border-bottom: 2px solid var(--amber); padding-bottom: .3rem; }
.risk-card { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); margin: .6rem 0; }
.risk-card__head { display: flex; gap: .8rem; align-items: flex-start; padding: .85rem 1rem; cursor: pointer; }
.risk-card__head input { width: 1.15rem; height: 1.15rem; margin-top: .2rem; accent-color: var(--pine); flex: none; }
.risk-card__details { border-top: 1px solid var(--line); padding: 0 1rem; }
.risk-card__details summary { cursor: pointer; padding: .6rem 0; font-weight: 700; font-size: .9rem; color: var(--pine-2); }
.risk-card__body { padding-bottom: 1rem; display: grid; gap: .8rem; }
.risk-card__body p { margin: 0; font-size: .94rem; color: var(--ink-soft); }
.cot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.cot-grid .field input { width: 100%; }
@media (max-width: 640px) { .cot-grid { grid-template-columns: 1fr; } }
.cot span { display: block; font-weight: 700; font-size: .85rem; margin-bottom: .3rem; }
.summary { display: grid; grid-template-columns: max-content 1fr; gap: .6rem 1.4rem; margin: 1rem 0 1.4rem; }
.summary dt { font-weight: 700; color: var(--ink-soft); }
.summary dd { margin: 0; }
@media (max-width: 640px) { .summary { grid-template-columns: 1fr; } .summary dd { margin-bottom: .6rem; } }
.pdf-preview { width: 100%; height: min(78vh, 900px); border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); margin: 1rem 0; }
.wizard-nav { display: flex; justify-content: space-between; gap: 1rem; margin: 1.2rem 0 1.6rem; }
.wizard-nav [data-next] { margin-left: auto; }
[data-errors]:not([hidden]) { margin-top: 1rem; }
#form-error:empty { display: none; }
