/* =====================================================================
   Webntic Facture — système de design
   Polices : Bricolage Grotesque (titres) + Figtree (texte)
   ===================================================================== */
:root {
  --brand: #0045F0;
  --brand-600: #0039C7;
  --brand-50: #EEF3FF;
  --brand-100: #DCE6FF;
  --violet: #BD29F0;
  --violet-50: #F8ECFE;
  --ink: #0B1020;
  --ink-2: #1D2440;
  --muted: #5B6478;
  --muted-2: #8A92A6;
  --line: #E6E9F2;
  --line-2: #F0F2F8;
  --bg: #F6F7FB;
  --white: #fff;
  --green: #0E9F6E; --green-50: #E7F7F0;
  --amber: #C27803; --amber-50: #FEF5E2;
  --red: #E02424;   --red-50: #FDECEC;
  --grad: linear-gradient(120deg, #0045F0 0%, #5B3CF5 55%, #BD29F0 100%);
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(11,16,32,.06), 0 1px 1px rgba(11,16,32,.04);
  --shadow: 0 10px 30px -12px rgba(11,16,32,.18), 0 2px 6px rgba(11,16,32,.05);
  --shadow-lg: 0 30px 70px -20px rgba(0,40,140,.35);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--white); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -.02em; line-height: 1.12; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .85em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ico { width: 20px; height: 20px; flex: none; }
.ico-lg { width: 28px; height: 28px; flex: none; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .72rem 1.2rem; border-radius: 12px; border: 1px solid transparent; font: 600 .95rem/1 var(--font); cursor: pointer; text-decoration: none !important; transition: transform .12s ease, box-shadow .2s ease, background .2s ease; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px -8px rgba(0,69,240,.6); }
.btn-primary:hover { background: var(--brand-600); }
.btn-grad { background: var(--grad); color: #fff; box-shadow: 0 10px 26px -10px rgba(91,60,245,.7); }
.btn-grad:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #C9D0E2; background: #FBFCFE; }
.btn-soft { background: var(--brand-50); color: var(--brand); }
.btn-soft:hover { background: var(--brand-100); }
.btn-danger { background: var(--red-50); color: var(--red); }
.btn-danger:hover { background: #FAD5D5; }
.btn-success { background: var(--green); color: #fff; }
.btn-wave { background: #1DC8FF; color: #062A3A; }
.btn-om { background: #FF7900; color: #fff; }
.btn-white { background: #fff; color: var(--ink); }
.btn-lg { padding: 1rem 1.5rem; font-size: 1.02rem; border-radius: 14px; }
.btn-sm { padding: .5rem .8rem; font-size: .85rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-gray { background: #EEF0F5; color: #4B5368; }
.badge-blue { background: var(--brand-50); color: var(--brand); }
.badge-green { background: var(--green-50); color: var(--green); }
.badge-amber { background: var(--amber-50); color: var(--amber); }
.badge-red { background: var(--red-50); color: var(--red); }
.badge-violet { background: var(--violet-50); color: #9A12CC; }
.pill { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .85rem; border-radius: 999px; background: var(--brand-50); color: var(--brand); font-weight: 600; font-size: .85rem; }

/* ---------- Formulaires ---------- */
.field { margin-bottom: 1.05rem; }
.field label, .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; color: var(--ink-2); }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: .35rem; }
.input, select.input, textarea.input { width: 100%; padding: .78rem .9rem; border: 1px solid var(--line); border-radius: 12px; font: 400 .97rem/1.3 var(--font); color: var(--ink); background: #fff; transition: border .15s, box-shadow .15s; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(0,69,240,.12); }
.input-lg { padding: 1rem 1.1rem; font-size: 1.05rem; border-radius: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1.1rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); }
.req { color: var(--red); }

/* ---------- Alertes ---------- */
.alert { display: flex; gap: .75rem; align-items: flex-start; padding: .95rem 1.1rem; border-radius: 14px; margin-bottom: 1rem; font-size: .95rem; }
.alert .ico { margin-top: 1px; }
.alert-success { background: var(--green-50); color: #065F46; }
.alert-error { background: var(--red-50); color: #9B1C1C; }
.alert-info { background: var(--brand-50); color: #0B3BA8; }
.alert-warning { background: var(--amber-50); color: #8A5300; }

/* =====================================================================
   SITE VITRINE
   ===================================================================== */
.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.wrap-sm { width: min(820px, 100% - 40px); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid rgba(230,233,242,.7); }
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; height: 72px; }
.logo { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -.03em; color: var(--ink); text-decoration: none !important; }
.logo .w { color: var(--brand); } .logo .n { color: var(--violet); }
.logo .tag { font: 600 .68rem/1 var(--font); letter-spacing: .08em; text-transform: uppercase; padding: .32rem .5rem; border-radius: 7px; background: var(--ink); color: #fff; }
.nav { display: flex; gap: .25rem; margin-left: auto; }
.nav a { color: var(--ink-2); font-weight: 500; padding: .55rem .8rem; border-radius: 10px; text-decoration: none; font-size: .95rem; }
.nav a:hover, .nav a.is-active { background: var(--line-2); }
.header-cta { display: flex; gap: .5rem; }
.burger { display: none; margin-left: auto; background: none; border: 0; padding: .4rem; cursor: pointer; color: var(--ink); }

.hero { position: relative; overflow: hidden; padding: 84px 0 70px; background:
  radial-gradient(900px 500px at 85% -10%, rgba(189,41,240,.16), transparent 60%),
  radial-gradient(800px 500px at 0% 10%, rgba(0,69,240,.14), transparent 60%), #fff; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.9rem); margin-bottom: .45em; }
.hero .lead { font-size: 1.2rem; color: var(--muted); max-width: 34em; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.8rem 0 1.4rem; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 1.2rem; color: var(--muted); font-size: .92rem; }
.hero-proof span { display: inline-flex; align-items: center; gap: .4rem; }
.hero-proof .ico { color: var(--green); width: 18px; height: 18px; }

/* Maquette de facture */
.mock { position: relative; }
.mock-card { background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 26px; transform: rotate(-1.2deg); }
.mock-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.mock-top .t { font: 800 1.5rem/1 var(--font-display); }
.mock-meta { font-size: .78rem; color: var(--muted); text-align: right; line-height: 1.5; }
.mock-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.mock-parties div { background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: .74rem; color: var(--muted); line-height: 1.45; }
.mock-parties b { display: block; color: var(--ink); font-size: .82rem; }
.mock-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: .85rem; }
.mock-total { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--brand-50); color: var(--brand); font-weight: 800; font-family: var(--font-display); font-size: 1.15rem; }
.mock-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.mock-foot .qr { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); flex: none; }
.mock-foot .qr svg { width: 100%; height: 100%; }
.mock-foot small { color: var(--muted); font-size: .72rem; line-height: 1.4; }
.mock-chip { position: absolute; display: flex; align-items: center; gap: .55rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .7rem .9rem; box-shadow: var(--shadow); font-weight: 600; font-size: .86rem; }
.mock-chip .dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.mock-chip.c1 { left: -26px; top: 34%; }
.mock-chip.c2 { right: -18px; bottom: 12%; }
.mock-chip small { display: block; color: var(--muted); font-weight: 500; font-size: .74rem; }

.section { padding: 92px 0; }
.section-alt { background: var(--bg); }
.section-dark { background: #0B1020; color: #E7EAF3; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .muted { color: #A2A9BD; }
.section-head { max-width: 720px; margin: 0 auto 52px; text-align: center; }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); }
.section-head p { color: var(--muted); font-size: 1.12rem; }
.eyebrow { display: inline-block; font-weight: 700; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin-bottom: .9rem; }

.law-band { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; background: var(--grad); color: #fff; border-radius: 28px; padding: 46px; box-shadow: var(--shadow-lg); }
.law-band h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.law-band p { color: rgba(255,255,255,.88); }
.law-facts { display: grid; gap: 12px; }
.law-fact { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); border-radius: 16px; padding: 16px 18px; }
.law-fact b { display: block; font-family: var(--font-display); font-size: 1.15rem; }
.law-fact span { font-size: .9rem; color: rgba(255,255,255,.85); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; transition: transform .2s, box-shadow .2s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature .fi { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; margin-bottom: 18px; background: var(--brand-50); color: var(--brand); }
.feature:nth-child(3n+2) .fi { background: var(--violet-50); color: #9A12CC; }
.feature:nth-child(3n) .fi { background: var(--green-50); color: var(--green); }
.feature h3 { font-size: 1.2rem; }
.feature p { color: var(--muted); margin: 0; font-size: .97rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
.step { position: relative; padding: 30px; border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--line); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--ink); color: #fff; font: 700 1.1rem var(--font-display); margin-bottom: 16px; }
.step h3 { font-size: 1.2rem; }
.step p { color: var(--muted); margin: 0; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.checklist { list-style: none; padding: 0; margin: 1.2rem 0; display: grid; gap: .75rem; }
.checklist li { display: flex; gap: .7rem; align-items: flex-start; }
.checklist .ico { color: var(--green); margin-top: 3px; }
.pay-visual { display: grid; gap: 14px; }
.pay-card { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.pay-card .logo-sq { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font: 800 1.05rem var(--font-display); color: #fff; flex: none; }
.pay-card b { display: block; }
.pay-card span { color: var(--muted); font-size: .9rem; }
.pay-card .amt { margin-left: auto; font: 700 1.05rem var(--font-display); }

.pricing { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: stretch; }
.price { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px 24px; }
.price.featured { border: 2px solid var(--brand); box-shadow: var(--shadow-lg); }
.price .flag { position: absolute; top: -13px; left: 24px; background: var(--grad); color: #fff; font-size: .75rem; font-weight: 700; padding: .3rem .7rem; border-radius: 999px; }
.price h3 { font-size: 1.15rem; margin-bottom: .2em; }
.price .amount { font: 800 2.2rem/1.1 var(--font-display); letter-spacing: -.03em; margin: .5rem 0 .2rem; }
.price .amount small { font: 500 .9rem var(--font); color: var(--muted); letter-spacing: 0; }
.price ul { list-style: none; padding: 0; margin: 1.2rem 0 1.6rem; display: grid; gap: .6rem; font-size: .93rem; }
.price li { display: flex; gap: .55rem; }
.price li .ico { color: var(--green); width: 18px; height: 18px; margin-top: 2px; }
.price .btn { margin-top: auto; }

.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 0 22px; }
.faq summary { cursor: pointer; list-style: none; padding: 20px 0; font-weight: 600; font-size: 1.04rem; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--brand); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); padding-bottom: 18px; margin: 0; }

.cta-final { text-align: center; background: radial-gradient(700px 300px at 50% 0%, rgba(189,41,240,.35), transparent 70%), #0B1020; color: #fff; border-radius: 30px; padding: 70px 30px; }
.cta-final h2 { color: #fff; font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
.cta-final p { color: #B8BFD1; font-size: 1.1rem; }

.site-footer { background: #0B1020; color: #A2A9BD; padding: 64px 0 30px; font-size: .94rem; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.site-footer h4 { color: #fff; font-family: var(--font); font-size: .95rem; letter-spacing: 0; margin-bottom: 1rem; }
.site-footer a { color: #C9CEDC; display: block; padding: .22rem 0; }
.site-footer .logo { color: #fff; }
.site-footer .bottom { border-top: 1px solid #1E2540; margin-top: 44px; padding-top: 22px; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .85rem; }

.page-hero { padding: 72px 0 40px; background: radial-gradient(700px 360px at 90% 0%, rgba(189,41,240,.12), transparent 60%), radial-gradient(700px 360px at 0% 0%, rgba(0,69,240,.10), transparent 60%); }
.page-hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); max-width: 18em; }
.page-hero .lead { font-size: 1.18rem; color: var(--muted); max-width: 40em; }
.prose { font-size: 1.05rem; }
.prose h2 { font-size: 1.75rem; margin-top: 2.2em; }
.prose h3 { font-size: 1.25rem; margin-top: 1.6em; }
.prose p, .prose li { color: #2C3450; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .45em; }
.callout { border-left: 4px solid var(--brand); background: var(--brand-50); padding: 18px 22px; border-radius: 0 14px 14px 0; margin: 1.6em 0; }
.callout.warn { border-color: var(--amber); background: var(--amber-50); }
.timeline { list-style: none; padding: 0; margin: 1.5em 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1.4em 1.6em; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.timeline b { display: block; font-family: var(--font-display); }
.table-simple { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .97rem; }
.table-simple th, .table-simple td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-simple th { background: var(--bg); font-weight: 700; }
.toc { position: sticky; top: 96px; display: grid; gap: .2rem; font-size: .92rem; }
.toc a { color: var(--muted); padding: .35rem .6rem; border-radius: 8px; }
.toc a:hover { background: var(--line-2); color: var(--ink); text-decoration: none; }
.doc-layout { display: grid; grid-template-columns: 230px 1fr; gap: 56px; }
.sources { font-size: .9rem; color: var(--muted); }

/* =====================================================================
   AUTHENTIFICATION
   ===================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { position: relative; background: var(--grad); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; inset: auto -120px -160px auto; width: 420px; height: 420px; border-radius: 50%; background: rgba(255,255,255,.08); }
.auth-side h2 { color: #fff; font-size: 2.2rem; max-width: 12em; }
.auth-side .logo { color: #fff; } .auth-side .logo .w, .auth-side .logo .n { color: #fff; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.auth-box { width: min(440px, 100%); }
.auth-box h1 { font-size: 2rem; }

/* =====================================================================
   APPLICATION
   ===================================================================== */
body.app { background: var(--bg); }
.app-shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #0B1020; color: #C9CEDC; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; }
.sidebar .logo { color: #fff; padding: 4px 10px 18px; font-size: 1.25rem; }
.side-link { display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem; border-radius: 12px; color: #C9CEDC; font-weight: 500; font-size: .95rem; text-decoration: none !important; }
.side-link:hover { background: #161D36; color: #fff; }
.side-link.is-active { background: linear-gradient(90deg, rgba(0,69,240,.9), rgba(91,60,245,.75)); color: #fff; box-shadow: 0 8px 20px -10px rgba(0,69,240,.9); }
.side-title { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #6B7392; padding: 14px 12px 6px; font-weight: 700; }
.side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid #1E2540; font-size: .82rem; }
.plan-box { background: #161D36; border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.plan-box b { color: #fff; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; height: 70px; padding: 0 28px; background: rgba(246,247,251,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .company { font-weight: 700; display: flex; align-items: center; gap: .6rem; }
.topbar .actions { margin-left: auto; display: flex; gap: .6rem; align-items: center; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 700; font-size: .85rem; }
.user-menu { position: relative; }
.user-menu > button { display: flex; align-items: center; gap: .5rem; background: none; border: 0; cursor: pointer; padding: 4px; border-radius: 12px; color: var(--ink); font: inherit; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; display: none; }
.dropdown.open { display: block; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .6rem .7rem; border-radius: 10px; color: var(--ink); font: 500 .92rem var(--font); background: none; border: 0; cursor: pointer; text-decoration: none; }
.dropdown a:hover, .dropdown button:hover { background: var(--bg); }
.content { padding: 28px; max-width: 1320px; }
.page-title { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 24px; }
.page-title h1 { font-size: 1.85rem; margin: 0; }
.page-title .sub { color: var(--muted); margin: .2rem 0 0; }
.page-title .tools { margin-left: auto; display: flex; gap: .6rem; flex-wrap: wrap; }
.mobile-only { display: none; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 18px; }
.card h2 { font-size: 1.2rem; }
.card-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 16px; }
.card-head h2 { margin: 0; }
.card-head .tools { margin-left: auto; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }

/* Grosses tuiles du tableau de bord */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 14px; min-height: 150px; padding: 22px; border-radius: 22px; background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none !important; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .2s ease, border-color .2s; }
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #D3DAEC; }
.tile .ti { width: 56px; height: 56px; border-radius: 17px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.tile .ti .ico { width: 28px; height: 28px; }
.tile b { font: 700 1.12rem/1.2 var(--font-display); }
.tile span { color: var(--muted); font-size: .88rem; line-height: 1.35; }
.tile .count { position: absolute; top: 18px; right: 18px; background: var(--red); color: #fff; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .2rem .55rem; }
.tile.primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 18px 40px -16px rgba(0,69,240,.7); }
.tile.primary .ti { background: rgba(255,255,255,.18); color: #fff; }
.tile.primary span { color: rgba(255,255,255,.85); }
.tile.dark { background: #0B1020; color: #fff; border: 0; }
.tile.dark .ti { background: #1A2240; color: #8FB0FF; }
.tile.dark span { color: #A2A9BD; }
.ti.violet { background: var(--violet-50); color: #9A12CC; }
.ti.green { background: var(--green-50); color: var(--green); }
.ti.amber { background: var(--amber-50); color: var(--amber); }
.ti.red { background: var(--red-50); color: var(--red); }
.ti.ink { background: #EEF0F5; color: var(--ink-2); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px; }
.kpi .k { color: var(--muted); font-size: .86rem; font-weight: 600; display: flex; align-items: center; gap: .45rem; }
.kpi .v { font: 800 1.6rem/1.15 var(--font-display); letter-spacing: -.02em; margin-top: .5rem; }
.kpi .s { font-size: .82rem; color: var(--muted); margin-top: .2rem; }
.kpi.red .v { color: var(--red); }
.kpi.green .v { color: var(--green); }

.bars { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar i { display: block; width: 100%; max-width: 46px; border-radius: 10px 10px 4px 4px; background: var(--grad); min-height: 4px; }
.bar small { color: var(--muted); font-size: .75rem; }
.bar .val { font-size: .72rem; color: var(--ink-2); font-weight: 600; }

.onboarding { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; background: linear-gradient(120deg, #FFF8EA, #FFF); border: 1px solid #F7DFAE; border-radius: 22px; padding: 20px 24px; margin-bottom: 22px; }
.onboarding .ti { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--amber-50); color: var(--amber); }
.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: .6rem; }
.progress i { display: block; height: 100%; background: var(--grad); }

/* Tableaux */
.table-wrap { overflow-x: auto; margin: 0 -24px; }
.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th { text-align: left; font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFBFE; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table a.row-link { color: var(--ink); font-weight: 600; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .ei { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 16px; }
.filters .input { width: auto; min-width: 180px; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: .55rem .95rem; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .92rem; text-decoration: none; }
.tabs a.is-active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.pagination { display: flex; gap: .3rem; margin-top: 16px; justify-content: center; }
.pagination a { min-width: 36px; text-align: center; padding: .45rem .6rem; border-radius: 9px; color: var(--muted); font-weight: 600; text-decoration: none; }
.pagination a.is-active { background: var(--ink); color: #fff; }

/* Éditeur de document */
.lines { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.lines th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); padding: 0 6px; }
.lines td { padding: 0 4px; vertical-align: top; }
.lines .input { padding: .62rem .7rem; border-radius: 10px; }
.lines textarea.input { min-height: 40px; height: 40px; margin-top: 6px; font-size: .88rem; }
.lines .total { padding-top: .7rem; font-weight: 700; text-align: right; white-space: nowrap; }
.line-del { background: none; border: 0; color: var(--muted-2); cursor: pointer; padding: .55rem; border-radius: 10px; }
.line-del:hover { background: var(--red-50); color: var(--red); }
.sum-box { background: var(--bg); border-radius: 16px; padding: 18px; }
.sum-row { display: flex; justify-content: space-between; padding: .35rem 0; }
.sum-row.big { font: 800 1.35rem var(--font-display); color: var(--brand); border-top: 1px solid var(--line); margin-top: .5rem; padding-top: .8rem; }
.picker { position: relative; }
.picker-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 260px; overflow: auto; display: none; }
.picker-list.open { display: block; }
.picker-list button { display: flex; justify-content: space-between; gap: 1rem; width: 100%; text-align: left; background: none; border: 0; padding: .65rem .8rem; cursor: pointer; font: 500 .9rem var(--font); }
.picker-list button:hover { background: var(--bg); }

/* Fiche document */
.doc-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.action-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; padding: 18px 10px; border-radius: 16px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 600 .9rem var(--font); cursor: pointer; text-decoration: none !important; text-align: center; transition: border .15s, transform .15s; }
.action-btn:hover { border-color: var(--brand); transform: translateY(-2px); }
.action-btn .ico { width: 26px; height: 26px; color: var(--brand); }
.action-btn.main { background: var(--brand); color: #fff; border-color: var(--brand); }
.action-btn.main .ico { color: #fff; }
.action-btn.danger .ico { color: var(--red); }
.doc-preview { background: #fff; border-radius: 18px; border: 1px solid var(--line); padding: 34px; box-shadow: var(--shadow-sm); }
.doc-preview .head { display: flex; justify-content: space-between; gap: 2rem; margin-bottom: 26px; }
.doc-preview .title { font: 800 2rem var(--font-display); }
.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 22px; }
.parties > div { background: var(--bg); border-radius: 14px; padding: 16px; font-size: .9rem; color: var(--muted); }
.parties b { color: var(--ink); display: block; font-size: 1rem; }
.parties .lab { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); font-weight: 700; margin-bottom: 4px; }
.lockline { display: flex; gap: .6rem; align-items: center; font-size: .82rem; color: var(--muted); background: var(--bg); border-radius: 12px; padding: .7rem .9rem; margin-top: 18px; word-break: break-all; }
.timeline-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: .9rem; }
.timeline-mini li { display: flex; gap: .7rem; }
.timeline-mini .dot { width: 30px; height: 30px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; color: var(--brand); flex: none; }
.timeline-mini .ico { width: 16px; height: 16px; }

/* Modale */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(11,16,32,.55); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal-box { background: #fff; width: min(520px, 100%); border-radius: 22px; padding: 28px; box-shadow: var(--shadow-lg); max-height: 92vh; overflow: auto; }
.modal-box h2 { font-size: 1.35rem; }

/* Paramètres */
.settings-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 22px; }
.settings-nav a { display: flex; align-items: center; gap: .7rem; padding: 16px 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 600; text-decoration: none; }
.settings-nav a.is-active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); color: var(--brand); }
.compliance-item { display: flex; gap: .9rem; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.compliance-item:last-child { border-bottom: 0; }
.compliance-item .st { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.st.ok { background: var(--green-50); color: var(--green); }
.st.ko { background: var(--red-50); color: var(--red); }
.st.warn { background: var(--amber-50); color: var(--amber); }

/* Page publique facture */
.public-doc { min-height: 100vh; background: var(--bg); padding: 40px 16px; }
.public-card { width: min(760px, 100%); margin: 0 auto; }
.verify-ok { display: flex; gap: 1rem; align-items: center; padding: 18px 20px; border-radius: 18px; background: var(--green-50); color: #065F46; margin-bottom: 18px; }
.verify-ok .ico { width: 30px; height: 30px; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1100px) {
  .pricing { grid-template-columns: repeat(2, 1fr); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cols-main { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .hero .wrap, .split, .law-band, .doc-layout { grid-template-columns: 1fr; }
  .features, .steps { grid-template-columns: 1fr 1fr; }
  .nav, .header-cta { display: none; }
  .burger { display: block; }
  .site-header.open .nav { display: flex; flex-direction: column; position: absolute; top: 72px; left: 0; right: 0; background: #fff; padding: 12px 20px 20px; border-bottom: 1px solid var(--line); }
  .site-header.open .header-cta { display: flex; position: absolute; top: calc(72px + 260px); left: 20px; right: 20px; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; left: 0; width: 280px; transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .mobile-only { display: inline-flex; }
  .toc { display: none; }
  .mock-chip.c1 { left: 0; } .mock-chip.c2 { right: 0; }
}
@media (max-width: 640px) {
  .features, .steps, .pricing, .grid-2, .grid-3, .cols-2, .parties { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi .v { font-size: 1.25rem; }
  .content { padding: 18px 14px; }
  .topbar { padding: 0 14px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { min-height: 132px; padding: 16px; border-radius: 18px; }
  .tile span { display: none; }
  .section { padding: 64px 0; }
  .law-band { padding: 28px; }
  .doc-preview { padding: 18px; }
  .onboarding { grid-template-columns: 1fr; }
  .table-wrap { margin: 0 -16px; }
  .card { padding: 18px; border-radius: 18px; }
}
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .app-shell { display: block; }
  body.app { background: #fff; }
}
.tile .count { font-style: normal; }
@media (max-width: 640px) { .hide-sm { display: none; } }
/* Les colonnes de grille ne doivent jamais élargir la page */
.cols-main > *, .cols-2 > *, .grid-2 > *, .grid-3 > *, .doc-layout > *, .split > *, .hero .wrap > * { min-width: 0; }
.input, select.input { max-width: 100%; }
.app-shell { background: linear-gradient(to right, #0B1020 264px, transparent 264px); }
@media (max-width: 920px) { .app-shell { background: none; } }
@media (max-width: 640px) {
  .doc-preview .head { flex-direction: column; gap: 1rem; }
  .doc-preview .right { text-align: left; }
  .doc-preview .title { font-size: 1.5rem; }
  .card-head { flex-wrap: wrap; }
  .page-title .tools { margin-left: 0; }
  .callout { padding: 14px 16px; }
}
.mock-top > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.mock-chip.c1 { top: 56%; }
.features-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .features-2 { grid-template-columns: 1fr; } }
.toc { align-self: start; align-content: start; }
.mock-chip.c1 { top: -22px; left: -28px; }
@media (max-width: 920px) { .mock-chip.c1 { left: 0; top: -18px; } }
