/* Design « Autopips », étape 2 : chargé après theme.css.
   Plus épuré : fond presque noir avec une seule grande lueur qui suit l'état du bot, surfaces douces sans cadre,
   beaucoup d'air, phrase d'état en grand, navigation à 3 onglets. Retour à l'étape 1 : retirer ce fichier de
   index.html (étiquette git « design-etape-1 »). */

:root {
  --bg: #040405;
  --soft: rgba(255, 255, 255, 0.045);
  --soft-2: rgba(255, 255, 255, 0.075);
  --r-lg: 28px;
  --mood: 212, 255, 58; /* vert citron : tout roule */
  --mood-2: 140, 230, 60;
}
body[data-mood="off"] {
  --mood: 150, 156, 146;
  --mood-2: 80, 86, 78;
}
body[data-mood="ko"] {
  --mood: 255, 93, 74;
  --mood-2: 255, 150, 60;
}

/* ------------------------------------------------------------------ fond : une seule lueur, plus de grille */
html {
  background: var(--bg);
}
body::before {
  inset: 0;
  background:
    radial-gradient(70% 46% at 50% 30%, rgba(var(--mood-2), 0.34), transparent 70%),
    radial-gradient(40% 26% at 50% 34%, rgba(var(--mood), 0.2), transparent 70%),
    linear-gradient(180deg, #060708 0%, #040405 60%);
  animation: breathe 9s ease-in-out infinite alternate;
  transition: background 900ms var(--ease);
}
body::after {
  display: none;
}
@keyframes breathe {
  from {
    transform: scale(1);
    opacity: 0.85;
  }
  to {
    transform: scale(1.12);
    opacity: 1;
  }
}
canvas.fx {
  opacity: 0.35;
}

/* ------------------------------------------------------------------ surfaces douces, sans cadre */
.card,
.tl-b,
.shield,
.radar-row,
.kpi,
.tile {
  border: 0;
  background: var(--soft);
  box-shadow: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.card::before {
  display: none;
}
.card {
  padding: 20px;
}
.card.flat {
  background: transparent;
  padding: 0;
  margin-top: 18px;
}
.card.tap:hover {
  background: var(--soft-2);
  box-shadow: none;
}
.tl-i.trade .tl-b,
.tl-i.error .tl-b,
.tl-i.alert .tl-b {
  box-shadow: inset 3px 0 0 var(--c);
}
.tl::before {
  opacity: 0.35;
}
.btn {
  border-color: transparent;
  background: var(--soft-2);
  min-height: 50px;
}
.btn.sm {
  min-height: 44px;
}
.btn.danger {
  border-color: transparent;
  background: rgba(255, 93, 74, 0.14);
}
.segmented {
  border: 0;
  background: rgba(255, 255, 255, 0.05);
  padding: 5px;
}
.input {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.06);
}
.badge.info {
  border: 0;
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-2);
}
.topbar {
  background: linear-gradient(180deg, rgba(4, 4, 5, 0.94) 0%, rgba(4, 4, 5, 0.6) 70%, transparent 100%);
}

/* ------------------------------------------------------------------ accueil : la phrase d'abord */
.home {
  gap: 26px;
}
.pulse {
  display: none; /* l'état est dit en grand juste dessous */
}
.say {
  text-align: center;
  padding-top: 18px;
}
.say-t {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 10.5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  background: linear-gradient(180deg, #fff 30%, rgba(var(--mood), 0.95) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.say-s {
  margin: 12px auto 0;
  max-width: 32ch;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}
.say-s b {
  color: var(--text);
  font-weight: 650;
}
.core {
  padding: 0;
  gap: 0;
}
.core-ring {
  width: 236px;
  height: 236px;
  margin-bottom: 4px;
}
.core .power {
  width: 150px;
  height: 150px;
}
.core-h {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted-2);
}
body[data-mood="ko"] .core.on .core-ring::after {
  border-color: rgba(255, 93, 74, 0.45);
  box-shadow: 0 0 60px rgba(255, 93, 74, 0.3);
}

/* trois chiffres, une ligne */
.trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-radius: var(--r-lg);
  background: var(--soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.trio-c {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 18px 4px 16px;
  min-width: 0;
}
.trio-c + .trio-c {
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.07);
}
.trio-c b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.82rem, 4.1vw, 1.05rem);
  letter-spacing: -0.035em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.trio-c b.pos {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.trio-c small {
  font-size: 0.66rem;
  color: var(--muted-2);
  white-space: nowrap;
}
.trio-c .eyebrow {
  font-size: 0.58rem;
  letter-spacing: 0.14em;
}
.curve {
  margin: -8px calc(-1 * var(--s-4)) -6px;
}
.curve .hchart {
  height: 120px;
  margin: 0;
}
.curve .hchart.idle {
  height: 74px;
}
.shield-h b {
  font-size: 0.92rem;
}
.pcard {
  border: 0;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(212, 255, 58, 0.16), transparent 60%),
    var(--soft-2);
  box-shadow: none;
}
.pcard.down {
  border: 0;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 93, 74, 0.16), transparent 60%),
    var(--soft-2);
}

/* ------------------------------------------------------------------ barre d'onglets : 3 icônes, le nom seulement sur l'onglet actif */
.tabbar {
  /* centrée par les marges, sans « transform » : sur iPhone, une barre fixe déplacée par transform se décroche en défilant */
  left: 0;
  right: 0;
  margin-inline: auto;
  width: min(340px, calc(100% - 32px));
  padding: 7px;
  border: 0;
  border-radius: 999px;
  background: rgba(22, 25, 29, 0.72);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}
.tabbar nav {
  gap: 4px;
}
.tabbar a {
  flex: 0 0 56px;
  flex-direction: row;
  gap: 8px;
  min-height: 50px;
  border-radius: 999px;
  font-size: 0;
  transition: flex-basis 380ms var(--ease), background var(--t-med) var(--ease), color var(--t-med) var(--ease);
}
.tabbar a[aria-current="page"] {
  flex: 1 1 auto;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold-ink);
  background: var(--grad);
  box-shadow: 0 8px 26px rgba(212, 255, 58, 0.35);
}
.tabbar a[aria-current="page"] svg {
  color: var(--gold-ink);
  filter: none;
  transform: none;
}
.tabbar a[aria-current="page"]::after {
  display: none;
}

/* ------------------------------------------------------------------ réglages : 3 groupes numérotés */
.grp {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 2px 4px;
}
.grp:first-of-type {
  margin-top: 4px;
}
.grp-n {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--gold-ink);
  background: var(--grad);
  box-shadow: 0 0 24px rgba(212, 255, 58, 0.4);
}
.grp-t {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}
.grp-s {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.view > .card,
.view > .navrow,
.view > details {
  margin-top: 12px;
}
.card > .label:first-child::before {
  display: none;
}
.card > .label:first-child {
  color: var(--muted-2);
}
details.advanced {
  margin-top: 26px;
  background: transparent;
  padding: 0;
}
details.advanced > summary {
  padding: 18px 20px;
  border-radius: var(--r-lg);
  background: var(--soft);
  color: var(--muted);
}

/* ------------------------------------------------------------------ parcours d'arrivée : 4 étapes */
.steps {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 0 0 22px;
  padding: 0;
  font-size: 0.66rem;
  font-weight: 650;
  color: var(--muted-2);
}
.steps li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}
.steps i {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 0.62rem;
  background: rgba(255, 255, 255, 0.1);
}
.steps li.cur {
  color: var(--gold-ink);
  background: var(--grad);
}
.steps li.cur i {
  background: rgba(11, 13, 4, 0.25);
}
.steps li.done {
  color: var(--text-2);
}
.steps li.done i {
  background: rgba(198, 255, 58, 0.25);
  color: var(--green);
}
.steps li:not(.cur) {
  font-size: 0;
  padding: 5px;
  gap: 0;
}
.steps li:not(.cur) i {
  font-size: 0.62rem;
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none !important;
  }
}

/* ==================================================================== ACCESSIBILITÉ : WCAG 2.2 niveau AA
   Mesures du 11/11 : seuls ces points étaient sous les seuils (texte 4,5:1, éléments d'interface 3:1). */
:root {
  /* encre foncée sur le dégradé : 4,1:1 côté bleu -> 5,3:1 (bleu à peine plus clair) */
  --grad: linear-gradient(100deg, #8ce63c 0%, #d4ff3a 100%);
}
html {
  /* 2.4.11 : un élément qui reçoit le focus n'est jamais caché sous l'en-tête ni sous la barre d'onglets */
  scroll-padding-top: 84px;
  scroll-padding-bottom: 116px;
}
.mention {
  color: rgba(160, 166, 156, 0.92); /* 4,3:1 -> 6:1 */
}
.input::placeholder {
  color: var(--muted-2); /* 4,1:1 -> 6,5:1 */
  opacity: 1;
}
/* contour des champs et des interrupteurs : 3:1 avec le fond (1.4.11) */
.input,
.switch,
.check input {
  border: 1px solid rgba(160, 166, 156, 0.58);
}
.input:focus {
  border-color: var(--cyan);
}
.switch:checked {
  border-color: transparent;
}
.pin-dots span {
  border-color: rgba(160, 166, 156, 0.66);
}
.segmented {
  box-shadow: inset 0 0 0 1px rgba(160, 166, 156, 0.34);
}
:focus-visible {
  outline: 3px solid #ecff9e; /* 15:1 sur le fond */
  outline-offset: 3px;
}
.btn.primary:focus-visible,
.tabbar a[aria-current="page"]:focus-visible,
.segmented button[aria-pressed="true"]:focus-visible {
  outline-color: #fff;
}
/* 2.5.8 : cible d'au moins 24 px, même pour les petits boutons */
.btn.sm,
.chip,
.lnk,
.segmented button {
  min-height: 44px;
}

/* Courbe en attente (aucun trade clôturé) : l'onde au-dessus, la phrase en dessous, jamais l'une sur l'autre */
.curve .hchart.idle {
  display: grid;
  gap: 12px;
  height: auto;
  padding-bottom: 8px;
}
.curve .hchart.idle svg {
  height: 44px;
}
.curve .hchart.idle .hchart-t {
  position: static;
  padding: 0 var(--s-4);
}

/* Proposition d'activer les notifications, sur l'accueil */
.banner.push-ask {
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.push-btns {
  display: flex;
  gap: 8px;
  flex: none;
}

/* Raccourcis : réglage mis en évidence, bouton dans le fil, partage du bilan */
.flash {
  border-radius: 14px;
  animation: flash 1.05s ease-in-out 3;
}
@keyframes flash {
  50% {
    background: rgba(212, 255, 58, 0.14);
    box-shadow: 0 0 0 6px rgba(212, 255, 58, 0.14);
  }
}
.tl-fix {
  margin-top: 10px;
}
.share-btn {
  margin-top: 16px;
}

/* Lancement : le logo qui respire, une barre qui file */
.splash {
  min-height: 72dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 28px;
}
.splash-logo {
  font-size: 3rem;
  animation: splash 1.6s ease-in-out infinite;
}
.splash-bar {
  width: 120px;
  height: 3px;
  border-radius: 2px;
  background: var(--line-2);
  overflow: hidden;
}
.splash-bar i {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 2px;
  background: var(--grad);
  animation: splashbar 1.1s ease-in-out infinite;
}
@keyframes splash {
  50% {
    transform: scale(1.06);
    filter: drop-shadow(0 0 22px rgba(212, 255, 58, 0.7));
  }
}
@keyframes splashbar {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(280%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .splash-logo,
  .splash-bar i {
    animation: none;
  }
}

/* Synchronisation en cours : état calme, sans couleur d'alarme */
.pulse.wait i {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(212, 255, 58, 0.7);
  animation: dot 1.6s ease-in-out infinite;
}

/* Nouvelle version disponible : bandeau discret en haut */
.newver {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 18px;
  border-radius: 999px;
  background: rgba(16, 18, 21, 0.96);
  border: 1px solid rgba(212, 255, 58, 0.5);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 24px rgba(212, 255, 58, 0.25);
  font-weight: 700;
  font-size: 0.9rem;
  animation: newver 420ms var(--ease) both;
}
@keyframes newver {
  from {
    transform: translateY(-140%);
    opacity: 0;
  }
}

/* Répartition personnalisée entre les TP */
.split-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.split-p {
  display: flex;
  align-items: center;
  gap: 6px;
}
.split-p .input {
  width: 64px;
  text-align: center;
}
