/* BAIT : un coach calme et honnête. Palette froide, lisible, chiffres alignés. */
:root {
  --bg: #F3F5F7;
  --surface: #FFFFFF;
  --ink: #1B2A3A;
  --ink-soft: #5A6B7D;
  --line: #DCE2E8;
  --action: #2F5FD0;
  --action-ink: #FFFFFF;
  --buy: #1F7A55;
  --buy-soft: #E3F2EB;
  --sell: #B4372F;
  --sell-soft: #F8E5E3;
  --caution: #A86A12;
  --caution-soft: #FBF0DC;
  --radius-lg: 18px;
  --radius-sm: 10px;
  --space: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 var(--font);
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
a { color: var(--action); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; border-radius: 6px; }

.page { max-width: 560px; margin: 0 auto; padding: 20px var(--space) 32px; }
h1 { font: 700 34px/1.15 var(--font-display); letter-spacing: -0.02em; margin: 8px 0 12px; }
h2 { font: 650 20px/1.3 var(--font-display); margin: 32px 0 10px; }
h3 { font-size: 17px; margin: 24px 0 8px; }
p { margin: 0 0 10px; }
.lede { font-size: 18px; color: var(--ink-soft); max-width: 34em; }
.muted { color: var(--ink-soft); }
.hint { font-size: 15px; color: var(--ink-soft); margin-top: 10px; }
.num { font-variant-numeric: tabular-nums; }
.is-up { color: var(--buy); }
.is-down { color: var(--sell); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack { display: grid; gap: 10px; }
code { font-size: 14px; background: var(--line); padding: 1px 6px; border-radius: 6px; }

/* ---------- bandeaux de compte ---------- */
.demo-banner {
  text-align: center; font-size: 13px; color: var(--ink-soft);
  padding: calc(6px + env(safe-area-inset-top)) 12px 6px;
}
.live-banner {
  background: var(--sell); color: #fff; text-align: center; font-weight: 650; font-size: 15px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  position: sticky; top: 0; z-index: 10;
}

/* ---------- barre d'onglets ---------- */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20; max-width: 560px; margin: 0 auto;
  border-radius: 18px 18px 0 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tab {
  display: grid; justify-items: center; gap: 2px; padding: 4px 0;
  color: var(--ink-soft); text-decoration: none; font-size: 11px; font-weight: 500;
}
.tab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.is-current { color: var(--action); }

/* ---------- boutons & formulaires ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px;
  padding: 0 22px; border-radius: 14px; border: 0; font: 600 17px var(--font);
  text-decoration: none; cursor: pointer; width: 100%;
}
.btn-primary { background: var(--action); color: var(--action-ink); }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.btn-danger { background: var(--sell); color: #fff; }
.btn-link { background: none; color: var(--ink-soft); text-decoration: underline; min-height: 44px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
label { font-weight: 600; }
input[type=password], input[type=text], input[type=number], select {
  width: 100%; min-height: 50px; padding: 0 14px; font: 18px var(--font); color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
}
input:focus, select:focus { border-color: var(--action); outline: none; box-shadow: 0 0 0 3px rgba(47, 95, 208, 0.2); }
.field { margin-bottom: 22px; }
.field .help { font-size: 15px; color: var(--ink-soft); margin: 2px 0 8px; }
.input-unit { display: flex; align-items: center; gap: 10px; }
.input-unit input { max-width: 180px; font-variant-numeric: tabular-nums; }
.input-unit span { color: var(--ink-soft); font-size: 18px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; }
.check input { width: 24px; height: 24px; margin-top: 1px; flex: none; accent-color: var(--action); }
.field-error { color: var(--sell); font-weight: 600; }
.example {
  background: #E6ECFA; color: #1E3E8A; border-radius: var(--radius-lg);
  padding: 14px 16px; margin: 8px 0 18px; font-weight: 500;
}
details summary { cursor: pointer; color: var(--sell); font-weight: 600; min-height: 44px; display: flex; align-items: center; }
details[open] summary { margin-bottom: 8px; }

/* ---------- connexion ---------- */
.login { padding-top: 12vh; }
.login-title { font-size: 44px; letter-spacing: -0.04em; margin-bottom: 6px; }
.login form { margin-top: 28px; }

/* ---------- accueil ---------- */
.welcome { background: var(--surface); border-radius: var(--radius-lg); padding: 4px 20px 20px; margin-bottom: 20px; }
.welcome h2 { margin-top: 16px; }
.welcome form { margin-top: 18px; }
.status {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border-radius: var(--radius-lg); padding: 16px 18px; margin: 12px 0;
}
.status-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--buy); box-shadow: 0 0 0 5px var(--buy-soft); }
.status-warn .status-dot { background: var(--caution); box-shadow: 0 0 0 5px var(--caution-soft); }
.status-down .status-dot { background: var(--sell); box-shadow: 0 0 0 5px var(--sell-soft); }
.status-title { font-weight: 650; margin: 0; }
.status-detail { margin: 2px 0 0; color: var(--ink-soft); font-size: 15px; }
.today-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.today-grid > div { background: var(--surface); border-radius: var(--radius-lg); padding: 14px 16px; }
.figure { font: 650 26px/1.2 var(--font-display); font-variant-numeric: tabular-nums; margin: 0; }
.figure-label { font-size: 14px; color: var(--ink-soft); margin: 2px 0 0; }

/* ---------- listes ---------- */
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.plain-list.bullets { list-style: disc; padding-left: 1.2em; }
.empty { color: var(--ink-soft); background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--radius-lg); padding: 16px; }
.link-more { display: inline-block; margin-top: 10px; font-weight: 600; }
.signal-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
.signal-list li + li { border-top: 1px solid var(--line); }
.signal-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; color: inherit; text-decoration: none; min-height: 64px; }
.signal-main { display: grid; }
.signal-name { font-weight: 600; }
.signal-main .muted { font-size: 14px; }
.signal-result { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; }
.side { display: inline-block; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.side-buy { background: var(--buy-soft); color: var(--buy); }
.side-sell { background: var(--sell-soft); color: var(--sell); }
.side-lg { font-size: 15px; padding: 6px 14px; margin: 0; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--line); border-radius: 12px; padding: 3px; margin: 12px 0 16px; }
.segmented a { text-align: center; padding: 9px 6px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; }
.segmented a.is-current { background: var(--surface); font-weight: 650; }

/* ---------- étapes (vraies séquences) ---------- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; position: relative; padding-left: 44px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -1px;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 15px;
}

/* ---------- avis ---------- */
.notice { background: var(--surface); border-radius: var(--radius-lg); padding: 14px 18px; margin: 14px 0; }
.notice h2 { margin-top: 4px; }
.notice-warn { background: var(--caution-soft); }
.notice-ok { background: var(--buy-soft); color: var(--buy); font-weight: 600; }

/* ---------- fiche signal ---------- */
.back { display: inline-flex; min-height: 44px; align-items: center; font-weight: 500; text-decoration: none; }
.back::before { content: "‹"; font-size: 26px; margin-right: 6px; line-height: 1; }
.signal-head h1 { margin-top: 10px; }
.validity, .verdict { border-radius: var(--radius-lg); padding: 14px 18px; margin: 16px 0; }
.validity p, .verdict p { margin: 2px 0 0; }
.validity.is-ok { background: var(--buy-soft); }
.validity.is-late { background: var(--caution-soft); }
.validity-title, .verdict-title { font: 700 20px/1.3 var(--font-display); }
.validity.is-ok .validity-title { color: var(--buy); }
.validity.is-late .validity-title { color: var(--caution); }
.verdict.is-up { background: var(--buy-soft); }
.verdict.is-down { background: var(--sell-soft); }

/* L'élément marquant : l'échelle de prix du trade */
.ladder-wrap { background: var(--surface); border-radius: var(--radius-lg); padding: 12px 8px; }
.ladder { width: 100%; height: auto; display: block; font-family: var(--font); }
.ladder .zone-risk { fill: var(--sell-soft); }
.ladder .zone-gain { fill: var(--buy-soft); }
.ladder .zone-open { fill: var(--buy-soft); opacity: 0.55; }
.ladder line { stroke-width: 3; stroke-linecap: round; }
.ladder .lv-stop { stroke: var(--sell); fill: var(--sell); }
.ladder .lv-entry { stroke: var(--action); fill: var(--action); }
.ladder .lv-target { stroke: var(--buy); fill: var(--buy); }
.ladder .lv-label { stroke: none; font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ladder .lv-now { fill: var(--ink); }
.ladder .lv-now-label { fill: var(--ink-soft); font-size: 12px; }
.ladder .lv-open { fill: var(--buy); font-size: 13px; }

.plan { display: grid; gap: 1px; background: var(--line); border-radius: var(--radius-lg); overflow: hidden; margin: 12px 0 0; }
.plan > div { display: flex; justify-content: space-between; gap: 12px; background: var(--surface); padding: 12px 16px; }
.plan dt { color: var(--ink-soft); }
.plan dd { margin: 0; font-weight: 650; text-align: right; }
.decision { margin-top: 36px; }
.decision-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- stratégies ---------- */
.strategy-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 12px; }
.strategy-card {
  display: grid; gap: 6px; padding: 18px; background: var(--surface); border-radius: var(--radius-lg);
  color: inherit; text-decoration: none;
}
.strategy-name { font: 650 19px/1.3 var(--font-display); }
.strategy-tagline { color: var(--ink-soft); font-size: 15px; }
.strategy-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.badge { justify-self: start; display: inline-block; font-size: 13px; font-weight: 650; padding: 3px 10px; border-radius: 999px; background: var(--bg); }
.badge .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-soft); margin-right: 7px; vertical-align: 1px; }
.badge-perdante .dot { background: var(--sell); }
.badge-prometteuse .dot { background: var(--caution); }
.badge-confirmee .dot { background: var(--buy); }
.badge-dot-only { background: none; padding: 0 2px 0 0; }
.badge-perdante { background: var(--sell-soft); color: var(--sell); }
.badge-prometteuse { background: var(--caution-soft); color: var(--caution); }
.badge-confirmee { background: var(--buy-soft); color: var(--buy); }
.pill-on { justify-self: start; font-size: 13px; font-weight: 650; color: var(--action); }
.strategy-head h1 { margin-top: 12px; }
.toggle-box { background: var(--surface); border-radius: var(--radius-lg); padding: 16px 18px; margin: 18px 0; }
.toggle-box p { margin: 0; }
.proscons { display: grid; gap: 4px; }
.big-result { font: 700 40px/1.1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; margin: 14px 0 0; }
.curve-wrap { background: var(--surface); border-radius: var(--radius-lg); padding: 14px 12px 8px; margin: 16px 0; }
.curve { width: 100%; height: auto; display: block; }
.curve polyline { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.curve .curve-up { stroke: var(--buy); }
.curve .curve-down { stroke: var(--sell); }
.curve .curve-zero { stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 4 4; }
.curve-axis { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-soft); padding: 4px 8px 0; }
.facts { display: grid; gap: 1px; background: var(--line); border-radius: var(--radius-lg); overflow: hidden; margin: 0; }
.facts > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; background: var(--surface); padding: 12px 16px; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 650; text-align: right; }
.facts dd.explain { grid-column: 1 / -1; text-align: left; font-weight: 400; font-size: 14px; color: var(--ink-soft); }
.years { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
.years th, .years td { padding: 10px 14px; text-align: right; border-bottom: 1px solid var(--line); }
.years th:first-child { text-align: left; }
.years thead th { font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.years tbody tr:last-child > * { border-bottom: 0; }

/* ---------- aide ---------- */
.glossary { margin: 0; background: var(--surface); border-radius: var(--radius-lg); padding: 6px 18px; }
.glossary dt { font-weight: 700; margin-top: 14px; }
.glossary dd { margin: 2px 0 14px; color: var(--ink-soft); padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.glossary dd:last-of-type { border-bottom: 0; }

.account { margin-top: 36px; }
.logout { margin-top: 28px; text-align: center; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- notifications ---------- */
.push-box { background: var(--surface); border-radius: var(--radius-lg); padding: 4px 18px 16px; margin: 12px 0 28px; }
.push-box h2 { margin-top: 14px; }
[hidden] { display: none !important; }
