/* =========================================================
   Hôte Classé, design system v1
   Documentation visuelle : design-system.html
   Règle de formes : boutons en pilule, cartes 16px, champs 10px.
   Une seule couleur d'accent : cobalt.
   ========================================================= */

:root {
  /* Couleurs de marque */
  --cobalt-100: #e4eafb;
  --cobalt-500: #1f4fd1;
  --cobalt-600: #1a43b3;
  --encre: #14161a;
  --ardoise: #555c68;
  --brume: #f4f5f7;
  --craie: #fcfcfd;
  --trait: #dde0e6;

  /* Rôles (ce que les composants utilisent) */
  --bg: var(--brume);
  --surface: var(--craie);
  --surface-2: #eceef2;
  --ink: var(--encre);
  --muted: var(--ardoise);
  --line: var(--trait);
  --accent: var(--cobalt-500);
  --accent-hover: var(--cobalt-600);
  --accent-ink: #ffffff;
  --accent-soft: var(--cobalt-100);
  --danger: #b42318;
  --ok: #17663a;

  /* Typographie */
  --font: "Geist", system-ui, -apple-system, sans-serif;
  --fs-display: clamp(38px, 4.6vw, 58px);
  --fs-h2: clamp(30px, 3.6vw, 44px);
  --fs-h3: 20px;
  --fs-lead: 19px;
  --fs-body: 17px;
  --fs-small: 14px;

  /* Espacements (base 4) */
  --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 88px;

  /* Formes et profondeur */
  --r-field: 10px;
  --r-card: 16px;
  --r-pill: 999px;
  --shadow: 0 1px 2px rgb(20 30 60 / .06), 0 12px 32px -12px rgb(20 30 60 / .14);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1014;
    --surface: #161a20;
    --surface-2: #1d222a;
    --ink: #e9ecf1;
    --muted: #a3abb8;
    --line: #2a303a;
    --accent: #7d9bff;
    --accent-hover: #97afff;
    --accent-ink: #0b1020;
    --accent-soft: #1b2442;
    --danger: #ff8a7a;
    --ok: #6fd69b;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 32px -12px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { background: var(--bg); color: var(--ink); font: 400 var(--fs-body)/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: var(--s-4); }
@media (min-width: 768px) { .wrap { padding-inline: var(--s-6); } }

h1, h2, h3 { font-weight: 600; letter-spacing: -0.025em; line-height: 1.08; text-wrap: balance; }
h1 { font-size: var(--fs-display); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.01em; line-height: 1.25; }
.lead { font-size: var(--fs-lead); color: var(--muted); max-width: 46ch; }
.muted { color: var(--muted); }
.eyebrow { display: inline-block; font-size: var(--fs-small); font-weight: 500; color: var(--accent); margin-bottom: 18px; }
.sr-only, .hp { 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; gap: var(--s-2); white-space: nowrap;
  border: 0; border-radius: var(--r-pill); padding: 14px 24px; cursor: pointer;
  font: 600 16px var(--font); text-decoration: none;
  background: var(--accent); color: var(--accent-ink);
  transition: transform .2s var(--ease), background .2s;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--muted); }
.btn.inverse { background: var(--bg); color: var(--ink); }
.btn[disabled] { opacity: .6; cursor: progress; }
.link { color: var(--accent); font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Logo ---------- */
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-weight: 600; font-size: 18px; text-decoration: none; letter-spacing: -0.015em; }
.brand-mark { width: 32px; height: 32px; flex: none; }

/* ---------- Navigation ---------- */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 86%, transparent);
       backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: var(--s-5); }
.nav-links { display: none; gap: 28px; list-style: none; padding: 0; font-size: 15px; }
.nav-links a { text-decoration: none; color: var(--muted); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-end { display: flex; align-items: center; gap: var(--s-5); }
.nav-pro { display: none; font-size: 14px; color: var(--muted); text-decoration: none; }
.nav-pro:hover { color: var(--ink); }
.nav .btn { padding: 10px 18px; font-size: 15px; }
@media (min-width: 1000px) { .nav-links, .nav-pro { display: flex; } }
@media (max-width: 520px) { .nav .btn { display: none; } }

/* ---------- Hero ---------- */
.hero { display: grid; gap: 40px; padding-block: 40px 72px; align-items: center; }
.hero-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-6); }
.hero-media img { width: 100%; aspect-ratio: 1; max-height: 72dvh; object-fit: cover; border-radius: var(--r-card); background: var(--surface-2); }
@media (min-width: 900px) { .hero { grid-template-columns: 1.05fr .95fr; gap: var(--s-8); padding-block: 48px 72px; } }

/* Chiffres clés sous le hero */
.proof { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-5) var(--s-4); padding-block: var(--s-6) var(--s-7); border-top: 1px solid var(--line); }
@media (min-width: 768px) { .proof { grid-template-columns: repeat(4, 1fr); } }
.proof b { display: block; font-size: clamp(28px, 3vw, 38px); font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.proof span { color: var(--muted); font-size: 15px; }
.proof-src { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }

section { padding-block: var(--s-9); }
@media (max-width: 767px) { section { padding-block: var(--s-8); } }
.section-head { max-width: 680px; margin-bottom: var(--s-7); }
.section-head p { margin-top: var(--s-4); color: var(--muted); font-size: 18px; }

/* ---------- Formulaires ---------- */
.field { display: grid; gap: var(--s-2); margin-bottom: 18px; }
.field label, .field legend { font-weight: 500; font-size: 15px; }
.field small { color: var(--muted); font-size: var(--fs-small); }
input, select, textarea {
  width: 100%; font: 16px var(--font); color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-field); padding: 13px 14px;
}
input:hover, select:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible { outline: 3px solid var(--accent-soft); border-color: var(--accent); outline-offset: 0; }
input[aria-invalid="true"] { border-color: var(--danger); }
.err { color: var(--danger); font-size: var(--fs-small); min-height: 20px; }
.form-row { display: grid; gap: 0 var(--s-4); }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.check { display: grid; grid-template-columns: 20px 1fr; gap: var(--s-3); font-size: var(--fs-small); color: var(--muted); margin: 6px 0 18px; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0 0 22px; }

/* Puces de choix */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: 10px; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chips span { display: block; padding: 9px 16px; border-radius: var(--r-pill); border: 1px solid var(--line); font-size: 15px; transition: background .2s, border-color .2s, color .2s; }
.chips label:hover span { border-color: var(--muted); }
.chips input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; }
.chips input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 28px; box-shadow: var(--shadow); }
@media (min-width: 768px) { .card { padding: 36px; } }
.badge { font-size: 13px; font-weight: 500; padding: 5px 12px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); }

/* ---------- Simulateur ---------- */
.band { background: var(--surface); border-block: 1px solid var(--line); }
.sim-grid { display: grid; gap: var(--s-6); }
@media (min-width: 900px) { .sim-grid { grid-template-columns: 1fr 1fr; gap: var(--s-8); align-items: center; } }
.result { border-radius: var(--r-card); background: var(--accent-soft); padding: var(--s-6); }
.result .big { font-size: clamp(48px, 7vw, 80px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.result p { margin-top: var(--s-3); color: var(--muted); }
.result.alert .big { font-size: 30px; letter-spacing: -0.02em; line-height: 1.15; }
.result .link { margin-top: var(--s-4); }

/* ---------- Comparatif ---------- */
.compare { display: grid; gap: var(--s-4); }
@media (min-width: 768px) { .compare { grid-template-columns: 1fr 1fr; } }
.compare > div { padding: var(--s-6); border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); }
.compare .is-good { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.compare .is-good .muted { color: color-mix(in srgb, var(--bg) 70%, var(--ink)); }
.compare h3 { margin-bottom: var(--s-5); display: flex; align-items: center; gap: 10px; }
.stat { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); padding: 14px 0; }
.stat + .stat { border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
.stat b { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

/* ---------- Étapes ---------- */
.steps { display: grid; gap: var(--s-7); align-items: start; }
@media (min-width: 900px) { .steps { grid-template-columns: .9fr 1.1fr; gap: 72px; } }
.steps img { border-radius: var(--r-card); aspect-ratio: 4 / 5; object-fit: cover; width: 100%; background: var(--surface-2); }
@media (min-width: 900px) { .steps img { position: sticky; top: 96px; } }
.step-list { list-style: none; padding: 0; }
.step-list li { display: grid; grid-template-columns: 48px 1fr; gap: 20px; padding: 28px 0; }
.step-list li + li { border-top: 1px solid var(--line); }
.step-list i { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 24px; }
.step-list p { color: var(--muted); margin-top: 6px; }

/* ---------- Diagnostic ---------- */
.diag { display: grid; gap: var(--s-6); }
@media (min-width: 900px) { .diag { grid-template-columns: 1fr 1.1fr; gap: var(--s-8); align-items: start; } }
.stars { display: flex; gap: 6px; font-size: 34px; color: var(--accent); margin: 18px 0 8px; min-height: 40px; }
.stars .off { color: var(--line); }

/* ---------- Demande ---------- */
.request-grid { display: grid; gap: 40px; }
@media (min-width: 900px) { .request-grid { grid-template-columns: .85fr 1.15fr; gap: 72px; } }
.promise { list-style: none; padding: 0; margin-top: 28px; display: grid; gap: 14px; }
.promise li { display: flex; gap: var(--s-3); align-items: flex-start; }
.promise i { color: var(--accent); font-size: 22px; margin-top: 1px; }
.success i { font-size: 36px; color: var(--ok); }
.success h3 { margin: var(--s-3) 0 var(--s-2); }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; }
details { border-bottom: 1px solid var(--line); }
summary { list-style: none; cursor: pointer; padding: 22px 40px 22px 0; font-weight: 500; font-size: 18px; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 18px; font-size: 26px; font-weight: 300; color: var(--muted); transition: transform .25s var(--ease); }
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 0 22px; color: var(--muted); max-width: 68ch; }

/* ---------- Bandeau sombre ---------- */
.pro-band { display: grid; gap: var(--s-5); align-items: center; padding: 40px; border-radius: var(--r-card); background: var(--ink); color: var(--bg); }
.pro-band p { color: color-mix(in srgb, var(--bg) 72%, var(--ink)); margin-top: 10px; max-width: 52ch; }
.pro-band .btn { justify-self: start; }
@media (min-width: 900px) { .pro-band { grid-template-columns: 1fr auto; padding: 56px; } }

/* ---------- Espace organismes ---------- */
.bento { display: grid; gap: var(--s-4); }
@media (min-width: 900px) {
  .bento { grid-template-columns: repeat(6, 1fr); }
  .bento > :nth-child(1) { grid-column: span 4; }
  .bento > :nth-child(n+2) { grid-column: span 2; }
}
.tile { border-radius: var(--r-card); padding: 28px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 10px; min-height: 220px; }
.tile i { font-size: 28px; color: var(--accent); }
.tile p { color: var(--muted); }
.tile.dark { background: var(--encre); color: var(--craie); border-color: var(--encre); }
.tile.dark p { color: #b9bfca; }
.tile.dark i { color: #9db2ff; }
.tile.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tile.accent p, .tile.accent i { color: inherit; opacity: .88; }
.tile.photo { padding: 0; overflow: hidden; position: relative; justify-content: flex-end; }
.tile.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile.photo .tile-body { position: relative; padding: 90px 28px 28px; background: linear-gradient(to top, rgb(10 12 16 / .88), rgb(10 12 16 / 0)); color: #f2f4f7; }
.tile.photo .tile-body p { color: #d5d9e0; }
.tile.photo .tile-body i { color: #f2f4f7; }
.tile .big-num { font-size: 56px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.lead-demo { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .lead-demo { grid-template-columns: 1fr 1fr; gap: 72px; } }
.lead-card dl { display: grid; grid-template-columns: auto 1fr; gap: var(--s-3) var(--s-5); margin-top: 20px; font-size: 15px; }
.lead-card dt { color: var(--muted); }
.lead-card dd { margin: 0; font-weight: 500; }
.lead-card header { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); }
.terms { display: grid; border-top: 1px solid var(--line); }
.terms > div { display: grid; gap: 6px; padding: var(--s-5) 0; border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .terms > div { grid-template-columns: 280px 1fr; gap: var(--s-6); } }
.terms dt { font-weight: 600; }
.terms dd { margin: 0; color: var(--muted); }

/* ---------- Article (guide) ---------- */
.article { max-width: 720px; padding-block: var(--s-7) var(--s-9); }
.article h1 { margin-bottom: var(--s-5); }
.article h2 { font-size: 28px; margin: var(--s-7) 0 var(--s-3); }
.article p, .article li { color: var(--muted); font-size: 18px; line-height: 1.7; }
.article p + p { margin-top: var(--s-4); }
.article ul { padding-left: 22px; display: grid; gap: var(--s-2); margin-top: var(--s-3); }
.article strong { color: var(--ink); font-weight: 600; }
.callout { margin: var(--s-6) 0; padding: var(--s-5); border-radius: var(--r-card); background: var(--accent-soft); }
.callout p { color: var(--ink) !important; }
.toc { list-style: none; padding: 0 !important; display: grid; gap: var(--s-2); margin: var(--s-5) 0 0; }
.toc a { color: var(--accent); text-decoration: none; font-weight: 500; }
.toc a:hover { text-decoration: underline; }
.article table { width: 100%; border-collapse: collapse; margin-top: var(--s-4); font-size: 16px; }
.article th, .article td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
.article th { font-weight: 600; }
.article td { color: var(--muted); font-variant-numeric: tabular-nums; }
.article .sources, .article .sources li { font-size: 14px; }

/* ---------- Pied de page ---------- */
footer { padding: var(--s-7) 0 56px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-small); }
.foot { display: grid; gap: var(--s-6); }
@media (min-width: 768px) { .foot { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot h4 { color: var(--ink); font-size: 14px; font-weight: 600; margin-bottom: var(--s-3); }
.foot ul { list-style: none; padding: 0; display: grid; gap: var(--s-2); }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot .brand { color: var(--ink); margin-bottom: var(--s-3); }
.foot p { max-width: 40ch; }

/* ---------- Pages légales ---------- */
.legal { max-width: 760px; padding-block: 56px 88px; }
.legal h1 { font-size: 40px; margin-bottom: var(--s-6); }
.legal h2 { font-size: 22px; margin: 36px 0 10px; }
.legal p, .legal li { color: var(--muted); }
.legal ul { padding-left: 20px; }

/* ---------- Page design system ---------- */
.ds-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-4); }
.ds-swatch { border-radius: var(--r-card); border: 1px solid var(--line); overflow: hidden; background: var(--surface); font-size: 14px; }
.ds-swatch div { height: 88px; }
.ds-swatch p { padding: 10px 14px; }
.ds-swatch code { color: var(--muted); font-size: 13px; }
.ds-row { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; }
.ds-type > * + * { margin-top: var(--s-4); }
.ds-logo { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.ds-logo > div { border-radius: var(--r-card); border: 1px solid var(--line); padding: var(--s-7); display: grid; place-items: center; background: var(--craie); color: var(--encre); }
.ds-logo > .on-dark { background: var(--encre); color: var(--craie); border-color: var(--encre); }

/* ---------- Mouvement : guide l'oeil section par section ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  .reveal.in { opacity: 1; transform: none; }
  .hero > * { animation: rise .8s var(--ease) both; }
  .hero > :nth-child(2) { animation-delay: .12s; }
  @keyframes rise { from { opacity: 0; transform: translateY(16px); } }
}

/* ---------- Espaces connectés (admin, organisme) ---------- */
.app { padding-block: 40px 88px; min-height: 70dvh; }
.auth-card { max-width: 440px; margin: 40px auto; }
.auth-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.linkbtn { background: none; border: 0; padding: 0; font: 500 15px var(--font); color: var(--accent); cursor: pointer; }
.linkbtn:hover { text-decoration: underline; text-underline-offset: 3px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.dash-head h1 { font-size: clamp(28px, 3vw, 36px); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 28px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px 20px; }
.kpi span { display: block; color: var(--muted); font-size: 14px; }
.kpi b { display: block; font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 12px 16px; font: 500 15px var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.toolbar { display: flex; gap: 12px; margin-bottom: 16px; }
.toolbar select { max-width: 240px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data select, table.data input { padding: 8px 10px; font-size: 14px; min-width: 130px; }
table.data a { color: var(--accent); text-decoration: none; }
.split { display: grid; gap: 24px; align-items: start; }
@media (min-width: 1000px) { .split { grid-template-columns: 1.6fr 1fr; } }
.lead-list { display: grid; gap: 16px; }
.lead-card a { color: var(--accent); text-decoration: none; }
.empty { border: 1px dashed var(--line); border-radius: var(--r-card); padding: 40px 24px; text-align: center; }
.empty p { margin-top: 6px; }
.pill { display: inline-block; font-size: 13px; font-weight: 500; padding: 4px 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.s-transmise { background: var(--accent-soft); color: var(--accent); }
.pill.s-visite_realisee { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.pill.s-en_attente, .pill.s-nouvelle { background: color-mix(in srgb, #b26b00 14%, transparent); color: #9a5c00; }
@media (prefers-color-scheme: dark) { .pill.s-en_attente, .pill.s-nouvelle { color: #ffbe5c; } }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 20; background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: var(--r-pill); font-size: 15px; box-shadow: var(--shadow); }
.toast.error { background: var(--danger); color: #fff; }

/* ---------- Espace partenaire : mise en page application ---------- */
.portal { display: grid; gap: 24px; align-items: start; }
@media (min-width: 900px) { .portal { grid-template-columns: 232px 1fr; gap: 40px; } }
.side { display: grid; gap: 20px; }
@media (min-width: 900px) { .side { position: sticky; top: 92px; } }
.side-org { display: flex; gap: 12px; align-items: center; }
.side-org strong { display: block; font-size: 15px; line-height: 1.3; }
.side-org span:not(.avatar) { display: block; font-size: 13px; color: var(--muted); }
.side-nav { display: flex; gap: 4px; }
@media (min-width: 900px) { .side-nav { flex-direction: column; } }
.side-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: var(--r-field);
  background: none; color: var(--muted); font: 500 15px var(--font); cursor: pointer; text-align: left; transition: background .15s, color .15s; }
.side-link i { font-size: 19px; }
.side-link:hover { background: var(--surface-2); color: var(--ink); }
.side-link[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.side-link .count { margin-left: auto; font-size: 12px; font-weight: 600; min-width: 22px; text-align: center; padding: 1px 7px; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); }
.side-foot { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; }
.state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.state.off::before { background: #c27a00; }
.side-foot .linkbtn { justify-self: start; font-size: 14px; color: var(--muted); }

.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.avatar.lg { width: 42px; height: 42px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-size: 15px; }

.main-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.main-head h1 { font-size: 28px; }
.main-head p { font-size: 14px; margin-top: 2px; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); margin-bottom: 24px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stats > div { padding: 14px 18px; }
.stats > div + div { border-left: 1px solid var(--line); }
@media (max-width: 759px) { .stats > div:nth-child(3) { border-left: 0; } .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); } }
.stats span { display: block; font-size: 13px; color: var(--muted); }
.stats b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stats small { font-size: 14px; font-weight: 500; color: var(--muted); }
.meter { height: 3px; border-radius: 3px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-2); margin-bottom: 16px; max-width: 100%; overflow-x: auto; }
.segmented button { border: 0; background: none; padding: 7px 14px; border-radius: var(--r-pill); font: 500 14px var(--font); color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.segmented button span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(20 30 60 / .08); }

.rows { list-style: none; padding: 0; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); overflow: hidden; }
.row + .row { border-top: 1px solid var(--line); }
.row-head { width: 100%; display: grid; grid-template-columns: 36px 1fr auto auto 20px; gap: 14px; align-items: center; padding: 12px 16px;
  border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; transition: background .15s; }
.row-head:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.row-main strong { display: block; font-weight: 500; font-size: 15px; }
.row-main span { display: block; font-size: 13px; color: var(--muted); }
.row-date { font-size: 13px; color: var(--muted); white-space: nowrap; }
.chev { color: var(--muted); transition: transform .25s var(--ease); }
.row.open .chev { transform: rotate(180deg); }
.row.open .row-head { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
@media (max-width: 640px) { .row-head { grid-template-columns: 36px 1fr auto 20px; } .row-date { display: none; } }
.row-detail { padding: 4px 16px 20px 66px; display: grid; gap: 18px; }
@media (max-width: 640px) { .row-detail { padding-left: 16px; } }
@media (prefers-reduced-motion: no-preference) { .row-detail { animation: rise .35s var(--ease) both; } }
.contact { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.sm { padding: 8px 14px; font-size: 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; margin: 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-size: 14px; font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end; padding: 16px; border-radius: 12px; background: var(--bg); }
.action label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input { width: auto; padding: 8px 10px; font-size: 14px; }
.inline input[type="number"] { width: 110px; }
.linkbtn.danger { color: var(--danger); }
.row-detail textarea { font: 14px var(--font); padding: 10px 12px; resize: vertical; }
.empty i { font-size: 30px; color: var(--muted); }

.pill.s-rdv_planifie { background: color-mix(in srgb, #6b4fd1 14%, transparent); color: #5a3fc0; }
@media (prefers-color-scheme: dark) { .pill.s-rdv_planifie { color: #b9a8ff; } }

/* Paramètres */
.settings { display: grid; gap: 28px; }
.settings .main-head { margin-bottom: 0; }
.set-group { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); padding: 0; margin: 0; }
.set-group legend { float: left; width: 100%; padding: 16px 20px 0; font-weight: 600; font-size: 15px; }
.set-row { clear: both; display: grid; gap: 10px; padding: 16px 20px; }
.set-row + .set-row { border-top: 1px solid var(--line); }
@media (min-width: 760px) { .set-row { grid-template-columns: 1fr minmax(220px, 300px); gap: 24px; align-items: center; } }
.set-row label, .set-row strong { font-weight: 500; font-size: 15px; }
.set-row p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.set-control input:not([type="checkbox"]), .set-control select, .set-control textarea { padding: 9px 12px; font-size: 15px; }
.set-control .inline input { flex: 1; min-width: 0; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 13px; font-weight: 500; padding: 3px 10px; border-radius: 8px; background: var(--surface-2); }
.save-bar { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; }
.save-bar .btn { box-shadow: var(--shadow); }

.switch { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: var(--r-pill); background: var(--line); position: relative; cursor: pointer; transition: background .2s; margin: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .2s var(--ease); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
@media (max-width: 899px) { .side { gap: 14px; padding-bottom: 8px; } .side-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; } .side-link { width: auto; } }
.portal > .main { padding-block: 0; min-width: 0; }

/* Réinitialisation du mot de passe */
.notice { margin-top: 12px; padding: 10px 14px; border-radius: var(--r-field); background: color-mix(in srgb, #c27a00 12%, transparent); color: var(--ink); font-size: 14px; }
.icon-ok { font-size: 40px; color: var(--ok); }

/* ---------- Parcours partenaire avant validation ---------- */
.onboard { max-width: 760px; margin: 0 auto; display: grid; gap: 24px; }
.apply h2, .waiting h2 { font-size: 20px; letter-spacing: -0.01em; margin-bottom: 14px; }
.stepper { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stepper li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); padding-top: 10px; border-top: 3px solid var(--line); }
.stepper li span { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.stepper li.done { border-top-color: var(--accent); color: var(--ink); }
.stepper li.done span { background: var(--accent); color: var(--accent-ink); }
.stepper li.now { border-top-color: var(--accent); color: var(--ink); font-weight: 500; }
.stepper li.now span { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.stepper li.stop { border-top-color: var(--danger); color: var(--danger); }
@media (max-width: 560px) { .stepper li { flex-direction: column; align-items: flex-start; gap: 6px; font-size: 13px; } }
.waiting { display: grid; gap: 14px; justify-items: start; }
.waiting h2 { margin: 4px 0 0; }
.waiting .facts { width: 100%; margin: 8px 0; }
.legal-info { font-size: 14px; color: var(--muted); }

/* ---------- Contrat ---------- */
.contract { max-width: 780px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 40px clamp(20px, 5vw, 56px) 56px; }
.contract-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 32px; }
.contract-head { padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.contract-head .eyebrow { margin-bottom: 8px; }
.contract-head h1 { font-size: clamp(30px, 4vw, 40px); }
.contract-head .muted { margin-top: 8px; font-size: 15px; }
.contract .art { padding-block: 18px 0; }
.contract h2 { font-size: 17px; letter-spacing: -0.01em; margin-bottom: 8px; }
.contract p, .contract li { font-size: 15px; line-height: 1.65; color: var(--ink); }
.contract p + p { margin-top: 8px; }
.contract ol, .contract ul { padding-left: 22px; display: grid; gap: 6px; margin-block: 6px; }
.sign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 20px; }
.sign-grid > div { display: grid; gap: 4px; align-content: start; min-height: 150px; padding: 16px; border: 1px dashed var(--line); border-radius: 12px; font-size: 14px; }
@media (max-width: 560px) { .sign-grid { grid-template-columns: 1fr; } }

@media print {
  @page { margin: 18mm 16mm; }
  :root { --surface: #fff; --bg: #fff; --ink: #000; --muted: #444; --line: #bbb; }
  body { background: #fff; }
  .nav, .no-print, .toast { display: none !important; }
  .app { padding: 0; }
  .contract { border: 0; padding: 0; max-width: none; }
  .contract .art { break-inside: avoid; }
  .contract p, .contract li { font-size: 11pt; }
}

/* Refus de candidature */
.refus-row td { background: var(--bg); }
.refus-box { display: grid; gap: 10px; max-width: 640px; }
.refus-box label { font-weight: 500; font-size: 14px; }
.refus-box textarea { font: 14px var(--font); padding: 10px 12px; }
table.data .motif { font-size: 13px; margin-top: 6px; max-width: 260px; }
.motif-box { width: 100%; padding: 14px 16px; border-radius: 12px; background: var(--bg); }
.motif-box p { margin-top: 4px; white-space: pre-line; }

/* Autocomplétion d'adresse */
.ac-wrap { position: relative; }
.ac-list { position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; }
.ac-list li { padding: 9px 12px; border-radius: 8px; font-size: 15px; cursor: pointer; }
.ac-list li:hover, .ac-list li[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.field small + input[type="hidden"] { display: none; }

/* Zone d'intervention et adresse */
.facts .wide { grid-column: 1 / -1; }
.zone-rayon { display: grid; gap: 8px; }
.set-control .segmented { margin: 0; }
.set-row[hidden] { display: none; }
