/* Passe ton challenge — fondations communes (site + appli)
   Idée : un instrument de bord pour trader. Fond bleu nuit / papier froid, cobalt pour la marque,
   le vert, l'orange et le rouge réservés à l'état du compte. Gros chiffres en mono, titres en grotesque. */
:root {
  /* couleurs (thème clair) */
  --fond: #eef1f7;
  --surface: #ffffff;
  --surface-2: #e8ecf4;
  --surface-3: #f6f8fc;
  --ligne: #dde3ee;
  --ligne-forte: #c4cddd;
  --texte: #0d1530;
  --texte-doux: #56627f;
  --texte-pale: #8790aa;
  --marque: #2f45ec;
  --marque-fond: #2f45ec;
  --marque-fort: #1f30c4;
  --marque-doux: #e2e7ff;
  --sur-marque: #ffffff;
  --ok: #0b8a4b;
  --ok-doux: #dcf2e6;
  --warn: #b86e05;
  --warn-doux: #fcefd4;
  --danger: #d2263b;
  --danger-doux: #fbe3e6;
  --danger-fort: #8b1427;
  --ombre: 0 1px 2px rgba(13, 21, 48, 0.05), 0 10px 30px -16px rgba(13, 21, 48, 0.22);
  --ombre-forte: 0 2px 6px rgba(13, 21, 48, 0.06), 0 24px 60px -20px rgba(13, 21, 48, 0.35);
  --voile: rgba(9, 14, 28, 0.42);

  /* typographie */
  --f-titre: "Bricolage Grotesque", "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-texte: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-chiffres: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --t-xs: 0.75rem;
  --t-s: 0.844rem;
  --t-m: 0.938rem;
  --t-l: 1.063rem;
  --t-xl: 1.313rem;
  --t-2xl: 1.75rem;
  --t-3xl: 2.25rem;

  /* formes */
  --r-s: 10px;
  --r-m: 14px;
  --r-l: 20px;
  --r-xl: 26px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #080d1b;
    --surface: #10182e;
    --surface-2: #19233f;
    --surface-3: #0c1326;
    --ligne: #212c4b;
    --ligne-forte: #334069;
    --texte: #e9eeff;
    --texte-doux: #9aa6c8;
    --texte-pale: #6b779d;
    --marque: #8a9cff;
    --marque-fond: #4a61f2;
    --marque-fort: #a9b6ff;
    --marque-doux: #1b2657;
    --sur-marque: #ffffff;
    --ok: #3bd483;
    --ok-doux: #0e2a1f;
    --warn: #ffb84f;
    --warn-doux: #34270e;
    --danger: #ff6272;
    --danger-doux: #3b1520;
    --danger-fort: #ff9aa5;
    --ombre: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -18px rgba(0, 0, 0, 0.7);
    --ombre-forte: 0 2px 8px rgba(0, 0, 0, 0.35), 0 28px 70px -24px rgba(0, 0, 0, 0.85);
    --voile: rgba(2, 5, 14, 0.66);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #080d1b;
  --surface: #10182e;
  --surface-2: #19233f;
  --surface-3: #0c1326;
  --ligne: #212c4b;
  --ligne-forte: #334069;
  --texte: #e9eeff;
  --texte-doux: #9aa6c8;
  --texte-pale: #6b779d;
  --marque: #8a9cff;
  --marque-fond: #4a61f2;
  --marque-fort: #a9b6ff;
  --marque-doux: #1b2657;
  --sur-marque: #ffffff;
  --ok: #3bd483;
  --ok-doux: #0e2a1f;
  --warn: #ffb84f;
  --warn-doux: #34270e;
  --danger: #ff6272;
  --danger-doux: #3b1520;
  --danger-fort: #ff9aa5;
  --ombre: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -18px rgba(0, 0, 0, 0.7);
  --ombre-forte: 0 2px 8px rgba(0, 0, 0, 0.35), 0 28px 70px -24px rgba(0, 0, 0, 0.85);
  --voile: rgba(2, 5, 14, 0.66);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--f-texte);
  font-size: var(--t-m);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img,
svg {
  max-width: 100%;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--f-titre);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
p {
  margin: 0;
}
ul,
ol {
  margin: 0;
  padding: 0;
}
a {
  color: inherit;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid var(--marque);
  outline-offset: 2px;
  border-radius: 8px;
}
.sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.chiffre {
  font-family: var(--f-chiffres);
  font-variant-numeric: tabular-nums;
  font-stretch: 87.5%;
  letter-spacing: -0.02em;
  word-spacing: -0.32em; /* en mono, une espace est aussi large qu'un chiffre */
}
/* gros chiffres avec virgule : grotesque, plus serré que la mono */
.lot-v .chiffre,
.sim-gros,
.sim-vitrine-gros,
.curseur-v,
.prix-montant,
.offre-prix,
.regle-v,
.carte-regles-chiffres dd {
  font-family: var(--f-titre) !important;
  font-stretch: normal !important;
  font-weight: 760 !important;
  letter-spacing: -0.035em;
  word-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}
.pos {
  color: var(--ok);
}
.neg {
  color: var(--danger);
}
.nul {
  color: var(--texte-doux);
}
.note {
  color: var(--texte-doux);
  font-size: var(--t-s);
  line-height: 1.45;
}
.surtitre {
  font-size: var(--t-xs);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--texte-doux);
}

/* ---------- icônes ---------- */
.ico {
  width: 20px;
  height: 20px;
  flex: none;
}

/* ---------- boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-m);
  border: 1px solid transparent;
  font-weight: 650;
  font-size: var(--t-m);
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active {
  transform: scale(0.98);
}
.btn .ico {
  width: 18px;
  height: 18px;
}
.btn--marque {
  background: var(--marque-fond);
  color: var(--sur-marque);
}
.btn--marque:hover {
  background: var(--marque-fort);
}
:root[data-theme="dark"] .btn--marque:hover {
  background: #5d72ff;
}
.btn--second {
  background: var(--surface-2);
  color: var(--texte);
  border-color: var(--ligne);
}
.btn--second:hover {
  border-color: var(--ligne-forte);
}
.btn--fantome {
  background: transparent;
  color: var(--texte-doux);
}
.btn--fantome:hover {
  color: var(--texte);
  background: var(--surface-2);
}
.btn--danger {
  background: var(--danger);
  color: #fff;
}
.btn--danger-fantome {
  background: transparent;
  color: var(--danger);
}
.btn--danger-fantome:hover {
  background: var(--danger-doux);
}
.btn--petit {
  min-height: 36px;
  padding: 0 12px;
  font-size: var(--t-s);
  border-radius: var(--r-s);
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn-ico {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--texte-doux);
}
.btn-ico:hover {
  background: var(--surface-2);
  color: var(--texte);
}
.lien {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  padding: 0;
  color: var(--marque);
  font-weight: 650;
  font-size: var(--t-s);
  text-decoration: none;
}
.lien .ico {
  width: 16px;
  height: 16px;
}
.lien:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rangee-btn {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ---------- pastilles ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--texte-doux);
  font-size: var(--t-xs);
  font-weight: 650;
  white-space: nowrap;
}
.chip--ok,
.chip--vert {
  background: var(--ok-doux);
  color: var(--ok);
}
.chip--orange,
.chip--warn {
  background: var(--warn-doux);
  color: var(--warn);
}
.chip--danger,
.chip--rouge,
.chip--crame {
  background: var(--danger-doux);
  color: var(--danger);
}
.chip--marque,
.chip--objectif {
  background: var(--marque-doux);
  color: var(--marque);
}
.chip--pause {
  background: var(--surface-2);
  color: var(--texte-doux);
}

/* ---------- logo ---------- */
.logo-marque {
  width: 32px;
  height: 32px;
  flex: none;
}
.marque {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--texte);
}
.marque-nom {
  font-family: var(--f-titre);
  font-weight: 750;
  font-size: 1.06rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.marque-nom em {
  font-style: normal;
  color: var(--marque);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
