/* =========================================================
   StatutFreelance — feuille de style (sans framework)
   ========================================================= */
:root {
  --ink: #0b1b3a;
  --ink-2: #44506a;
  --ink-3: #6b7588;
  --line: #e3e8f0;
  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --brand: #1d4ed8;
  --brand-dark: #1e3a8a;
  --brand-soft: #e8efff;
  --good: #0f7a4a;
  --good-soft: #e5f6ee;
  --warn: #8a5a00;
  --warn-soft: #fff4dc;
  /* Graphique : palette catégorielle validée (ordre fixe) */
  --s-net: #257de0;
  --s-cotis: #f47230;
  --s-is: #00b894;
  --s-impots: #f2a600;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 27, 58, .06), 0 6px 24px rgba(11, 27, 58, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -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; }
img, svg { max-width: 100%; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .5em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; }
.center { text-align: center; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid #93b4ff; outline-offset: 2px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 1.1rem; }
.brand b { color: var(--brand); }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav a:hover { color: var(--ink); }
.nav a.btn { color: #fff; }
@media (max-width: 720px) { .nav a:not(.btn) { display: none; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--brand); color: #fff; border: 0; border-radius: 10px; padding: 14px 20px; font: 600 1rem var(--font); text-decoration: none; cursor: pointer; text-align: center; transition: background .15s, transform .05s; }
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn-small { padding: 8px 14px; font-size: .9rem; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero { background: radial-gradient(1200px 400px at 80% -10%, #dfe8ff 0%, transparent 60%), linear-gradient(180deg, #f7f9ff 0%, #fff 100%); padding: 48px 0 28px; }
.hero h1 { font-size: clamp(1.7rem, 4.6vw, 2.9rem); max-width: 900px; }
.hl { color: var(--brand); }
.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 720px; }
.badge { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: .85rem; color: var(--ink-2); box-shadow: var(--shadow); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.trust { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--ink-2); font-size: .93rem; }
.trust li::before { content: "✓"; color: var(--good); font-weight: 700; margin-right: 6px; }
@media (max-width: 720px) { .hide-sm { display: none; } }

/* ---------- Cards ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card-title { font-size: 1.15rem; margin-bottom: 16px; }

/* ---------- Simulator layout ---------- */
.sim { display: grid; grid-template-columns: 360px 1fr; gap: 24px; align-items: start; padding-top: 8px; padding-bottom: 56px; }
.form-card { position: sticky; top: 78px; }
@media (max-width: 960px) {
  .sim { grid-template-columns: 1fr; }
  .form-card { position: static; }
}

/* ---------- Form fields ---------- */
.field { margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
fieldset.field { margin-bottom: 16px; }
label, .label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; color: var(--ink); }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="month"], select {
  width: 100%; font: 500 1rem var(--font); color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; min-height: 46px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
.input-eur { position: relative; }
.input-eur input { padding-right: 34px; }
.input-eur::after { content: "€"; position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
input[type="range"] { width: 100%; margin: 12px 0 0; accent-color: var(--brand); height: 28px; }
.hint { font-size: .84rem; color: var(--ink-3); margin: 6px 0 0; }
.hint-inline { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--bg-alt); color: var(--ink-3); font-size: .75rem; cursor: help; border: 1px solid var(--line); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .lead-form .row-2 { grid-template-columns: 1fr; } }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.segmented label { margin: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; text-align: center; white-space: nowrap; padding: 9px 4px; border-radius: 8px; font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.segmented input:checked + span { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(11,27,58,.12); }
.segmented input:focus-visible + span { outline: 3px solid #93b4ff; }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; }
.switch small { font-weight: 400; color: var(--ink-3); }
.switch input { position: absolute; opacity: 0; }
.slider { flex: none; width: 44px; height: 26px; background: #cfd6e3; border-radius: 999px; position: relative; transition: background .15s; }
.slider::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::after { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 3px solid #93b4ff; outline-offset: 2px; }

.repartition { margin-top: 12px; }
.rep-labels { display: flex; justify-content: space-between; font-size: .88rem; color: var(--ink-2); }
.advanced summary { cursor: pointer; font-weight: 600; color: var(--brand); font-size: .92rem; padding: 4px 0; }
.advanced[open] summary { margin-bottom: 12px; }

/* ---------- Results ---------- */
.results { display: grid; gap: 18px; min-width: 0; }
.verdict { background: linear-gradient(135deg, var(--brand) 0%, #1e40af 100%); color: #fff; border: 0; }
.verdict-kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; opacity: .85; margin-bottom: 6px; }
.verdict-text { font-size: clamp(1.25rem, 2.6vw, 1.6rem); font-weight: 700; line-height: 1.3; margin-bottom: 6px; }
.verdict-sub { opacity: .9; margin: 0; }

.status-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 720px) { .status-cards { grid-template-columns: 1fr; } }
.scard { position: relative; padding: 18px; }
.scard.best { border: 2px solid var(--brand); }
.scard .tag { position: absolute; top: -11px; left: 16px; background: var(--brand); color: #fff; font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.scard .tag.off { background: var(--ink-3); }
.scard h3 { font-size: 1rem; color: var(--ink-2); margin-bottom: 8px; }
.scard .net { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.scard .net small { font-size: .85rem; font-weight: 500; color: var(--ink-3); }
.scard .month { color: var(--ink-3); font-size: .9rem; margin: 4px 0 12px; }
.scard dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: .88rem; }
.scard dt { color: var(--ink-2); }
.scard dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.scard .gap { margin-top: 12px; font-size: .85rem; font-weight: 600; color: var(--ink-3); }
.scard .gap.win { color: var(--good); }
.scard .config { margin-top: 8px; font-size: .82rem; color: var(--ink-3); }
.scard.ineligible { opacity: .75; }

/* ---------- Chart ---------- */
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; margin-bottom: 8px; }
.chart-head h3 { margin: 0; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; font-size: .84rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--ink-2); }
.chart .lbl { fill: var(--ink); font-weight: 600; font-size: 14px; }
.chart .val { fill: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.chart .seg { cursor: pointer; }
.chart .seg:hover { opacity: .85; }
.tooltip { position: fixed; z-index: 80; pointer-events: none; background: var(--ink); color: #fff; font-size: .85rem; padding: 8px 10px; border-radius: 8px; box-shadow: var(--shadow); max-width: 240px; }
.tooltip b { display: block; }
.table-view { margin-top: 12px; }
.table-view summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .92rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
#detail-table td:not(:first-child), #detail-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
#detail-table tr.total td { font-weight: 700; }

/* ---------- Alerts & notes ---------- */
.alert { display: flex; gap: 10px; background: var(--warn-soft); color: #5c3d00; border: 1px solid #f3d999; border-radius: 10px; padding: 11px 14px; font-size: .9rem; margin-bottom: 8px; }
.alert::before { content: "⚠"; font-weight: 700; }
.disclaimer { font-size: .88rem; color: var(--ink-2); background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0; }

.cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; background: var(--good-soft); border: 1px solid #bfe6d2; border-radius: var(--radius); padding: 18px 20px; }
.cta-title { font-weight: 700; margin: 0 0 2px; }
.cta-text { margin: 0; color: var(--ink-2); font-size: .93rem; }
.cta-band .btn { background: var(--good); }
.cta-band .btn:hover { background: #0b5e39; }
@media (max-width: 720px) { .cta-band .btn { width: 100%; } }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-lead { color: var(--ink-2); font-size: 1.05rem; }
.free { display: inline-block; vertical-align: middle; font-size: .8rem; background: var(--good); color: #fff; padding: 3px 10px; border-radius: 999px; letter-spacing: .02em; }

.lead-form { margin-top: 20px; }
.hidden-field { position: absolute; left: -9999px; }
.consents { margin: 8px 0 18px; display: grid; gap: 12px; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-weight: 400; font-size: .9rem; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); }
.form-error { color: #b42318; font-size: .88rem; margin-top: 6px; }

.compare { min-width: 640px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.compare thead th { background: var(--ink); color: #fff; font-weight: 600; }
.compare tbody th { color: var(--ink); font-weight: 600; width: 18%; background: var(--bg-alt); }
.compare td { color: var(--ink-2); }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-right: 4px; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.mid { background: var(--warn-soft); color: var(--warn); }
.explain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
@media (max-width: 860px) { .explain-grid { grid-template-columns: 1fr; } }
.explain p { color: var(--ink-2); margin: 0; font-size: .95rem; }

.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 16px 44px 16px 18px; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--brand); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 18px 16px; margin: 0; color: var(--ink-2); }

.sources { padding-left: 18px; color: var(--ink-2); font-size: .92rem; }
.sources li { margin-bottom: 6px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #c9d2e3; padding: 28px 0; font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.site-footer p { margin: 0; }
.site-footer a { color: #fff; margin-left: 18px; }
.site-footer nav a:first-child { margin-left: 0; }

/* ---------- Pages légales ---------- */
.legal { padding: 48px 0 72px; }
.legal h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.legal h2 { font-size: 1.25rem; margin-top: 1.8em; }
.legal .todo { background: var(--warn-soft); padding: 1px 6px; border-radius: 4px; font-weight: 600; color: #5c3d00; }
.legal .updated { color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.segmented.seg-3 span { font-size: .8rem; padding: 9px 2px; }
