/* Bloomi — système de design partagé (dossier, site, documents). Hors ligne : polices locales. */
@import url("fonts/fonts.css");

:root {
  --abricot: #F2894B;
  --abricot-ink: #B5541A;
  --abricot-soft: #FDE4D3;
  --encre: #22304A;
  --encre-2: #4B5872;
  --encre-3: #7C879C;
  --creme: #FFF8F0;
  --sable: #F3E9DC;
  --blanc: #FFFFFF;
  --sauge: #4E9C7A;
  --sauge-ink: #2F7A5B;
  --sauge-soft: #DDF0E6;
  --prune: #6B4FBB;
  --prune-soft: #E8E2F7;
  --ciel: #2F6BFF;
  --ciel-soft: #DFE8FF;
  --soleil: #F5C542;
  --soleil-soft: #FFF3C7;
  --brique: #D9534F;
  --brique-soft: #FBE1E0;

  --bg: var(--creme);
  --surface: var(--blanc);
  --surface-2: var(--sable);
  --text: var(--encre);
  --text-2: var(--encre-2);
  --text-3: var(--encre-3);
  --line: #E7DCCD;
  --shadow: 0 10px 30px -18px rgba(34, 48, 74, .35);
  --radius: 18px;
  --radius-s: 10px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-text: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #15192A;
  --surface: #1F2538;
  --surface-2: #27304A;
  --text: #F3EEE6;
  --text-2: #C9C3B8;
  --text-3: #9A978F;
  --line: #343C55;
  --abricot-soft: #4A3324;
  --sauge-soft: #1F3A30;
  --prune-soft: #2E2750;
  --ciel-soft: #1F2E52;
  --soleil-soft: #4A3F1C;
  --brique-soft: #4A2626;
  --abricot-ink: #F8A872;
  --sauge-ink: #8BD3B2;
  --shadow: 0 10px 30px -18px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.35rem; margin-top: 2em; }
h4 { font-size: 1.1rem; margin-top: 1.5em; }
p { margin: 0 0 1em; }
a { color: var(--abricot-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--encre); }
:root[data-theme="dark"] a:hover { color: var(--abricot); }
strong { font-weight: 800; }
small, .small { font-size: .9rem; color: var(--text-2); }
ul, ol { padding-left: 1.3em; }
li { margin: .25em 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 6px; }
img, video { max-width: 100%; height: auto; }
figure { margin: 1.5rem 0; }
figcaption { font-size: .9rem; color: var(--text-2); margin-top: .5rem; }

/* Mise en page éditoriale */
.eyebrow { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--abricot-ink); margin-bottom: .4rem; }
.lead { font-size: 1.18rem; color: var(--text-2); }
.muted { color: var(--text-3); }
.center { text-align: center; }
.grid { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.4rem; box-shadow: var(--shadow); }
.card h4 { margin-top: 0; }
.pill { display: inline-block; padding: .15em .7em; border-radius: 999px; font-size: .82rem; font-weight: 800; background: var(--surface-2); color: var(--text-2); }
.pill.abricot { background: var(--abricot-soft); color: var(--abricot-ink); }
.pill.sauge { background: var(--sauge-soft); color: var(--sauge-ink); }
.pill.prune { background: var(--prune-soft); color: var(--prune); }
.pill.ciel { background: var(--ciel-soft); color: var(--ciel); }
.pill.brique { background: var(--brique-soft); color: var(--brique); }
.pill.soleil { background: var(--soleil-soft); color: #7A5A00; }

/* Encadrés */
.box { border-radius: var(--radius); padding: 1.1rem 1.3rem; margin: 1.4rem 0; border: 1px solid var(--line); background: var(--surface); position: relative; }
.box > :last-child { margin-bottom: 0; }
.box .box-title { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: .9rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: .6rem; }
.box .box-title svg { width: 20px; height: 20px; flex: none; }
.box.in30 { background: var(--abricot-soft); border-color: transparent; }
.box.in30 .box-title { color: var(--abricot-ink); }
.box.key { background: var(--soleil-soft); border-color: transparent; }
.box.key .box-title { color: #7A5A00; }
:root[data-theme="dark"] .box.key .box-title { color: var(--soleil); }
.box.decision { background: var(--sauge-soft); border-color: transparent; }
.box.decision .box-title { color: var(--sauge-ink); }
.box.risk { background: var(--brique-soft); border-color: transparent; }
.box.risk .box-title { color: var(--brique); }
.box.source { background: var(--surface-2); font-size: .92rem; }
.box.source .box-title { color: var(--text-2); }
.box.todo { background: var(--ciel-soft); border-color: transparent; }
.box.todo .box-title { color: var(--ciel); }
.box.proche { background: var(--prune-soft); border-color: transparent; }
.box.proche .box-title { color: var(--prune); }

/* Chiffres clés */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.kpi .v { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1; color: var(--abricot-ink); }
.kpi .l { font-size: .9rem; color: var(--text-2); margin-top: .4rem; }
.kpi .s { font-size: .78rem; color: var(--text-3); margin-top: .3rem; }

/* Tableaux */
.tbl-wrap { overflow-x: auto; margin: 1.2rem 0; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: .55rem .7rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tbl th { background: var(--surface-2); font-weight: 800; position: sticky; top: 0; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl.sortable th { cursor: pointer; user-select: none; }
.tbl.sortable th::after { content: " ↕"; color: var(--text-3); font-size: .8em; }
.tbl.compact th, .tbl.compact td { padding: .35rem .5rem; font-size: .85rem; }
.ok { background: var(--sauge-soft); color: var(--sauge-ink); font-weight: 800; }
.part { background: var(--soleil-soft); color: #7A5A00; font-weight: 800; }
.no { background: var(--brique-soft); color: var(--brique); font-weight: 800; }
.na { color: var(--text-3); }
.tbl.matrix td { text-align: center; }
.tbl.matrix td:first-child { text-align: left; font-weight: 700; }
.score { display: inline-block; min-width: 2.2em; text-align: center; border-radius: 6px; padding: .05em .3em; font-weight: 800; }
.s5 { background: var(--sauge); color: #fff; } .s4 { background: #86C5A8; color: #1B3D2E; } .s3 { background: var(--soleil); color: #5A4300; } .s2 { background: #F3A99A; color: #5A1B18; } .s1 { background: var(--brique); color: #fff; }

/* Boutons */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.2rem; border-radius: 999px; font-weight: 800; font-family: var(--font-text); font-size: 1rem; border: 2px solid transparent; cursor: pointer; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--abricot); color: #1E1308; box-shadow: 0 10px 24px -12px var(--abricot); }
.btn.primary:hover { background: #F49C67; color: #1E1308; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--text-3); color: var(--text); }
.btn.small { padding: .4rem .85rem; font-size: .9rem; }
.btn.encre { background: var(--encre); color: #fff; }

/* Galerie de captures */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; cursor: zoom-in; }
.gallery img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: top; }
.gallery figure.phone img { aspect-ratio: 9/16; object-fit: cover; object-position: top; }
.gallery figcaption { padding: .5rem .7rem; font-size: .82rem; }
.lightbox { position: fixed; inset: 0; background: rgba(10, 12, 20, .92); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 2vh 2vw; flex-direction: column; gap: .6rem; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 96vw; max-height: 86vh; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lightbox .cap { color: #fff; font-size: .95rem; text-align: center; max-width: 90vw; }
.lightbox .close { position: absolute; top: 14px; right: 18px; color: #fff; background: rgba(255,255,255,.12); border: 0; border-radius: 999px; width: 42px; height: 42px; font-size: 1.4rem; cursor: pointer; }

/* Graphiques */
.chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem 1.2rem; margin: 1.4rem 0; }
.chart h4 { margin: 0 0 .2rem; font-size: 1.05rem; }
.chart .reading { font-size: .9rem; color: var(--text-2); margin: .3rem 0 .8rem; }
.chart canvas { width: 100% !important; max-height: 380px; }
.chart .src { font-size: .78rem; color: var(--text-3); margin-top: .6rem; }
.chart.tall canvas { max-height: 520px; }
.chart.short canvas { max-height: 260px; }

/* SVG natifs (matrices, gantt…) */
.svgfig { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 1.4rem 0; }
.svgfig svg { width: 100%; height: auto; display: block; }
.svgfig text { font-family: var(--font-text); fill: var(--text); }

/* Curseurs du modèle financier */
.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .8rem 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin: 1.4rem 0; }
.controls label { display: block; font-size: .85rem; font-weight: 800; color: var(--text-2); }
.controls label span.val { float: right; color: var(--abricot-ink); font-variant-numeric: tabular-nums; }
.controls input[type=range] { width: 100%; accent-color: var(--abricot); }
.controls select { width: 100%; padding: .35rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-family: inherit; }
.scenario-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.scenario-tabs button { border: 1px solid var(--line); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: .4rem .9rem; font-weight: 800; cursor: pointer; font-family: inherit; }
.scenario-tabs button.active { background: var(--encre); color: #fff; border-color: var(--encre); }
:root[data-theme="dark"] .scenario-tabs button.active { background: var(--abricot); color: #1E1308; border-color: var(--abricot); }

/* Timeline / étapes */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.2rem 0; }
.steps li { position: relative; padding-left: 3rem; margin: .9rem 0; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--abricot); color: #1E1308; font-weight: 800; display: grid; place-items: center; }

/* Persona */
.persona { display: grid; grid-template-columns: 64px 1fr; gap: 1rem; align-items: start; }
.persona .avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: #fff; }

/* Mockups */
.mock-tablet { background: #111522; border-radius: 22px; padding: 10px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); }
.mock-tablet img { display: block; border-radius: 12px; }
.mock-phone { background: #111522; border-radius: 34px; padding: 10px; width: 100%; max-width: 280px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); }
.mock-phone img { display: block; border-radius: 26px; }

/* Impression */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f4f4f4; --line: #ddd; --shadow: none; }
  body { font-size: 11pt; color: #000; }
  .no-print { display: none !important; }
  a { color: #000; text-decoration: none; }
  .box, .card, .chart, .kpi, .tbl-wrap { break-inside: avoid; }
  h2 { break-before: page; }
  h2:first-of-type { break-before: auto; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
}
