/* flow. — sistema de diseño compartido (login + panel + asistente + gráficas).
   Tono principal NEGRO. Verde/rojo solo para mercado (ganancia/pérdida). Violeta→azul de la marca para IA y acentos. */
:root {
  color-scheme: dark;
  --bg: #04060A;
  --bg-2: #070A10;
  --surface: #0B1017;
  --surface-2: #101822;
  --surface-3: #16212D;
  --line: #1A2431;
  --line-2: #243142;
  --ink: #EAF0F7;
  --ink-2: #B4C0CE;
  --muted: #7A8898;
  --gain: #19E58C;
  --gain-soft: rgba(25, 229, 140, 0.12);
  --gain-line: rgba(25, 229, 140, 0.35);
  --loss: #FF4D62;
  --loss-soft: rgba(255, 77, 98, 0.12);
  --loss-line: rgba(255, 77, 98, 0.35);
  --warn: #FFB547;
  --warn-soft: rgba(255, 181, 71, 0.12);
  --violet: #8B7FF5;
  --blue: #6EA8FE;
  --ai: linear-gradient(135deg, #8B7FF5 0%, #6EA8FE 100%);
  --ai-soft: rgba(139, 127, 245, 0.14);
  --ai-line: rgba(139, 127, 245, 0.4);
  --glow-gain: 0 0 24px rgba(25, 229, 140, 0.25);
  --glow-loss: 0 0 24px rgba(255, 77, 98, 0.25);
  --glow-ai: 0 0 28px rgba(139, 127, 245, 0.35);
  --radius: 14px;
  --radius-sm: 9px;
  --font-brand: "MuseoModerno", system-ui, sans-serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --z-sticky: 20; --z-drawer: 40; --z-tooltip: 60;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 14.5px; line-height: 1.5; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-brand); font-weight: 600; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
.gain { color: var(--gain); } .loss { color: var(--loss); } .muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: rgba(139, 127, 245, 0.4); }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ---------- botones: hover con color, press con hundido, seleccionado con color y brillo ---------- */
.btn {
  --b-bg: var(--surface-2); --b-ink: var(--ink-2); --b-line: var(--line-2);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 0.86rem; min-height: 36px; padding: 7px 14px; cursor: pointer;
  color: var(--b-ink); background: var(--b-bg); border: 1px solid var(--b-line); border-radius: var(--radius-sm);
  text-decoration: none; overflow: hidden; isolation: isolate;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease),
              box-shadow 220ms var(--ease), transform 140ms var(--ease);
}
.btn::after { /* barrido de luz al pasar el cursor */
  content: ""; position: absolute; inset: 0; z-index: -1; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.10) 50%, transparent 80%);
  transition: transform 520ms var(--ease);
}
.btn:hover { --b-bg: var(--surface-3); --b-ink: var(--ink); --b-line: var(--violet); box-shadow: 0 0 0 3px rgba(139, 127, 245, 0.12); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: translateY(1px) scale(0.985); }
.btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.btn[aria-pressed="true"], .btn.is-active { --b-bg: var(--ai-soft); --b-ink: #fff; --b-line: var(--violet); box-shadow: var(--glow-ai); }
.btn-primary { --b-bg: #6E5FF0; --b-ink: #fff; --b-line: transparent; background-image: var(--ai); }
.btn-primary:hover { --b-line: transparent; filter: brightness(1.12); box-shadow: var(--glow-ai); }
.btn-gain { --b-bg: var(--gain-soft); --b-ink: var(--gain); --b-line: var(--gain-line); }
.btn-gain:hover { --b-bg: var(--gain); --b-ink: #02110A; --b-line: var(--gain); box-shadow: var(--glow-gain); }
.btn-loss { --b-bg: var(--loss-soft); --b-ink: var(--loss); --b-line: var(--loss-line); }
.btn-loss:hover { --b-bg: var(--loss); --b-ink: #1A0207; --b-line: var(--loss); box-shadow: var(--glow-loss); }
.btn-ghost { --b-bg: transparent; --b-line: transparent; }
.btn-ghost:hover { --b-bg: var(--surface-2); --b-line: var(--line-2); box-shadow: none; }

/* segmentado (rangos, filtros) */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--muted); background: transparent; border: 0; border-radius: 999px; padding: 6px 13px; min-height: 30px; cursor: pointer;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), box-shadow 220ms var(--ease), transform 120ms var(--ease); }
.seg button:hover { color: var(--ink); background: var(--surface-3); }
.seg button:active { transform: scale(0.96); }
.seg button[aria-pressed="true"] { color: #fff; background: var(--ai); box-shadow: var(--glow-ai); }
.seg button:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.pill.long { background: var(--gain-soft); color: var(--gain); border: 1px solid var(--gain-line); }
.pill.short { background: var(--loss-soft); color: var(--loss); border: 1px solid var(--loss-line); }
.pill.ai { background: var(--ai-soft); color: #C9C2FF; border: 1px solid var(--ai-line); }
.pill.neutral { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-2); }

.card { background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%); border: 1px solid var(--line); border-radius: var(--radius); }

@keyframes flow-pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes flow-fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes flow-shimmer { to { background-position: -200% 0; } }
.fade-up { animation: flow-fade-up 420ms var(--ease) both; }

/* logo de flow.: los colores se mueven siempre (barrido suave de ida y vuelta) */
@keyframes flow-logo-sweep { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes flow-logo-glow { from { box-shadow: 0 0 18px rgba(139, 127, 245, 0.55); } 50% { box-shadow: 0 0 22px rgba(61, 220, 255, 0.5); } to { box-shadow: 0 0 20px rgba(199, 125, 255, 0.55); } }
.logo-anim {
  background: linear-gradient(115deg, #8B7FF5 0%, #6EA8FE 22%, #3DDCFF 42%, #19E58C 58%, #6EA8FE 74%, #C77DFF 100%);
  background-size: 260% 100%; animation: flow-logo-sweep 4.5s ease-in-out infinite alternate, flow-logo-glow 6s ease-in-out infinite alternate;
}
html[data-lite] .logo-anim { animation-duration: 4.5s, 6s !important; }

html[data-lite] *, html[data-lite] *::before, html[data-lite] *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; scroll-behavior: auto !important; } }
