:root {
  --ink: #12263a;
  --ink-2: #33475b;
  --muted: #5d6b79;
  --line: #dfe4ea;
  --paper: #fbfaf7;
  --card: #ffffff;
  --brand: #12304f;
  --accent: #0f6e5c;
  --accent-2: #e8f3ef;
  --warn: #9a3412;
  --warn-bg: #fff4ec;
  --danger: #b42318;
  --radius: 10px;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 var(--sans); color: var(--ink); background: var(--paper); }
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--brand); }
h1, h2, h3 { font-family: var(--serif); color: var(--brand); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
code, pre, .mono { font-family: var(--mono); font-size: .88em; }
pre { background: #0f1d2b; color: #e6edf3; padding: 16px 18px; border-radius: var(--radius); overflow-x: auto; line-height: 1.5; }
code { background: #eef1f4; padding: .1em .35em; border-radius: 4px; }
pre code { background: none; padding: 0; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }

/* En-tête */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brand); font-weight: 700; font-family: var(--serif); font-size: 1.2rem; }
.logo svg { width: 28px; height: 28px; }
.nav { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.nav a:hover { color: var(--accent); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--brand); background: var(--brand); color: #fff; padding: 11px 18px; border-radius: 8px; font: 600 .98rem/1.2 var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { background: #0b2238; color: #fff; }
.btn.accent { background: var(--accent); border-color: var(--accent); }
.btn.accent:hover { background: #0b584a; }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.ghost:hover { background: #eef2f6; color: var(--brand); }
.btn.small { padding: 7px 12px; font-size: .88rem; }
.btn.danger { background: #fff; color: var(--danger); border-color: #f0c8c3; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* Sections */
section { padding: 64px 0; }
section.alt { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kicker { font: 600 .8rem/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 720px; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { margin-top: 0; }
.hero { padding: 56px 0 40px; }
.hero .grid { align-items: start; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 40px; }
.price-tag { font-family: var(--serif); font-size: 3.2rem; color: var(--brand); font-weight: 700; line-height: 1; }
.price-tag small { font: 500 1rem var(--sans); color: var(--muted); }
.checklist { list-style: none; padding: 0; margin: 0 0 1em; }
.checklist li { padding-left: 26px; position: relative; margin: 6px 0; }
.checklist li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 10px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.note { background: var(--accent-2); border-left: 3px solid var(--accent); padding: 12px 16px; border-radius: 6px; }
.warn { background: var(--warn-bg); border-left: 3px solid var(--warn); padding: 12px 16px; border-radius: 6px; color: #5b2a0e; }
.error { background: #fdecea; border-left: 3px solid var(--danger); padding: 10px 14px; border-radius: 6px; color: #7a1d14; }

/* 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: .95rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f3f5f7; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.us td { background: var(--accent-2); font-weight: 600; }

/* Formulaires */
form.stack { display: grid; gap: 14px; }
label { font-weight: 600; font-size: .92rem; color: var(--ink-2); display: block; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=number], input[type=url], input[type=tel], textarea, select {
  width: 100%; font: 1rem var(--sans); padding: 10px 12px; border: 1px solid #c9d1d9; border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid #9cc9bd; border-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: .35em; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.hint { font-size: .85rem; color: var(--muted); font-weight: 400; }
.file-drop { border: 2px dashed #c3ccd5; border-radius: var(--radius); padding: 18px; text-align: center; background: #fff; }

/* Pied de page */
footer.site { background: #0f1d2b; color: #c7d0d9; padding: 40px 0; font-size: .92rem; }
footer.site a { color: #e6edf3; text-decoration: none; }
footer.site a:hover { text-decoration: underline; }
footer.site .grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
footer.site h4 { color: #fff; margin: 0 0 8px; font-size: .95rem; }
footer.site ul { list-style: none; padding: 0; margin: 0; }
footer.site li { margin: 4px 0; }

/* Démonstration */
.demo-box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: 0 10px 30px rgba(18, 38, 58, .06); }
.demo-box h2 { font-size: 1.45rem; }
.demo-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.demo-choice label { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; font-weight: 500; display: flex; gap: 8px; align-items: center; margin: 0; }
.demo-choice input:checked + span { color: var(--accent); font-weight: 700; }
@media (max-width: 480px) { .demo-choice { grid-template-columns: 1fr; } }

/* Étapes */
.steps { counter-reset: step; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps .card { position: relative; padding-top: 44px; }
.steps .card::before { counter-increment: step; content: counter(step); position: absolute; top: 14px; left: 22px; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font: 700 .85rem/24px var(--sans); text-align: center; }

/* Calculateur */
.calc { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
.calc output { font-family: var(--serif); font-size: 2rem; color: var(--brand); font-weight: 700; }
input[type=range] { width: 100%; accent-color: var(--accent); }

/* Console */
.console { display: grid; grid-template-columns: 220px 1fr; gap: 28px; padding: 28px 0 60px; }
.console nav { display: flex; flex-direction: column; gap: 2px; }
.console nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; }
.console nav a.on, .console nav a:hover { background: #e9eef3; color: var(--brand); }
@media (max-width: 760px) { .console { grid-template-columns: 1fr; } .console nav { flex-direction: row; flex-wrap: wrap; } }
.stat { font-family: var(--serif); font-size: 2rem; color: var(--brand); font-weight: 700; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eef1f4; color: var(--ink-2); white-space: nowrap; }
.badge.completed, .badge.signed { background: #dcf1e8; color: #0b5a45; }
.badge.sent, .badge.invited, .badge.opened { background: #e6effa; color: #1c4c80; }
.badge.declined, .badge.cancelled, .badge.expired { background: #fbe9e7; color: #8a2a1d; }
.badge.test, .badge.demo { background: #fff1d6; color: #7a4b00; }
.badge.live { background: #dcf1e8; color: #0b5a45; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 12px 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .5em; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.copy { display: flex; gap: 8px; }
.copy input { font-family: var(--mono); font-size: .85rem; }
.flash { margin: 16px 0; }
.secret { font-family: var(--mono); background: #0f1d2b; color: #d7f5e9; padding: 12px 14px; border-radius: 8px; word-break: break-all; }

/* Placement des zones de signature */
.placer { display: grid; gap: 16px; }
.placer-pages { display: grid; gap: 14px; justify-items: center; background: #e9edf1; padding: 14px; border-radius: var(--radius); max-height: 70vh; overflow: auto; }
.placer-page { position: relative; box-shadow: 0 2px 8px rgba(0,0,0,.15); background: #fff; cursor: crosshair; }
.placer-page canvas { display: block; max-width: 100%; height: auto; }
.zone { position: absolute; border: 2px solid; border-radius: 4px; background: rgba(15, 110, 92, .12); font: 600 .72rem/1.2 var(--sans); padding: 2px 4px; color: #0b4d40; cursor: move; overflow: hidden; }
.zone button { position: absolute; right: 2px; top: 1px; border: 0; background: transparent; cursor: pointer; font-weight: 700; color: inherit; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.prose h2 { margin-top: 1.6em; font-size: 1.45rem; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 4px 0; }
