/* ================================================================
   AURA SCALPER IA - espace client PWA
   ----------------------------------------------------------------
   Marque : or #D4AF37 / noir #0D0D0D / blanc #FFFFFF, police Exo 2.

   Le doré de marque #D4AF37 est un ton d'INTERFACE (texte, bordures,
   icones) : 8.6:1 sur la surface, largement au-dessus du seuil.
   Il est en revanche trop clair pour servir de trace de graphique —
   il sort de la bande de luminosite du mode sombre. La courbe
   d'equity utilise donc son cran validé #B08A25, qui passe les six
   controles (bande L, chroma, separation daltonisme protan/tritan,
   plancher vision normale, contraste >= 3:1 sur la surface).
   Ne pas remplacer --series-1 par --gold sans repasser le validateur.
   ================================================================ */
:root {
  color-scheme: dark;

  --plane:        #0d0d0d;
  --surface-1:    #14161c;
  --surface-2:    #1a1d25;
  --surface-3:    #21252f;

  --text-primary:   #ffffff;
  --text-secondary: #a8afbd;
  --text-muted:     #6c7482;

  --line:      #262b36;
  --grid:      #1f2430;

  --gold:      #D4AF37;   /* marque AURA - interface uniquement */
  --gold-hi:   #f0d071;
  --gold-dim:  #8a6c30;
  --amber:     #e8973a;   /* second ton du verre anime */

  --series-1:  #B08A25;   /* equity  - cran valide du dore de marque */
  --series-2:  #3987e5;   /* balance - inchange, deja valide */

  --good:      #0ca30c;
  --good-ink:  #35d35b;
  --warning:   #fab219;
  --critical:  #d03b3b;
  --crit-ink:  #ff6b6b;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;

  --font: "Exo 2", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

/* ================================================================
   VERRE ANIME — fond aurora + cartes en verre
   ----------------------------------------------------------------
   Cout maitrise : le flou lourd (backdrop-filter) n'est applique
   qu'aux quelques surfaces mises en avant. Les cartes courantes se
   contentent d'un fond translucide et d'un liseré, qui ne declenchent
   aucun recalcul de flou pendant le defilement.
   ================================================================ */
.aurora {
  position: fixed; inset: -20vmax; z-index: -1; pointer-events: none;
  overflow: hidden; contain: strict;
}
.aurora b {
  position: absolute; display: block; border-radius: 50%;
  filter: blur(70px); opacity: .40; will-change: transform;
}
.aurora b:nth-child(1) {
  width: 62vmax; height: 62vmax; left: -8vmax; top: -6vmax;
  background: radial-gradient(circle, #D4AF37 0%, rgba(212,175,55,0) 68%);
  animation: drift1 34s ease-in-out infinite alternate;
}
.aurora b:nth-child(2) {
  width: 48vmax; height: 48vmax; right: -10vmax; top: 18vmax;
  background: radial-gradient(circle, #e8973a 0%, rgba(232,151,58,0) 68%);
  animation: drift2 27s ease-in-out infinite alternate;
}
.aurora b:nth-child(3) {
  width: 54vmax; height: 54vmax; left: 12vmax; bottom: -18vmax;
  background: radial-gradient(circle, #f0d071 0%, rgba(240,208,113,0) 70%);
  animation: drift3 41s ease-in-out infinite alternate;
  opacity: .26;
}
@keyframes drift1 { from { transform: translate3d(0,0,0) scale(1); }
                    to   { transform: translate3d(9vmax,7vmax,0) scale(1.14); } }
@keyframes drift2 { from { transform: translate3d(0,0,0) scale(1.08); }
                    to   { transform: translate3d(-11vmax,10vmax,0) scale(.92); } }
@keyframes drift3 { from { transform: translate3d(0,0,0) scale(.95); }
                    to   { transform: translate3d(8vmax,-9vmax,0) scale(1.1); } }

/* liseré doré qui tourne autour des surfaces mises en avant */
@property --aura-turn { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes aura-spin { to { --aura-turn: 360deg; } }

.glass {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.012)),
    rgba(20,22,28,.72);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border: 1px solid rgba(212,175,55,.22);
  box-shadow:
    0 18px 46px rgba(0,0,0,.55),
    inset 0 1px 0 rgba(255,255,255,.10);
  overflow: hidden;
}
/* reflet qui balaie la surface, tres lentement */
.glass::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg,
    transparent 38%, rgba(255,255,255,.10) 48%,
    rgba(240,208,113,.14) 52%, transparent 62%);
  transform: translateX(-130%);
  animation: sheen 7.5s ease-in-out infinite;
}
@keyframes sheen {
  0%, 62% { transform: translateX(-130%); }
  100%    { transform: translateX(130%); }
}

/* bordure vivante : un dégradé conique qui tourne dans le liseré */
.glass-ring { position: relative; }
.glass-ring::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit;
  padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--aura-turn),
    rgba(212,175,55,0) 0deg, rgba(212,175,55,.85) 70deg,
    rgba(240,208,113,.95) 110deg, rgba(232,151,58,.5) 160deg,
    rgba(212,175,55,0) 240deg, rgba(212,175,55,0) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: aura-spin 6s linear infinite;
}

/* Accessibilite : plus aucune animation decorative si l'utilisateur
   a demande la reduction des animations au niveau du systeme. */
@media (prefers-reduced-motion: reduce) {
  .aurora b, .glass::after, .glass-ring::before { animation: none !important; }
  .glass::after { display: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  /* Le fond est porte par <html> UNIQUEMENT. Si <body> en avait un aussi,
     il serait peint dans sa propre boite APRES la couche z-index negatif,
     et masquerait completement le fond aurora. */
  background: var(--plane);
}

html, body {
  margin: 0; padding: 0;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}

body { min-height: 100dvh; background: transparent; }

button, input, select { font-family: inherit; font-size: inherit; }

.hidden { display: none !important; }

/* ---------------------------------------------------------- auth */
.auth-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 20px calc(28px + var(--safe-b));
  background: transparent;
}

.auth-card {
  width: 100%; max-width: 400px;
  border-radius: var(--r-lg);
  padding: 30px 24px 26px;
}

.brand { text-align: center; margin-bottom: 26px; }
.brand-mark {
  width: 62px; height: 62px; margin: 0 auto 14px;
  border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, rgba(212,175,55,.20), rgba(232,151,58,.08));
  border: 1px solid rgba(212,175,55,.38);
  box-shadow: 0 12px 30px rgba(212,175,55,.20), inset 0 1px 0 rgba(255,255,255,.14);
}
.brand-mark img.aura-logo { width: 44px; height: 44px; display: block; }
.brand h1 { margin: 0; font-size: 21px; letter-spacing: 5px; font-weight: 800; }
.brand h1 em {
  font-style: normal; font-weight: 500; letter-spacing: 2px;
  font-size: 12px; display: block; margin-top: 5px; color: var(--gold);
}
.brand p  { margin: 6px 0 0; font-size: 12.5px; color: var(--text-muted); letter-spacing: .4px; }

.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface-2); border-radius: 12px; margin-bottom: 20px;
}
.tabs button {
  flex: 1; padding: 9px 0; border: 0; border-radius: 9px;
  background: transparent; color: var(--text-secondary);
  font-weight: 600; font-size: 13.5px; cursor: pointer; transition: .15s;
}
.tabs button[aria-selected="true"] { background: var(--surface-3); color: var(--text-primary); }

.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 1.1px; color: var(--text-muted); margin-bottom: 7px; font-weight: 600;
}
.field input {
  width: 100%; padding: 13px 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; color: var(--text-primary); outline: none; transition: .15s;
}
.field input:focus { border-color: var(--gold-dim); background: var(--surface-3); }
.field .hint { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }

.btn {
  width: 100%; padding: 14px; border: 0; border-radius: 13px;
  font-weight: 700; font-size: 14.5px; cursor: pointer; transition: .15s;
}
.btn-primary {
  background: linear-gradient(150deg, var(--gold-hi), var(--gold) 55%, #b98c33);
  color: #0d0d0d;
  box-shadow: 0 8px 22px rgba(212,175,55,.28);
}
.btn-primary:active { transform: scale(.985); }
.btn-primary:disabled { opacity: .55; cursor: default; }
.btn-ghost { background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--line); }
.btn-danger { background: rgba(208,59,59,.14); color: var(--crit-ink); border: 1px solid rgba(208,59,59,.4); }

.msg { margin-top: 14px; font-size: 13px; padding: 11px 13px; border-radius: 11px; display: none; }
.msg.show { display: block; }
.msg.err  { background: rgba(208,59,59,.13); color: var(--crit-ink); border: 1px solid rgba(208,59,59,.3); }
.msg.ok   { background: rgba(12,163,12,.13); color: var(--good-ink); border: 1px solid rgba(12,163,12,.3); }

/* --------------------------------------------------------- shell */
.app { display: none; padding-bottom: calc(84px + var(--safe-b)); }
.app.show { display: block; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  padding: calc(14px + var(--safe-t)) 18px 13px;
  background: rgba(13,13,13,.80);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.topbar .mini {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  background: linear-gradient(150deg, rgba(212,175,55,.22), rgba(232,151,58,.08));
  border: 1px solid rgba(212,175,55,.34);
  display: grid; place-items: center;
}
.topbar .mini img.aura-logo { width: 26px; height: 26px; display: block; }
.topbar .who { flex: 1; min-width: 0; }
.topbar .who strong { display: block; font-size: 14px; }
.topbar .who span { font-size: 11.5px; color: var(--text-muted); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .6px;
  padding: 5px 10px; border-radius: 999px; text-transform: uppercase;
  border: 1px solid transparent; white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.live { color: var(--good-ink); background: rgba(12,163,12,.13); border-color: rgba(12,163,12,.32); }
.pill.warn { color: var(--warning); background: rgba(250,178,25,.12); border-color: rgba(250,178,25,.3); }
.pill.off  { color: var(--text-muted); background: var(--surface-2); border-color: var(--line); }
.pill.crit { color: var(--crit-ink); background: rgba(208,59,59,.13); border-color: rgba(208,59,59,.32); }

.view { padding: 16px 16px 8px; display: none; }
.view.show { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.008)),
    rgba(20,22,28,.80);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.055);
}
.card h2 {
  margin: 0 0 3px; font-size: 14px; font-weight: 700;
  letter-spacing: .2px; color: var(--text-primary);
}
.card .sub { margin: 0 0 14px; font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }

/* ------------------------------------------------------ hero P&L */
.hero { text-align: center; padding: 24px 16px 20px; border-radius: var(--r-lg); }
.hero .label, .hero .value, .hero .meta, .hero .hero-bar { position: relative; z-index: 1; }
.hero .label {
  font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
}
.hero .value { font-size: 40px; font-weight: 700; letter-spacing: -1.2px; margin: 8px 0 2px; }
.hero .value.up   { color: var(--good-ink); }
.hero .value.down { color: var(--crit-ink); }
.hero .meta { font-size: 12.5px; color: var(--text-secondary); }

.hero-bar { margin-top: 16px; }
.hero-bar .track {
  height: 7px; border-radius: 999px; background: var(--surface-3);
  overflow: hidden; display: flex;
}
.hero-bar .fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.hero-bar .legend {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-muted); margin-top: 7px;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------ stat grid */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.006)),
              rgba(20,22,28,.80);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--r-sm); padding: 13px 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.stat .k {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px;
  color: var(--text-muted); font-weight: 600;
}
.stat .v { font-size: 20px; font-weight: 700; margin-top: 5px; letter-spacing: -.4px; }
.stat .v.small { font-size: 16px; }

/* ---------------------------------------------------------- chart */
.chart-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 4px;
}
.legend-row { display: flex; gap: 14px; margin: 0 0 10px; }
.legend-row span {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-secondary);
}
.legend-row i { width: 10px; height: 2px; border-radius: 1px; display: inline-block; }

.chart { position: relative; width: 100%; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: auto; }
.tooltip {
  position: absolute; pointer-events: none; opacity: 0; transition: opacity .12s;
  background: var(--surface-3); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; font-size: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,.6); white-space: nowrap; z-index: 5;
}
.tooltip .t { color: var(--text-muted); font-size: 10.5px; margin-bottom: 4px; }
.tooltip .r { display: flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
.tooltip .r i { width: 8px; height: 8px; border-radius: 2px; }

.empty {
  text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: 13px;
}

/* -------------------------------------------------------- reglages */
.row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; padding-bottom: 0; }
.row .rl { min-width: 0; }
.row .rl strong { display: block; font-size: 14px; font-weight: 600; }
.row .rl span { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.switch { position: relative; width: 50px; height: 29px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .sl {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--line);
  border-radius: 999px; transition: .2s;
}
.switch .sl:before {
  content: ""; position: absolute; height: 21px; width: 21px; left: 3px; top: 3px;
  background: var(--text-secondary); border-radius: 50%; transition: .2s;
}
.switch input:checked + .sl { background: rgba(226,178,84,.28); border-color: var(--gold-dim); }
.switch input:checked + .sl:before { transform: translateX(21px); background: var(--gold); }
.switch input:focus-visible + .sl { outline: 2px solid var(--gold); outline-offset: 2px; }

.stepper { display: flex; align-items: center; gap: 8px; flex: none; }
.stepper button {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text-primary);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.stepper button:active { background: var(--surface-3); }
.stepper .num {
  min-width: 66px; text-align: center; font-weight: 700; font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.stepper .num em { font-style: normal; font-size: 11px; color: var(--text-muted); }

.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 11px; }
.seg button {
  flex: 1; padding: 8px 12px; border: 0; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--text-secondary); font-size: 13px; font-weight: 600;
}
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--gold); }

.modules { display: grid; gap: 9px; }
.module {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 13px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.module .tag {
  width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center;
  font-weight: 800; font-size: 12px; letter-spacing: .5px;
  background: var(--surface-3); color: var(--gold);
}
.module .mi { flex: 1; min-width: 0; }
.module .mi strong { display: block; font-size: 13.5px; }
.module .mi span { font-size: 11.5px; color: var(--text-muted); }

.kill-card { border-color: rgba(208,59,59,.35); background: rgba(208,59,59,.06); }

/* -------------------------------------------------------- historique */
.trade {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.trade:last-child { border-bottom: 0; }
.trade .badge {
  width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; letter-spacing: .4px;
}
.trade .badge.buy  { background: rgba(12,163,12,.13); color: var(--good-ink); }
.trade .badge.sell { background: rgba(208,59,59,.13); color: var(--crit-ink); }
.trade .ti { flex: 1; min-width: 0; }
.trade .ti strong { display: block; font-size: 13.5px; }
.trade .ti span { font-size: 11.5px; color: var(--text-muted); }
.trade .tp { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.trade .tp small { display: block; font-weight: 500; font-size: 11px; color: var(--text-muted); }
.up { color: var(--good-ink); } .down { color: var(--crit-ink); }

/* ------------------------------------------------------------- nav */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(13,13,13,.86);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-top: 1px solid var(--line);
  padding: 8px 6px calc(8px + var(--safe-b));
}
.nav button {
  border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--text-muted); font-size: 10.5px; font-weight: 600; padding: 5px 0;
}
.nav button svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.nav button[aria-current="page"] { color: var(--gold); }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(20px);
  bottom: calc(96px + var(--safe-b)); z-index: 60;
  background: var(--surface-3); border: 1px solid var(--line);
  color: var(--text-primary); padding: 11px 17px; border-radius: 12px;
  font-size: 13px; box-shadow: 0 14px 34px rgba(0,0,0,.6);
  opacity: 0; pointer-events: none; transition: .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(208,59,59,.5); color: var(--crit-ink); }

.tablebtn {
  background: none; border: 0; color: var(--text-muted); font-size: 11.5px;
  text-decoration: underline; cursor: pointer; padding: 0; margin-top: 10px;
}
table.data { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12px; }
table.data th, table.data td {
  text-align: right; padding: 6px 4px; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { color: var(--text-muted); font-weight: 600; font-size: 10.5px; text-transform: uppercase; }

@media (min-width: 720px) {
  .view { max-width: 720px; margin: 0 auto; }
  .topbar { max-width: 720px; margin: 0 auto; }
  .stats { grid-template-columns: repeat(4, 1fr); }
}

/* ================================================================
   ONBOARDING
   ================================================================ */
.onb {
  display: none;
  min-height: 100dvh;
  background: transparent;
  padding: calc(18px + var(--safe-t)) 16px calc(28px + var(--safe-b));
}
.onb.show { display: block; }
.onb-inner { max-width: 560px; margin: 0 auto; }

.onb-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; margin: 0; flex: none; }
.brand-mark.small img.aura-logo { width: 30px; height: 30px; }
.onb-head > div:nth-child(2) { flex: 1; min-width: 0; }
.onb-head strong { display: block; font-size: 16px; }
.onb-head span { font-size: 12px; color: var(--text-muted); }
.linkbtn {
  background: none; border: 0; color: var(--text-muted);
  font-size: 12.5px; text-decoration: underline; cursor: pointer; padding: 4px;
}

.stepline {
  list-style: none; display: flex; padding: 0; margin: 0 0 20px;
  counter-reset: s; gap: 6px;
}
.stepline li {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-muted); position: relative;
}
.stepline li i {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  font-style: normal; font-size: 12px; font-weight: 700; color: var(--text-muted);
  transition: .2s; z-index: 1;
}
.stepline li:not(:last-child):after {
  content: ""; position: absolute; top: 14px; left: 50%; right: -50%;
  height: 1px; background: var(--line);
}
.stepline li[data-state="active"] i {
  background: rgba(226,178,84,.16); border-color: var(--gold); color: var(--gold);
}
.stepline li[data-state="active"] { color: var(--gold); }
.stepline li[data-state="done"] i {
  background: rgba(12,163,12,.16); border-color: rgba(12,163,12,.5); color: var(--good-ink);
}
.stepline li i em { font-style: normal; }
.stepline li[data-state="done"] i:before { content: "✓"; font-size: 13px; }
.stepline li[data-state="done"] i em { display: none; }

.onb-step { animation: fade .25s ease; }
.onb-step .btn { margin-top: 4px; }

.kv {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.kv:last-child { border-bottom: 0; padding-bottom: 0; }
.kv span { color: var(--text-muted); }
.kv strong { font-variant-numeric: tabular-nums; }

.choice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 15px; margin-top: 11px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
  transition: .15s;
}
.choice:has(input:checked) { border-color: var(--gold-dim); background: var(--surface-3); }
.choice input { margin-top: 3px; accent-color: var(--gold); width: 17px; height: 17px; flex: none; }
.choice-body strong { display: block; font-size: 14.5px; margin-bottom: 4px; }
.choice-body span { display: block; font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.choice.off { opacity: .45; pointer-events: none; }
.tagline {
  font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .8px;
  padding: 2px 7px; border-radius: 999px; margin-left: 7px; vertical-align: 2px;
  background: var(--surface-3); color: var(--text-muted);
}
.tagline.gold { background: rgba(226,178,84,.16); color: var(--gold); }

.guide { display: grid; gap: 18px; }
.guide .g { display: flex; gap: 13px; }
.guide .g > i {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: var(--surface-3); color: var(--gold);
  display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 700;
}
.guide .g strong { display: block; font-size: 14px; margin-bottom: 4px; }
.guide .g span { display: block; font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; }
.guide .g b { color: var(--text-primary); font-weight: 600; }
.guide .g span.warn { color: var(--warning); margin-top: 6px; }

.copybox {
  display: flex; align-items: center; gap: 8px; margin: 9px 0 2px;
  background: var(--surface-3); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 10px;
}
.copybox code {
  flex: 1; min-width: 0; font-size: 12px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; color: var(--gold);
}
.copybox .copy {
  flex: none; border: 0; border-radius: 8px; padding: 6px 11px; cursor: pointer;
  background: var(--surface-1); color: var(--text-primary); font-size: 12px; font-weight: 600;
}

.waitcard { border-color: rgba(226,178,84,.28); }
.waitrow { display: flex; align-items: center; gap: 13px; }
.waitrow strong { display: block; font-size: 14px; }
.waitrow span { font-size: 12.5px; color: var(--text-muted); }
.wdot {
  width: 12px; height: 12px; border-radius: 50%; flex: none;
  background: var(--warning); box-shadow: 0 0 0 0 rgba(250,178,25,.5);
  animation: pulse 1.8s infinite;
}
.wdot.ok { background: var(--good-ink); animation: none; box-shadow: none; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(250,178,25,.45); }
  70%  { box-shadow: 0 0 0 12px rgba(250,178,25,0); }
  100% { box-shadow: 0 0 0 0 rgba(250,178,25,0); }
}

/* briefing IA sur le dashboard */
.brief {
  display: flex; gap: 12px; align-items: flex-start;
  border-color: rgba(226,178,84,.24);
  background: linear-gradient(180deg, rgba(226,178,84,.05), transparent);
}
.brief .ico {
  width: 32px; height: 32px; flex: none; border-radius: 10px;
  background: rgba(226,178,84,.14); color: var(--gold);
  display: grid; place-items: center; font-size: 14px;
}
.brief .bt { flex: 1; min-width: 0; }
.brief .bt strong {
  display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--gold); margin-bottom: 5px;
}
.brief .bt p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); }

/* bouton Telegram de l'installation assistee */
.btn-telegram {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px; border: 0; border-radius: 13px;
  background: linear-gradient(150deg, #38b0e3, #1d8ec4);
  color: #06212e; font-weight: 700; font-size: 14.5px;
  text-decoration: none; cursor: pointer; transition: .15s;
}
.btn-telegram:active { transform: scale(.985); }
.btn-telegram .tg-ico { font-size: 17px; }

/* origine du dernier changement de reglages */
.synbar {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; margin-bottom: 13px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; font-size: 12.5px; color: var(--text-secondary);
}
.synbar.hidden { display: none; }
.synbar.mt { border-color: var(--gold-dim); background: rgba(226,178,84,.07); }
.syn-ico {
  width: 22px; height: 22px; flex: none; border-radius: 7px;
  display: grid; place-items: center; font-size: 12px;
  background: var(--surface-3); color: var(--gold);
}

/* ================================================================
   MODE DE LOT — un seul actif, et ca doit se voir sans lire
   ----------------------------------------------------------------
   Avant, deux onglets segmentes laissaient un doute : on ne savait
   pas lequel des deux pilotait reellement le lot. Ici les deux
   valeurs restent visibles en permanence, mais une seule tuile est
   deverrouillee — cadenas ouvert, lisere dore, pastille EN VIGUEUR
   et boutons actifs. L'autre est cadenassee, grisee, et porte un
   bouton explicite pour la reprendre.

   La tuile est un <div> : imbriquer les boutons +/- dans un <button>
   est du HTML invalide et le navigateur casse la mise en page.
   ================================================================ */
.lotmode { display: grid; gap: 10px; margin-bottom: 4px; }
@media (min-width: 620px) { .lotmode { grid-template-columns: 1fr 1fr; } }

.lm {
  position: relative; padding: 14px 15px 13px; border-radius: 15px;
  background: rgba(26,29,37,.72);
  border: 1px solid rgba(255,255,255,.08);
  transition: border-color .2s, background .2s, opacity .2s, box-shadow .2s;
}
.lm-head { display: flex; align-items: center; gap: 9px; }
.lm-lock {
  width: 26px; height: 26px; flex: none; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-muted); transition: .2s;
}
.lm-lock svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.lm-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; }
.lm-flag {
  font-size: 9.5px; font-weight: 800; letter-spacing: .9px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--surface-3); color: var(--text-muted);
}
.lm-desc { margin: 7px 0 12px; font-size: 11.5px; color: var(--text-muted); line-height: 1.45; }
.lm-ctl { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lm-val { font-size: 24px; font-weight: 700; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.lm-val em { font-style: normal; font-size: 12px; color: var(--text-muted); margin-left: 4px; }
.lm .stepper { gap: 8px; }
.lm .stepper button { width: 36px; height: 36px; font-size: 19px; }

/* --- tuile ACTIVE : deverrouillee, c'est elle qui pilote le robot */
.lm[data-active="true"] {
  background: linear-gradient(180deg, rgba(212,175,55,.11), rgba(212,175,55,.02)),
              rgba(26,29,37,.88);
  border-color: rgba(212,175,55,.55);
  box-shadow: 0 0 0 1px rgba(212,175,55,.13), 0 10px 30px rgba(212,175,55,.12);
}
.lm[data-active="true"] .lm-lock { background: rgba(212,175,55,.18); color: var(--gold); }
.lm[data-active="true"] .lm-flag { background: rgba(212,175,55,.18); color: var(--gold); }
.lm[data-active="true"] .lm-val  { color: var(--gold); }
.lm[data-active="true"] .lm-switch { display: none; }

/* --- tuile INACTIVE : cadenassee, valeur visible mais non modifiable */
.lm[data-active="false"] { opacity: .55; cursor: pointer; }
.lm[data-active="false"]:hover { opacity: .8; border-color: rgba(212,175,55,.3); }
.lm[data-active="false"] .stepper { pointer-events: none; opacity: .45; }

.lm-switch {
  display: block; width: 100%; margin-top: 12px; padding: 9px 10px;
  border: 1px dashed rgba(212,175,55,.45); border-radius: 10px;
  background: rgba(212,175,55,.07); color: var(--gold);
  font-family: inherit; font-size: 11.5px; font-weight: 800;
  letter-spacing: .7px; text-transform: uppercase; cursor: pointer;
}
.lm-switch:hover { background: rgba(212,175,55,.14); }
.lm-switch:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* la ligne qui suit les tuiles ne doit pas sembler leur appartenir */
.lotmode + .row { border-top: 1px solid var(--line); margin-top: 4px; }

/* ------------------------------------------------------- logo AURA
   Le remplissage est un ATTRIBUT sur les <path> du <symbol>, pas une
   regle CSS : <use> instancie le symbole dans un arbre fantome que les
   selecteurs du document ne traversent pas. En CSS, le A restait noir. */
.aura-logo { display: block; }

/* ================================================================
   SELECTEUR DE COMPTE MT5
   ----------------------------------------------------------------
   Masque tant qu'il n'y a qu'un compte : un selecteur a un seul
   choix n'informe pas, il encombre.
   ================================================================ */
.accbar {
  position: sticky; top: 62px; z-index: 19;
  padding: 10px 16px 11px;
  background: rgba(13,13,13,.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.accbar-k {
  display: block; font-size: 9.5px; letter-spacing: 1.3px; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700; margin-bottom: 8px;
}
.acclist {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding-bottom: 2px;
}
.acclist::-webkit-scrollbar { display: none; }

.acc {
  flex: none; display: flex; align-items: center; gap: 9px;
  padding: 8px 13px 8px 10px; border-radius: 12px; cursor: pointer;
  background: rgba(26,29,37,.8); border: 1px solid rgba(255,255,255,.08);
  color: var(--text-primary); font: inherit; text-align: left;
  transition: border-color .18s, background .18s, transform .12s;
}
.acc:active { transform: scale(.98); }
.acc[aria-pressed="true"] {
  border-color: rgba(212,175,55,.55);
  background: linear-gradient(180deg, rgba(212,175,55,.12), rgba(212,175,55,.03)),
              rgba(26,29,37,.9);
  box-shadow: 0 6px 18px rgba(212,175,55,.14);
}
.acc-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.acc-dot.on  { background: var(--good-ink); box-shadow: 0 0 8px rgba(53,211,91,.6); }
.acc-dot.off { background: var(--text-muted); }
.acc-dot.blk { background: var(--crit-ink); }
.acc-t strong { display: block; font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.acc-t em {
  display: block; font-style: normal; font-size: 10.5px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.acc[aria-pressed="true"] .acc-t strong { color: var(--gold); }
.acc-flag {
  font-size: 9px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase;
  padding: 3px 7px; border-radius: 999px;
  background: rgba(208,59,59,.16); color: var(--crit-ink);
}

/* le moteur IA se distingue des moteurs mecaniques */
.module.ai { border-color: rgba(212,175,55,.3); background: rgba(212,175,55,.05); }
.module.ai .tag { color: var(--gold); background: rgba(212,175,55,.16); }

/* acces au serveur distant */
.vps {
  display: flex; align-items: center; gap: 12px; padding: 14px 15px;
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(212,175,55,.09), rgba(212,175,55,.02)),
              rgba(26,29,37,.8);
  border: 1px solid rgba(212,175,55,.32);
}
.vps-t { flex: 1; min-width: 0; }
.vps-t strong { display: block; font-size: 14px; }
.vps-t span {
  display: block; font-size: 12.5px; color: var(--gold);
  font-variant-numeric: tabular-nums; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vps-t em { display: block; font-style: normal; font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }

/* deux facons d'atteindre le VPS : dans le navigateur, ou par fichier .rdp */
.vps-actions { display: grid; gap: 8px; margin-top: 12px; }
@media (min-width: 560px) { .vps-actions { grid-template-columns: 1fr 1fr; } }

/* ================================================================
   MON INSTALLATION — le parcours, consultable a tout moment
   ================================================================ */
.setup { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.su {
  display: grid; grid-template-columns: auto 1fr; gap: 13px; align-items: start;
  padding: 15px 15px 13px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surf-2);
  transition: border-color .25s, background .25s;
}
.su.ok { border-color: rgba(12,163,12,.34); background: rgba(12,163,12,.06); }
.su-check { position: relative; display: block; width: 22px; height: 22px; cursor: pointer; }
.su-check input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.su-check span {
  display: block; width: 22px; height: 22px; border-radius: 7px;
  border: 1.5px solid rgba(255,255,255,.18); background: rgba(255,255,255,.04);
  transition: background .2s, border-color .2s;
}
.su-check span::after {
  content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0);
  transition: transform .18s cubic-bezier(.16,1,.3,1);
}
.su-check input:checked + span { background: #0ca30c; border-color: #0ca30c; }
.su-check input:checked + span::after { transform: rotate(45deg) scale(1); }
.su-check input:disabled + span { opacity: .55; cursor: default; }
.su-b strong { display: block; font-size: 14.5px; margin-bottom: 5px; }
.su-b p { margin: 0 0 8px; font-size: 13.3px; color: var(--text-muted); }
.su-b p:last-child { margin-bottom: 0; }
.su-b code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.3px;
  padding: 1px 5px; border-radius: 5px; background: rgba(255,255,255,.07);
}
