/* Bonpli account pages (D123). One stylesheet, no script, no third-party font.
   Colours of the site bonpli.fr (site/marque.css, J4): cream paper, ink,
   brick as the brand, sage for « good », ochre for « to watch ». */
:root {
  --bg: #f3eee4;
  --surface: #fffdf9;
  --ink: #1d1b17;
  --ink-2: #3f3a33;
  --muted: #6b6359;
  --faint: #8a8173;
  --line: #e2dacb;
  --line-2: #eee8dc;
  --brand: #a8472a;
  --brand-ink: #8f3b22;
  --brand-soft: #f6e9e2;
  --ok: #3f5f49;
  --ok-soft: #e7ece2;
  --info: #3f3a33;
  --info-soft: #ece4d4;
  --warn: #7f5a0e;
  --warn-soft: #f5ecd8;
  --danger: #b5381c;
  --danger-soft: #f8e6df;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(29, 27, 23, 0.05), 0 1px 3px rgba(29, 27, 23, 0.06);
  --shadow-lg: 0 10px 30px -14px rgba(29, 27, 23, 0.22);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 700; font-family: var(--serif); letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }

/* top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1080px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--ink); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.logo { width: 28px; height: 28px; border-radius: 7px; display: block; flex: none; }
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a, .topnav button { font: inherit; font-size: 14px; color: var(--ink-2); padding: 7px 12px; border-radius: 8px; background: none; border: 0; cursor: pointer; }
.topnav a:hover, .topnav button:hover { background: var(--line-2); text-decoration: none; }
.topnav a.on { color: var(--ink); background: var(--line-2); font-weight: 600; }
.topnav form { margin: 0; }

/* layout */
.wrap { max-width: 1080px; margin: 0 auto; padding: 32px 20px 56px; }
.narrow { max-width: 460px; margin: 0 auto; padding: 48px 20px 56px; min-height: calc(100vh - 150px); display: flex; flex-direction: column; justify-content: center; }
.field-err { font-size: 13px; color: var(--danger); margin-top: 6px; display: flex; gap: 6px; align-items: baseline; }
.field-err::before { content: "!"; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; flex: none; }
.chips li { max-width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
.lead { color: var(--ink-2); font-size: 16px; margin-top: 8px; }
.sub { color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.stack > * + * { margin-top: 16px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 24px; }
.card-head { padding: 18px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); background: #fbfbfc; border-radius: 0 0 var(--radius) var(--radius); }
.auth-card { padding: 32px; box-shadow: var(--shadow-lg); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { padding: 18px 20px; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* notices */
.notices { list-style: none; margin: 0; padding: 0; }
.notice { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; padding: 18px 20px; border-top: 1px solid var(--line-2); }
.notice:first-child { border-top: 0; }
.score { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.score small { display: block; font-size: 10px; font-weight: 600; opacity: 0.75; margin-top: -6px; }
.s-high { background: var(--ok-soft); color: var(--ok); }
.s-mid { background: var(--info-soft); color: var(--info); }
.s-low { background: var(--warn-soft); color: var(--warn); }
.notice-title { font-weight: 600; font-size: 15px; line-height: 1.4; color: var(--ink); }
.notice-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.notice-why { margin-top: 10px; font-size: 14px; color: var(--ink-2); background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.notice-link { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 600; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-brand { background: var(--brand-soft); color: var(--brand-ink); }
.locked { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; background: var(--brand-soft); border-top: 1px solid var(--line-2); border-radius: 0 0 var(--radius) var(--radius); font-size: 14px; color: var(--brand-ink); }
.locked p { margin: 0; }
.locked p + p { margin-top: 8px; }
.rule { margin: 0; padding: 12px 20px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }
.examine { list-style: none; margin: 0; padding: 0; }
.examine li { display: flex; gap: 12px; align-items: baseline; padding: 10px 20px; border-top: 1px solid var(--line-2); font-size: 14px; }
.examine .num { font-weight: 700; color: var(--warn); font-variant-numeric: tabular-nums; min-width: 28px; }

/* empty state */
.empty { text-align: center; padding: 48px 24px; }
.empty-icon { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 22px; font-weight: 700; }
.empty p { color: var(--muted); max-width: 420px; margin: 6px auto 0; }
/* J2: empty states drawn as skeletons of the cards to come */
.skeleton .notice { opacity: 0.55; }
.sk-score { background: var(--line-2); }
.sk-line { height: 12px; border-radius: 6px; background: var(--line-2); margin-top: 8px; }
.sk-wide { width: 82%; }
.sk-short { width: 46%; }
.empty-overlay { padding-top: 20px; border-top: 1px solid var(--line-2); }
.meter { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; margin-top: 12px; }
.meter span { display: block; height: 100%; background: var(--brand); }
.meter-0 { width: 4%; } .meter-1 { width: 10%; } .meter-2 { width: 20%; } .meter-3 { width: 30%; }
.meter-4 { width: 40%; } .meter-5 { width: 50%; } .meter-6 { width: 60%; } .meter-7 { width: 70%; }
.meter-8 { width: 80%; } .meter-9 { width: 90%; } .meter-10 { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-block; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--ink-2); background: #fff; cursor: pointer; }
.chip input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.notice-rgpd { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line-2); }
.notice-rgpd div + div { margin-top: 4px; }
.notice-rgpd dt { display: inline; font-weight: 600; color: var(--ink-2); }
.notice-rgpd dd { display: inline; margin: 0; }

/* side cards */
.side h3 { margin-bottom: 8px; }
.side .sub + .btn, .side p + .btn, .side ul + .btn { margin-top: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.chips li { font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--ink-2); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; color: var(--ink); font-weight: 500; }
/* J4: the trial card reads like the others — paper, a brick rule on top. */
.trial { padding: 22px 24px 24px; border-top: 3px solid var(--brand); }
.trial-head .tag { margin-bottom: 10px; }
.trial h3 { font-family: var(--serif); font-size: 19px; letter-spacing: -0.01em; }
.trial ul { margin: 12px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-2); }
.trial li { padding-left: 24px; position: relative; margin-top: 8px; }
.trial li::before { content: "✓"; position: absolute; left: 2px; color: var(--ok); font-weight: 700; }
.trial .price { font-size: 13px; line-height: 1.5; color: var(--muted); margin-top: 14px; }
.danger-zone { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-zone form { margin: 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 600; line-height: 1; padding: 11px 16px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .12s, box-shadow .12s; }
.btn:hover { text-decoration: none; }
.btn:focus-visible, .input:focus-visible, .check input:focus-visible { outline: 3px solid #e3b8a6; outline-offset: 1px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(168, 71, 42, 0.3); }
.btn-primary:hover { background: var(--brand-ink); }
.btn-light { background: #fff; color: var(--brand-ink); }
.btn-light:hover { background: var(--brand-soft); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }
.btn-secondary:hover { background: var(--bg); }
.btn-ghost { background: none; color: var(--muted); padding-left: 10px; padding-right: 10px; }
.btn-ghost:hover { color: var(--ink); background: var(--line-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #991b1b; }
.btn-block { width: 100%; padding-top: 13px; padding-bottom: 13px; font-size: 15px; }

/* forms */
.field { margin-top: 18px; }
.field:first-child { margin-top: 0; }
.label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.input { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1px solid #cfc6b6; border-radius: 8px; padding: 11px 12px; }
.input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.input.err { border-color: var(--danger); }
textarea.input { min-height: 96px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); margin-top: 14px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.checks .check { margin-top: 8px; }
.radio-cards { display: grid; gap: 10px; }
.radio-card { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 14px; }
.radio-card input { accent-color: var(--brand); width: 18px; height: 18px; margin: 0; }
.radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 24px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--line-2); margin: 24px 0; }

/* alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 18px; }
.alert-err { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-info { background: var(--brand-soft); color: var(--brand-ink); }

/* stepper */
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 24px; }
.steps li { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps li.done { background: var(--brand); }
.step-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }

/* analysis */
.pulse { width: 56px; height: 56px; border-radius: 50%; margin: 8px auto 20px; background: var(--brand-soft); position: relative; }
.pulse::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--brand); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(0.8); opacity: .6; } 50% { transform: scale(1.15); opacity: 1; } }
.checklist { list-style: none; padding: 0; margin: 20px 0 0; font-size: 14px; color: var(--ink-2); }
.checklist li { padding: 6px 0 6px 26px; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 4px; top: 12px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); }
.company { display: flex; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.avatar { width: 44px; height: 44px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; }
.understood { margin-top: 18px; }
.understood .big { font-size: 17px; font-weight: 650; color: var(--ink); margin-top: 4px; }
details.fix summary { cursor: pointer; font-size: 14px; color: var(--brand); font-weight: 600; margin-top: 12px; list-style: none; }
details.fix summary::-webkit-details-marker { display: none; }
details.fix[open] summary { margin-bottom: 10px; }

/* footer */
.foot { max-width: 1080px; margin: 0 auto; padding: 24px 20px 40px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--faint); border-top: 1px solid var(--line); }
.foot a { color: var(--muted); }
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-data { order: 3; flex-basis: 100%; margin: 0; font-size: 12px; line-height: 1.5; }

/* utilities (the CSP forbids style attributes) */
.center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-20 { margin-top: 20px; }
.mt-28 { margin-top: 28px; }
.h-md { font-size: 22px; }
.h-lg { font-size: 24px; }
.lead-sm { font-size: 15px; }
.icon-left { margin: 0 0 14px; }
.icon-warn { background: var(--warn-soft); color: var(--warn); }
.icon-ok { background: var(--ok-soft); color: var(--ok); }
.icon-danger { background: var(--danger-soft); color: var(--danger); }
.checklist.mid { text-align: left; max-width: 300px; margin-left: auto; margin-right: auto; }
.form-actions.mid { justify-content: center; }
.form-actions.tight { margin-top: 12px; }
.strong { font-weight: 650; }
.plan { display: inline-flex; margin-left: 8px; vertical-align: middle; }

/* mobile */
@media (max-width: 860px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 22px; }
}
@media (max-width: 560px) {
  h1 { font-size: 24px; }
  .wrap { padding: 20px 16px 40px; }
  /* J4: on a phone the form starts at the top, never under the fold. */
  .narrow { padding: 20px 16px 40px; min-height: 0; justify-content: flex-start; }
  .lead { font-size: 15px; }
  .mt-28 { margin-top: 20px; }
  .auth-card { padding: 22px; }
  .topbar-in { padding: 0 16px; }
  .topnav { gap: 0; }
  .topnav a, .topnav button { padding: 7px 8px; font-size: 13px; }
  .brand-name { display: none; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 20px; }
  .kpi-label, .kpi-note { font-size: 12px; }
  .notice { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 16px; }
  .score { width: 44px; height: 44px; font-size: 16px; border-radius: 10px; }
  .checks { grid-template-columns: minmax(0, 1fr); }
  .locked { flex-direction: column; align-items: flex-start; }
}
