/* Espace client Hezign - DA v2 : noir profond, une seule dominante rose, Onest. */
@font-face { font-family: Onest; font-weight: 400; font-display: swap; src: url(/fonts/onest-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Onest; font-weight: 500; font-display: swap; src: url(/fonts/onest-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Onest; font-weight: 600; font-display: swap; src: url(/fonts/onest-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Onest; font-weight: 700; font-display: swap; src: url(/fonts/onest-latin-700-normal.woff2) format('woff2'); }

:root,
[data-theme='dark'] {
  color-scheme: dark;
  --canvas: #0a090c;
  --surface: #121116;
  --surface-2: #19181e;
  --ink: #f4f1f3;
  --muted: #aaa4a7;
  --faint: #857f82;
  --line: rgb(244 241 243 / 0.09);
  --line-strong: rgb(244 241 243 / 0.16);
  --brand: #d30f57;
  --brand-hover: #e35d79;
  --brand-soft: rgb(211 15 87 / 0.14);
  --chart: #ea4c83;
  --up: #4fd18b;
  --up-soft: rgb(79 209 139 / 0.12);
  --down: #ff7b7b;
  --down-soft: rgb(255 123 123 / 0.12);
  --halo: rgb(211 15 87 / 0.2);
  --dots: rgb(244 241 243 / 0.05);
  --shadow: 0 24px 60px -30px rgb(0 0 0 / 0.8);
}

[data-theme='light'] {
  color-scheme: light;
  --canvas: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #f4f4f7;
  --ink: #111013;
  --muted: #444448;
  --faint: #5c5c64;
  --line: rgb(17 17 17 / 0.09);
  --line-strong: rgb(17 17 17 / 0.18);
  --brand: #d30f57;
  --brand-hover: #b00c48;
  --brand-soft: rgb(211 15 87 / 0.08);
  --chart: #d30f57;
  --up: #12754a;
  --up-soft: rgb(18 117 74 / 0.1);
  --down: #b3261e;
  --down-soft: rgb(179 38 30 / 0.08);
  --halo: rgb(211 15 87 / 0.09);
  --dots: rgb(17 17 17 / 0.05);
  --shadow: 0 24px 50px -32px rgb(17 16 19 / 0.25);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font: 400 16px/1.55 Onest, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 0;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand-hover); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* Décor : halo rosé + trame de points, fixes derrière le contenu */
.decor { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.decor::before {
  content: '';
  position: absolute; left: 50%; top: -340px; width: 1100px; height: 680px; transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--halo), transparent);
}
.decor::after {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(var(--dots) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, #000, transparent 520px);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 520px);
}

.wrap { position: relative; z-index: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* En-tête */
.top { position: sticky; top: 0; z-index: 20; padding: 14px 0; }
.top__bar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px 10px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand .l-clair, [data-theme='light'] .brand .l-sombre { display: none; }
[data-theme='light'] .brand .l-clair { display: block; }
.brand small { font-size: 13px; font-weight: 500; color: var(--faint); padding-left: 10px; border-left: 1px solid var(--line-strong); }
.top__right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn, .ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; border-radius: 999px; border: 1px solid transparent; background: none;
  color: var(--muted); font-size: 14px; font-weight: 500;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.icon-btn { width: 36px; }
.ghost { padding: 0 14px; text-decoration: none; }
.icon-btn:hover, .ghost:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg, .ghost svg { width: 18px; height: 18px; }
.i-soleil, [data-theme='light'] .i-lune { display: none; }
[data-theme='light'] .i-soleil { display: block; }

/* Intro */
.intro { padding: 44px 0 34px; display: grid; grid-template-columns: 1fr auto; gap: 24px 32px; align-items: end; }
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.site { font-weight: 600; color: var(--ink); }
.live {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 500;
}
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.live.on i { background: var(--up); box-shadow: 0 0 0 0 var(--up); animation: pouls 2s infinite; }
@keyframes pouls { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 600; }
h1 em { font-style: normal; color: var(--brand-hover); }
[data-theme='light'] h1 em { color: var(--brand); }
.lead { margin-top: 14px; max-width: 56ch; font-size: 18px; color: var(--muted); }
.intro__side { display: grid; gap: 10px; justify-items: end; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.seg button {
  border: 0; background: none; height: 34px; padding: 0 16px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--muted); transition: background 0.2s, color 0.2s;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--canvas); }
.maj { font-size: 13px; color: var(--faint); }

/* Cartes */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: var(--shadow);
}
.card__head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 24px 26px 0; }
.card__head h2 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.card__head p { flex-basis: 100%; font-size: 14px; color: var(--faint); margin-top: -6px; }
.card__head .seg { margin-left: auto; background: var(--surface-2); }
.card__body { padding: 20px 26px 26px; }
.vide { padding: 26px; border-radius: 14px; background: var(--surface-2); color: var(--muted); font-size: 15px; }

/* Chiffres clés */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.kpi { padding: 22px 24px 24px; overflow: hidden; transition: transform 0.3s, border-color 0.3s; }
.kpi:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.kpi__label { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--muted); }
.kpi__label span {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand-hover);
}
[data-theme='light'] .kpi__label span { color: var(--brand); }
.kpi__label svg { width: 17px; height: 17px; }
.kpi__val { margin-top: 18px; font-size: 44px; line-height: 1; font-weight: 600; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.kpi__val small { font-size: 18px; font-weight: 500; letter-spacing: 0; color: var(--faint); margin-left: 4px; }
.kpi__aide { margin-top: 10px; font-size: 14px; color: var(--faint); min-height: 2.9em; }
.evol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 14px; }
.evol .ctx { font-size: 13px; color: var(--faint); }
.delta {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--surface-2); color: var(--muted);
}
.delta svg { width: 14px; height: 14px; }
.delta.up { background: var(--up-soft); color: var(--up); }
.delta.down { background: var(--down-soft); color: var(--down); }

/* Graphique */
.grid { display: grid; gap: 16px; margin-top: 16px; }
.grid--2 { grid-template-columns: 1.15fr 1fr; }
.chart { position: relative; height: 280px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grille { stroke: var(--line); stroke-width: 1; }
.chart .axe { fill: var(--faint); font-size: 12px; font-family: inherit; }
.chart .ligne { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .aire { fill: url(#fondu); }
.chart .stop-a { stop-color: var(--chart); stop-opacity: 0.22; }
.chart .stop-b { stop-color: var(--chart); stop-opacity: 0; }
.chart .repere { stroke: var(--line-strong); stroke-width: 1; }
.chart .point { fill: var(--chart); stroke: var(--surface); stroke-width: 2; }
.bulle {
  position: absolute; top: 0; left: 0; z-index: 3; pointer-events: none;
  padding: 9px 12px; border-radius: 12px; white-space: nowrap;
  background: var(--ink); color: var(--canvas); font-size: 13px; line-height: 1.35;
  box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.5);
}
.bulle b { display: block; font-size: 16px; font-weight: 600; }

/* Listes : recherches et provenance */
.rows li { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; padding-top: 4px; }
.rows .nom { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .val { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.rows .val small { font-weight: 400; color: var(--faint); margin-left: 4px; }
.rows .sous { grid-column: 1 / -1; font-size: 13px; color: var(--faint); }
.rows .barre { grid-column: 1 / -1; height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.rows .barre i { display: block; height: 100%; border-radius: 4px; background: var(--chart); transform-origin: left; animation: pousse 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes pousse { from { transform: scaleX(0); } }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 500; color: var(--muted); }
.tag.top { background: var(--up-soft); color: var(--up); }
.tag.bas { background: var(--down-soft); color: var(--down); }
.facture { margin-left: 10px; color: var(--ink); font-weight: 500; text-underline-offset: 3px; }
.facture:hover { color: var(--brand-hover); }
.kalend { display: grid; gap: 8px; }
.kalend__choix { display: flex; flex-wrap: wrap; gap: 8px; }
.kalend__etat { font-size: 14px; color: var(--muted); }
.histo h3 { font-size: 14px; font-weight: 500; color: var(--faint); margin-bottom: 6px; }
.histo .rows li { padding: 11px 0; }

/* Journal des actions */
.fil { position: relative; padding-left: 26px; }
.fil::before { content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line-strong); }
.fil li { position: relative; padding: 0 0 22px; }
.fil li:last-child { padding-bottom: 0; }
.fil li::before {
  content: ''; position: absolute; left: -26px; top: 7px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 4px var(--surface);
}
.fil time { font-size: 13px; color: var(--faint); }
.fil h3 { font-size: 16px; font-weight: 600; margin-top: 2px; }
.fil p { font-size: 15px; color: var(--muted); margin-top: 2px; }
.fil .tag { margin-left: 8px; vertical-align: 2px; }

/* Abonnement */
.abo { display: grid; grid-template-columns: 1fr 1.25fr; }
.abo__prix { padding: 30px; border-right: 1px solid var(--line); display: grid; align-content: start; gap: 6px; }
.etat { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--up-soft); color: var(--up); }
.etat svg { width: 14px; height: 14px; }
.etat.pause { background: var(--down-soft); color: var(--down); }
.etat.neutre { background: var(--surface-2); color: var(--muted); }
.abo__formule { margin-top: 18px; font-size: 14px; font-weight: 500; color: var(--muted); }
.abo__montant { font-size: 52px; line-height: 1; font-weight: 600; letter-spacing: -0.04em; }
.abo__montant small { font-size: 17px; font-weight: 500; letter-spacing: 0; color: var(--faint); margin-left: 6px; }
.abo__tva { font-size: 13px; color: var(--faint); margin-top: 6px; }
.abo__detail { padding: 30px; display: grid; gap: 22px; align-content: start; }
.faits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.faits dt { font-size: 13px; color: var(--faint); }
.faits dd { font-size: 16px; font-weight: 500; margin-top: 2px; }
.note { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); font-size: 14px; color: var(--muted); }
.note strong { color: var(--ink); font-weight: 600; }
.note.alerte { background: var(--down-soft); color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.2s, color 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn--plein { background: var(--brand); color: #fff; }
.btn--plein:hover { background: var(--brand-hover); color: #fff; }
[data-theme='dark'] .btn--plein:hover { background: #b80d4c; }
.btn--bord { background: none; border-color: var(--line-strong); color: var(--ink); }
.btn--bord:hover { background: var(--surface-2); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn--large { width: 100%; }

/* Fenêtre de confirmation */
dialog {
  width: min(480px, calc(100vw - 32px)); padding: 30px; border-radius: 24px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  box-shadow: 0 40px 100px -30px rgb(0 0 0 / 0.7);
}
dialog::backdrop { background: rgb(5 4 7 / 0.66); backdrop-filter: blur(4px); }
dialog h2 { font-size: 24px; letter-spacing: -0.02em; font-weight: 600; }
dialog p { margin-top: 12px; color: var(--muted); }
dialog p strong { color: var(--ink); font-weight: 600; }
dialog .actions { margin-top: 26px; }
.coche { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); cursor: pointer; }
.coche input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); }
.coche a { color: var(--ink); text-underline-offset: 3px; }

/* Pages légales */
.legal { max-width: 760px; padding: 44px 0 10px; }
.legal h1 { margin-bottom: 18px; }
.legal .lead { margin: 0 0 8px; }
.legal h2 { margin-top: 38px; font-size: 21px; font-weight: 600; letter-spacing: -0.015em; }
.legal p, .legal ul { margin-top: 12px; color: var(--muted); }
.legal ul { display: grid; gap: 8px; padding-left: 20px; list-style: disc; }
.legal li::marker { color: var(--brand); }
.legal strong { color: var(--ink); font-weight: 600; }
.legal a { color: var(--ink); text-underline-offset: 3px; }
.resume { margin-top: 30px; padding: 26px 28px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.resume h2 { margin-top: 0; font-size: 18px; }

/* Administration */
dialog.large { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
dialog h3 { margin-top: 28px; font-size: 15px; font-weight: 600; color: var(--muted); }
.champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin-top: 14px; }
.champs .champ { margin-top: 0; }
.champs .champ--large { grid-column: 1 / -1; }
.champs input, .champs select, dialog .champ input { height: 46px; font-size: 15px; width: 100%; }
.champ select {
  padding: 0 40px 0 18px; border-radius: 14px; border: 1px solid var(--line-strong); background-color: var(--surface-2); color: var(--ink); font: inherit; font-size: 15px;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23857f82' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
.champ select:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
dialog .rows { margin-top: 8px; }
dialog .aide { margin-top: 6px; font-size: 14px; color: var(--faint); }
.client { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 18px 28px; align-items: center; padding: 24px 26px; }
.client h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.client__meta { margin-top: 4px; font-size: 14px; color: var(--faint); overflow-wrap: anywhere; }
.client__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.client__prix { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; }
.client__prix small { font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--faint); margin-left: 4px; }
.client__dates { margin-top: 6px; font-size: 14px; color: var(--muted); }
.client__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; max-width: 330px; }
.btn--petit { height: 38px; padding: 0 16px; font-size: 14px; }
.lien-supp { border: 0; background: none; padding: 0; font-size: 13px; color: var(--faint); text-decoration: underline; text-underline-offset: 3px; }
.lien-supp:hover { color: var(--down); }
@media (max-width: 900px) { .client { grid-template-columns: 1fr; } .client__actions { justify-content: flex-start; max-width: none; } }
@media (max-width: 560px) { .champs { grid-template-columns: 1fr; } dialog { padding: 22px 18px; } }

/* Pied */
.pied { padding: 44px 0 56px; font-size: 13px; color: var(--faint); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.pied a { text-underline-offset: 3px; }
.pied a:hover { color: var(--ink); }

/* Pages de connexion */
.seul { min-height: 100vh; display: grid; place-items: center; padding: 32px 0; }
.porte { width: min(460px, 100%); padding: 38px 34px 34px; }
.porte .brand { margin-bottom: 30px; }
.porte h1 { font-size: 34px; }
.porte .lead { font-size: 16px; }
.champ { display: grid; gap: 8px; margin-top: 26px; }
.champ label { font-size: 14px; font-weight: 500; }
.champ input {
  height: 52px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line-strong);
  background: var(--surface-2); font-size: 16px; transition: border-color 0.2s, box-shadow 0.2s;
}
.champ input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.porte .btn { margin-top: 16px; }
.msg { margin-top: 16px; font-size: 14px; color: var(--down); min-height: 1.5em; }
.petit { margin-top: 22px; font-size: 13px; color: var(--faint); }
.rond { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--brand-soft); color: var(--brand-hover); margin-bottom: 22px; }
.rond svg { width: 26px; height: 26px; }

/* Squelettes de chargement */
.sk { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2), var(--line-strong), var(--surface-2)); background-size: 200% 100%; animation: glisse 1.4s linear infinite; color: transparent !important; }
@keyframes glisse { to { background-position: -200% 0; } }

/* Entrée en scène */
.entre { animation: monte 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes monte { from { opacity: 0; transform: translateY(16px); } }

@media (max-width: 900px) {
  .grid--2, .abo { grid-template-columns: 1fr; }
  .abo__prix { border-right: 0; border-bottom: 1px solid var(--line); }
  .intro { grid-template-columns: 1fr; padding-top: 30px; }
  .intro__side { justify-items: start; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .brand small, .ghost span { display: none; }
  .ghost { width: 36px; padding: 0; }
  .card__head { padding: 20px 20px 0; }
  .card__body { padding: 18px 20px 22px; }
  .card__head .seg { margin-left: 0; }
  .abo__prix, .abo__detail { padding: 22px 20px; }
  .faits { grid-template-columns: 1fr; }
  .kpi__val { font-size: 38px; }
  .abo__montant { font-size: 44px; }
  .chart { height: 220px; }
  .actions .btn { width: 100%; }
  .porte { padding: 30px 22px 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
