/* Prevenzo — design system
   Couleurs : vert prévention #0f5d4a (confiance, sécurité) + ambre #f2b544 (vigilance)
   Typographie : pile système (rapide, pas de tiers, RGPD-friendly) */
:root {
  --green-900: #0b4a3b; --green-700: #0f5d4a; --green-500: #1f8a6d; --green-100: #e3f2ec; --green-50: #f2f8f5;
  --amber: #f2b544; --amber-100: #fdf1d8;
  --ink: #1c2b27; --muted: #5d6f6a; --line: #e2e8e5; --bg: #fafbfa; --white: #fff;
  --red: #c23b30; --red-100: #fbe4e1; --orange: #d9741c; --orange-100: #fcebdc; --yellow-100: #fbf3cf; --yellow: #a98400;
  --radius: 12px; --shadow: 0 1px 2px rgba(16,40,32,.06), 0 6px 24px rgba(16,40,32,.06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 16px; }
a { color: var(--green-700); }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.mt0 { margin-top: 0 } .mb0 { margin-bottom: 0 } .mt2 { margin-top: 2rem } .mb2 { margin-bottom: 2rem }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 20px; }
@media (min-width: 760px) { .g2 { grid-template-columns: 1fr 1fr } .g3 { grid-template-columns: repeat(3, 1fr) } .g4 { grid-template-columns: repeat(4, 1fr) } }

/* Header */
.header { background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header .container { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.25rem; color: var(--green-900); text-decoration: none; letter-spacing: -.02em; }
.brand img { width: 30px; height: 30px; }
.nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav a:hover { color: var(--green-700); }
.nav a.btn-primary, .nav a.btn-primary:hover { color: #fff; }
.nav .hide-sm { display: none; }
@media (min-width: 760px) { .nav .hide-sm { display: inline; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-900); }
.btn-accent { background: var(--amber); color: #3a2a00; }
.btn-accent:hover { background: #e8a52a; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #c9d3cf; }
.btn-danger { background: #fff; color: var(--red); border-color: #efc6c1; }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 8px; }
.btn-lg { padding: 15px 24px; font-size: 1.05rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; color: var(--muted); font: inherit; font-size: .85rem; cursor: pointer; text-decoration: underline; padding: 0; }

/* Hero */
.hero { padding: 64px 0 48px; background: radial-gradient(1200px 400px at 70% -10%, var(--green-100), transparent), var(--bg); }
.hero .grid { align-items: center; }
@media (min-width: 900px) { .hero .grid { grid-template-columns: 1.1fr .9fr; } }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; background: var(--amber-100); color: #6b4a00; padding: 6px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; margin-bottom: 16px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 40em; }
.checks { list-style: none; padding: 0; margin: 20px 0; }
.checks li { padding-left: 28px; position: relative; margin: 8px 0; }
.checks li::before { content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--green-100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 10 3.5 3.5L15 7' fill='none' stroke='%230f5d4a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }

/* Cards */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.section { padding: 64px 0; }
.section.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kpi { font-size: 2rem; font-weight: 800; color: var(--green-700); line-height: 1; }
.step-n { width: 32px; height: 32px; border-radius: 50%; background: var(--green-700); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 12px; }
.alert { padding: 14px 16px; border-radius: 10px; border: 1px solid; margin: 0 0 16px; }
.alert-warn { background: var(--amber-100); border-color: #f0d79c; color: #5d4300; }
.alert-ok { background: var(--green-50); border-color: #bfdfd2; color: var(--green-900); }
.alert-err { background: var(--red-100); border-color: #efc6c1; color: #7a221b; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.b-faible { background: var(--green-100); color: var(--green-900); }
.b-modere { background: var(--yellow-100); color: #6b5300; }
.b-eleve { background: var(--orange-100); color: #8a4210; }
.b-critique { background: var(--red-100); color: #8a221b; }
.b-neutral { background: #eef1f0; color: var(--muted); }

/* Mock document in hero */
.mockdoc { background: #fff; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(15,93,74,.15); padding: 20px; font-size: .85rem; transform: rotate(1deg); }
.mockdoc table { width: 100%; border-collapse: collapse; }
.mockdoc td, .mockdoc th { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.mockdoc th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* Pricing */
.price-card { position: relative; display: flex; flex-direction: column; }
.price-card.featured { border: 2px solid var(--green-700); }
.price-card .ribbon { position: absolute; top: -12px; left: 24px; background: var(--green-700); color: #fff; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.price { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; }
.price small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.toggle { display: inline-flex; background: #eef1f0; border-radius: 999px; padding: 4px; }
.toggle button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; color: var(--muted); }
.toggle button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* FAQ */
details { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 18px; margin-bottom: 10px; }
summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; float: right; color: var(--muted); font-weight: 400; }
details[open] summary::after { content: "–"; }
details > div { padding: 0 0 16px; color: var(--muted); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 40px 0; background: #fff; font-size: .9rem; color: var(--muted); margin-top: 48px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--ink); }
.footer .cols { display: grid; gap: 24px; }
@media (min-width: 760px) { .footer .cols { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin: 6px 0; }

/* Forms */
label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.hint { font-size: .8rem; color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=number], input[type=date], select, textarea {
  width: 100%; font: inherit; font-size: .95rem; padding: 10px 12px; border: 1px solid #cfd8d4; border-radius: 8px; background: #fff; color: var(--ink);
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green-500); outline-offset: 0; border-color: var(--green-500); }
.sector-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.sector-opt { position: relative; }
.sector-opt input { position: absolute; opacity: 0; }
.sector-opt span { display: block; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-weight: 500; }
.sector-opt input:checked + span { border-color: var(--green-700); background: var(--green-50); box-shadow: 0 0 0 1px var(--green-700); }
.sector-opt input:focus-visible + span { outline: 2px solid var(--green-500); }

/* App */
.app-shell { padding-top: 32px; padding-bottom: 64px; }
.page-head { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 1.75rem; margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--green-700); border-color: var(--green-700); }
.progress { height: 8px; background: #e7ecea; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--green-500); }
.unit { margin-bottom: 28px; }
.unit-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.unit-head h2 { font-size: 1.3rem; margin: 0; }
.risk { background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
.risk > summary { padding: 14px 16px; display: flex; gap: 10px; align-items: center; font-weight: 600; }
.risk > summary::after { margin-left: auto; }
.risk form { padding: 0 16px 16px; }
.risk-grid { display: grid; gap: 12px; }
@media (min-width: 760px) { .risk-grid { grid-template-columns: 1fr 1fr; } .risk-grid .full { grid-column: 1 / -1; } }
.saved { color: var(--green-500); font-size: .85rem; font-weight: 600; opacity: 0; transition: opacity .3s; }
.saved.show { opacity: 1; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: #fff; font-size: .9rem; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f6f8f7; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.paywall { border: 2px dashed #cfd8d4; background: #fff; border-radius: var(--radius); padding: 24px; text-align: center; }

/* Document (DUERP) */
.doc { background: #fff; max-width: 1000px; margin: 0 auto; padding: 40px; border: 1px solid var(--line); border-radius: 8px; position: relative; font-size: 13px; }
.doc h1 { font-size: 26px; } .doc h2 { font-size: 18px; margin-top: 28px; border-bottom: 2px solid var(--green-700); padding-bottom: 4px; } .doc h3 { font-size: 15px; margin-top: 18px; }
.doc table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; page-break-inside: auto; }
.doc th, .doc td { border: 1px solid #c8d1cd; padding: 6px 8px; vertical-align: top; text-align: left; }
.doc th { background: var(--green-50); font-size: 11px; text-transform: uppercase; }
.doc tr { page-break-inside: avoid; }
.doc .cover { border: 2px solid var(--green-700); border-radius: 8px; padding: 24px; margin-bottom: 24px; }
.watermark { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(-30deg, transparent 0 140px, rgba(194,59,48,.06) 140px 142px); }
.watermark::before { content: "APERÇU — NON PUBLIÉ"; position: sticky; top: 40%; display: block; text-align: center; font-size: 48px; font-weight: 800; color: rgba(194,59,48,.12); transform: rotate(-20deg); }
.toolbar { max-width: 1000px; margin: 0 auto 16px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: #fff; }
  .header, .footer, .toolbar, .no-print { display: none !important; }
  .doc { border: 0; padding: 0; max-width: none; }
  .doc.preview { display: none; }
  .print-block { display: block !important; }
}
.print-block { display: none; }

.grid > * { min-width: 0; }
@media (max-width: 600px) {
  .btn-lg { white-space: normal; text-align: center; }
  .hero .row .btn { width: 100%; }
  .nav { gap: 12px; }
  .mockdoc { transform: none; overflow: hidden; }
  .mockdoc th:nth-child(4), .mockdoc td:nth-child(4) { display: none; }
  .doc { padding: 16px; }
  .section { padding: 44px 0; }
  .hero { padding: 40px 0 32px; }
}

/* Articles */
.prose { font-size: 1.05rem; }
.prose h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.prose h2 { font-size: 1.45rem; margin-top: 2em; }
.prose p, .prose li { line-height: 1.7; }
.prose li { margin: 6px 0; }
.prose table.data { font-size: .9rem; margin: 12px 0 20px; }
.prose .lead { font-size: 1.15rem; }
.prose .btn { white-space: normal; text-align: center; }
