/* SignaturePro 2 · base commune (présentation, éditeur, versions) */
@font-face { font-family: 'Funnel Display'; src: url('../fonts/funnel-display-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Funnel Display'; src: url('../fonts/funnel-display-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Funnel Display'; src: url('../fonts/funnel-display-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument-sans-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument-sans-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument-sans-latin-ext-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument-sans-latin-ext-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument-sans-latin-ext-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #FFFFFF;
  --bg-soft: #F7F7F5;
  --bg-sunk: #F1F1EF;
  --line: #E9E9E7;
  --line-strong: #DADAD6;
  --ink: #1F1F1D;
  --ink-2: #4A4A47;
  --ink-3: #7C7C78;
  --ink-4: #A5A5A0;
  --accent: #2F6FEB;
  --accent-soft: #EAF1FE;
  --ok: #0F8A5F;
  --ok-soft: #E7F6EF;
  --warn: #B25E00;
  --warn-soft: #FFF4E5;
  --danger: #C92A2A;
  --danger-soft: #FDECEC;
  --radius: 10px;
  --radius-sm: 7px;
  --font: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --display: 'Funnel Display', 'Instrument Sans', -apple-system, sans-serif;
  --ring: 0 0 0 3px rgba(47, 111, 235, .22);
  --pop: 0 12px 40px rgba(15, 15, 15, .14), 0 0 0 1px rgba(15, 15, 15, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) {
    --bg: #191918; --bg-soft: #202020; --bg-sunk: #262625; --line: #2F2F2D; --line-strong: #3B3B39;
    --ink: #ECECEA; --ink-2: #C4C4C0; --ink-3: #95958F; --ink-4: #6C6C67;
    --accent: #6C9BFF; --accent-soft: #1E2A44; --ok: #4CC79A; --ok-soft: #13291F; --warn: #F0A447; --warn-soft: #2E2210;
    --danger: #FF7B7B; --danger-soft: #3A1818; --ring: 0 0 0 3px rgba(108, 155, 255, .3);
    --pop: 0 12px 40px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .06);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; margin: 0; color: var(--ink); }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--bg-soft); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="clair"]) .btn.primary:hover { background: #fff; } }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg-sunk); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn.big { height: 46px; padding: 0 20px; font-size: 15.5px; border-radius: 10px; }
.btn.icon { width: 36px; padding: 0; }
.btn.small.icon { width: 30px; }
.btn.danger { color: var(--danger); }
.btn svg { width: 16px; height: 16px; flex: none; }

/* Pastilles */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--bg-sunk); color: var(--ink-2); white-space: nowrap; }
.pill.soon { background: var(--warn-soft); color: var(--warn); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.outline { background: transparent; border: 1px solid var(--line-strong); }

/* Encadrés (callouts) */
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--bg-soft); color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.callout .ico { flex: none; font-size: 16px; line-height: 1.4; }
.callout.warn { background: var(--warn-soft); }
.callout.ok { background: var(--ok-soft); }
.callout.accent { background: var(--accent-soft); }
.callout b { color: var(--ink); }

/* Champs */
.field { display: block; margin: 0 0 12px; }
.field > span, .label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 0 0 5px; }
.field .hint { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.input, .field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="url"], .field input[type="date"], .field select, .field textarea {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 14.5px; transition: border-color .15s, box-shadow .15s; }
.field textarea { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-4); }
.field.error input { border-color: var(--danger); }
.field .err { display: none; font-size: 12.5px; color: var(--danger); margin-top: 5px; }
.field.error .err { display: block; }

/* Segments */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--bg-sunk); }
.seg button { height: 28px; padding: 0 11px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-3); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }

/* Interrupteur */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { position: relative; width: 34px; height: 20px; flex: none; border-radius: 999px; background: var(--line-strong); transition: background .15s; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .18s; }
.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

/* Fenêtres */
.modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 15, 15, .38); }
.modal.open { display: flex; animation: fade .16s ease; }
.modal .sheet { position: relative; width: min(640px, 100%); max-height: min(88vh, 900px); overflow: auto; background: var(--bg); border-radius: 16px; box-shadow: var(--pop); animation: rise .2s ease; }
.modal .sheet.wide { width: min(820px, 100%); }
.modal .sheet header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
.modal .sheet header h2 { font-size: 19px; flex: 1; }
.modal .sheet .body { padding: 18px; }
.modal .sheet footer { position: sticky; bottom: 0; display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; background: var(--bg); border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal .sheet { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(10px); opacity: .6; } }

/* Bulle de confirmation */
.toast-zone { position: fixed; left: 50%; bottom: 22px; z-index: 80; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 10px; background: #1F1F1D; color: #fff; font-size: 14px; box-shadow: var(--pop); pointer-events: auto; animation: rise .2s ease; max-width: calc(100vw - 32px); }
.toast button { border: 0; background: rgba(255,255,255,.14); color: #fff; height: 28px; padding: 0 10px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px; }
@media (max-width: 860px) { .toast-zone { bottom: 78px; } }

/* Mise en lumière à l'arrivée d'une pastille ou d'un lien précis */
.is-flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(47,111,235,0); } 25%, 60% { box-shadow: 0 0 0 4px rgba(47,111,235,.35); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
