/* ============================================================================
   SENDRAISE · SERVICE OUTILLÉ — composants additionnels
   Chargé par les pages orientées prestation (accueil, bilan-trimestriel, ace).
   S'appuie sur tokens.css + components.css (+ offers.css pour report-* /
   tier-strip / a2-*). Tout est préfixé bt- (Bilan Trimestriel).
   ============================================================================ */

/* ── Maquette du livrable : feuilles du bilan ──────────────────────────── */
.bt-fan { position: relative; display: flex; justify-content: center; align-items: center; gap: var(--s-6); padding: var(--s-6) 0; }
.bt-fan > * { flex-shrink: 0; }
.bt-fan .tilt-l { transform: rotate(-2.2deg) translateY(10px); }
.bt-fan .tilt-r { transform: rotate(2.2deg) translateY(10px); }

.bt-sheet {
  width: 320px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--sh-lg); overflow: hidden;
  display: flex; flex-direction: column;
}
.bt-sheet .s-pad { padding: var(--s-5) var(--s-5) var(--s-4); display: flex; flex-direction: column; gap: var(--s-4); flex: 1; }
.bt-sheet .s-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-3) var(--s-5); border-top: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; color: var(--text-faint);
}
.bt-sheet .s-title { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); display: flex; align-items: center; justify-content: space-between; }
.bt-sheet .s-title b { font-weight: 500; color: var(--c-blue); letter-spacing: 0.08em; }
.bt-sheet h5 { font-family: var(--font-display); font-weight: 400; font-size: 17px; letter-spacing: var(--tracking-tight); color: var(--fg-strong); }

/* Couverture (navy) */
.bt-sheet.cover { background: var(--c-navy); border-color: rgba(255,255,255,0.08); }
.bt-sheet.cover .s-pad { gap: 0; }
.bt-sheet.cover .c-brand { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.5); }
.bt-sheet.cover .c-brand svg { width: 14px; height: 14px; color: #fff; flex-shrink: 0; }
.bt-sheet.cover .c-quarter { margin-top: auto; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: #8fb6d4; }
.bt-sheet.cover h4 { font-family: var(--font-display); font-weight: 400; font-size: 27px; line-height: 1.12; letter-spacing: var(--tracking-tight); color: #fff; margin-top: var(--s-2); }
.bt-sheet.cover .c-cabinet { font-family: var(--font-mono); font-size: 10px; color: rgba(255,255,255,0.45); margin-top: var(--s-3); }
.bt-sheet.cover .c-rule { height: 1px; background: rgba(255,255,255,0.14); margin: var(--s-5) 0; }
.bt-sheet.cover .c-meta { display: flex; flex-direction: column; gap: 7px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.04em; color: rgba(255,255,255,0.55); }
.bt-sheet.cover .c-meta span { display: flex; align-items: center; gap: 8px; }
.bt-sheet.cover .c-meta span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: #8fb6d4; flex-shrink: 0; }
.bt-sheet.cover .s-foot { border-top-color: rgba(255,255,255,0.12); color: rgba(255,255,255,0.4); }

/* KPIs (page synthèse) */
.bt-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.bt-kpi { background: var(--surface-sunk); border-radius: var(--r-sm); padding: 9px 10px 11px; }
.bt-kpi .k-lbl { font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.bt-kpi .k-val { font-family: var(--font-display); font-size: 17px; letter-spacing: var(--tracking-display); color: var(--fg-strong); margin-top: 2px; white-space: nowrap; }
.bt-kpi .k-val .pos { font-family: var(--font-mono); font-size: 9px; color: var(--c-success); margin-left: 2px; letter-spacing: 0; }
.bt-kpi .k-val .neg { font-family: var(--font-mono); font-size: 9px; color: var(--c-orange-ink); margin-left: 2px; letter-spacing: 0; }

/* Barres (page synthèse) */
.bt-chart { display: flex; align-items: flex-end; gap: 6px; height: 74px; border-bottom: 1px solid var(--border); }
.bt-chart i { flex: 1; background: linear-gradient(180deg, var(--c-blue), rgba(48,129,219,0.55)); border-radius: 2px 2px 0 0; }
.bt-chart i.alt { background: linear-gradient(180deg, var(--c-navy), rgba(28,47,63,0.5)); }
.bt-legend { display: flex; gap: var(--s-4); font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.05em; color: var(--text-faint); }
.bt-legend span { display: inline-flex; align-items: center; gap: 5px; }
.bt-legend .sw { width: 8px; height: 8px; border-radius: 2px; background: var(--c-blue); }
.bt-legend .sw.alt { background: var(--c-navy); }

/* Lignes barrées horizontales (répartitions) */
.bt-bars { display: flex; flex-direction: column; gap: 8px; }
.bt-bar { display: grid; grid-template-columns: 76px 1fr 42px; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 8.5px; color: var(--text-muted); }
.bt-bar .track { height: 7px; border-radius: 3px; background: var(--surface-sunk); overflow: hidden; }
.bt-bar .track i { display: block; height: 100%; border-radius: 3px; background: var(--c-blue); }
.bt-bar .track i.alt { background: var(--c-navy); }
.bt-bar .val { text-align: right; color: var(--fg); }

/* Page anomalies */
.bt-arows { display: flex; flex-direction: column; }
.bt-arow { display: grid; grid-template-columns: 10px 1fr auto; align-items: baseline; gap: 9px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.bt-arow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-orange); align-self: center; }
.bt-arow .lbl { font-size: 10.5px; line-height: 1.35; color: var(--text-muted); }
.bt-arow .lbl b { display: block; font-weight: 600; font-size: 11px; color: var(--fg-strong); }
.bt-arow .amt { font-family: var(--font-mono); font-size: 11px; color: var(--c-orange-ink); white-space: nowrap; }
.bt-atotal { display: flex; align-items: baseline; justify-content: space-between; padding-top: var(--s-3); }
.bt-atotal .lbl { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.bt-atotal .amt { font-family: var(--font-display); font-size: 21px; letter-spacing: var(--tracking-display); color: var(--c-orange-ink); }

/* Étiquette flottante sur la maquette */
.bt-tag {
  position: absolute; top: -6px; right: 6%; z-index: 2; white-space: nowrap;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--c-orange-ink); color: #fff; padding: 6px var(--s-3); border-radius: var(--r-pill);
  box-shadow: var(--sh-sm); transform: rotate(2deg);
}

/* ── « Comment ça marche » — 3 temps ───────────────────────────────────── */
.bt-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); margin-top: var(--s-12); }
.bt-step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: var(--s-8) var(--s-6) var(--s-7, 28px); display: flex; flex-direction: column; gap: var(--s-3);
}
.bt-step .n { font-family: var(--font-mono); font-size: var(--fs-eyebrow); letter-spacing: 0.1em; color: var(--c-blue); }
.bt-step h3 { font-family: var(--font-display); font-weight: 500; font-size: 19px; letter-spacing: var(--tracking-tight); color: var(--fg-strong); text-wrap: balance; }
.bt-step p { font-size: var(--fs-body-sm); color: var(--text-muted); line-height: 1.6; }
.bt-step p strong { color: var(--fg-strong); font-weight: 600; }
.bt-step .s-note { margin-top: auto; padding-top: var(--s-4); font-family: var(--font-mono); font-size: var(--fs-caption); color: var(--text-faint); border-top: 1px solid var(--border); }

/* ── Sommaire du bilan (chapitres) ─────────────────────────────────────── */
.bt-toc { display: flex; flex-direction: column; }
.bt-toc-row { display: grid; grid-template-columns: 44px 1fr; gap: var(--s-4); padding: var(--s-4) 0; border-top: 1px solid var(--border); align-items: baseline; }
.bt-toc-row:last-child { border-bottom: 1px solid var(--border); }
.bt-toc-row .num { font-family: var(--font-mono); font-size: var(--fs-caption); letter-spacing: 0.08em; color: var(--c-blue); }
.bt-toc-row .t { font-family: var(--font-display); font-weight: 500; font-size: 18px; letter-spacing: var(--tracking-tight); color: var(--fg-strong); }
.bt-toc-row .d { font-size: var(--fs-body-sm); color: var(--text-muted); line-height: 1.55; margin-top: 3px; }

/* ── Déroulé du trimestre (timeline horizontale) ───────────────────────── */
.bt-quarter { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); margin-top: var(--s-12); position: relative; }
.bt-qstep { position: relative; padding-top: var(--s-6); }
.bt-qstep::before {
  content: ""; position: absolute; top: 4px; left: 0; right: calc(-1 * var(--s-4)); height: 1px;
  background: var(--border-strong);
}
.bt-qstep:last-child::before { right: 0; }
.bt-qstep::after {
  content: ""; position: absolute; top: 0; left: 0; width: 9px; height: 9px;
  border-radius: 50%; background: var(--c-blue); box-shadow: 0 0 0 4px rgba(48,129,219,0.15);
}
.bt-qstep.deliver::after { background: var(--c-orange-ink); box-shadow: 0 0 0 4px rgba(230,97,30,0.15); }
.bt-qstep .when { font-family: var(--font-mono); font-size: var(--fs-eyebrow); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.bt-qstep h3 { font-family: var(--font-display); font-weight: 500; font-size: 18px; letter-spacing: var(--tracking-tight); color: var(--fg-strong); margin: var(--s-2) 0 var(--s-2); text-wrap: balance; }
.bt-qstep p { font-size: var(--fs-body-sm); color: var(--text-muted); line-height: 1.6; }
.bt-qstep p strong { color: var(--fg-strong); font-weight: 600; }
.bt-quarter-note {
  margin-top: var(--s-10); display: flex; align-items: center; gap: var(--s-3);
  font-family: var(--font-mono); font-size: var(--fs-caption); color: var(--text-faint);
}
.bt-quarter-note .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-success); box-shadow: 0 0 0 3px var(--c-success-soft); flex-shrink: 0; }

/* ── Portail (mock) ────────────────────────────────────────────────────── */
.bt-portal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--sh-lg); overflow: hidden; max-width: 480px;
}
.bt-portal .p-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border); background: var(--surface-sunk);
}
.bt-portal .p-head .brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.bt-portal .p-head .brand svg { width: 14px; height: 14px; color: var(--c-navy); }
.bt-portal .p-head .who { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }
.bt-portal .p-list { display: flex; flex-direction: column; }
.bt-portal .p-row {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: var(--s-3);
  padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border);
}
.bt-portal .p-row:last-child { border-bottom: none; }
.bt-portal .p-row .file {
  width: 30px; height: 38px; border-radius: 4px; border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, var(--c-navy) 34%, #fff 34%); position: relative;
}
.bt-portal .p-row .file::after { content: ""; position: absolute; left: 5px; right: 5px; top: 18px; height: 2px; background: var(--border); box-shadow: 0 5px 0 var(--border), 0 10px 0 var(--border); }
.bt-portal .p-row .meta b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 15px; color: var(--fg-strong); }
.bt-portal .p-row .meta span { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }
.bt-portal .badge-new { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; background: rgba(48,129,219,0.1); color: var(--c-blue); padding: 4px 9px; border-radius: var(--r-pill); }
.bt-portal .badge-seen { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-success); display: inline-flex; align-items: center; gap: 5px; }

/* ── Nom de produit long (hero sombre) ─────────────────────────────────── */
.product-name.long { font-size: clamp(40px, 5.6vw, 76px); line-height: 1.02; }

/* ── Garde-fous (composants existants, nouveaux contenus plus longs) ───── */
.pp-transition .pp-sub { white-space: normal; max-width: 62ch; margin-left: auto; margin-right: auto; }
.a2-action .btn-primary, .a2-action .btn-outline { white-space: normal; text-align: center; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .dark-hero-right .bt-fan .tilt-r,
  .dark-hero-right .bt-fan .tilt-l { display: none; }
}
@media (max-width: 1023px) {
  .bt-how { grid-template-columns: 1fr; }
  .bt-quarter { grid-template-columns: 1fr 1fr; row-gap: var(--s-10); }
  .bt-fan .tilt-l { display: none; }
}
@media (max-width: 640px) {
  .bt-quarter { grid-template-columns: 1fr; }
  .bt-fan { flex-direction: column; align-items: center; }
  .bt-fan .tilt-r { display: none; }
  .bt-sheet { width: min(320px, 100%); }
}
