/* Trading IA — «el marcador».
   Una sala de mercados de noche: tinta azul, cifras anchas, y cada competidor con su color
   (Claude ámbar, ChatGPT azul violeta, SPY gris). Verde y rojo solo para ganar o perder. */

@font-face {
  font-family: "Archivo";
  src: url("fuentes/archivo-wdth.woff2") format("woff2-variations"), url("fuentes/archivo-wdth.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --tinta: #0e1a2b;        /* fondo */
  --pizarra: #14243a;      /* superficies */
  --pizarra-alta: #1b2e47; /* superficie destacada, campos */
  --linea: #263c58;
  --niebla: #93a5bb;       /* texto secundario */
  --papel: #eef3f8;        /* texto */
  --claude: #f5a524;
  --chatgpt: #8c8cff;
  --spy: #7d8fa6;
  --sube: #45d483;
  --baja: #ff6b6b;
  --aviso: #ffcc66;
  --foco: #ffffff;
  --radio: 14px;
  --radio-peq: 8px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--tinta); color: var(--papel);
  font: 400 1rem/1.55 "Archivo", system-ui, sans-serif; font-stretch: 100%;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--linea); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--foco); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--chatgpt); color: var(--tinta); }

h1, h2, h3 { font-stretch: 112%; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.8em; }
.suave { color: var(--niebla); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.codigo { font-stretch: 112%; font-weight: 600; letter-spacing: 0.06em; color: var(--papel); word-break: break-all; }
.pequeno { font-size: 0.875rem; }

/* ---------- barra superior ---------- */
.barra {
  display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap;
  max-width: 1200px; margin: 0 auto; padding: 18px 20px;
}
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.marca-texto { font-stretch: 125%; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.marca-signo { display: inline-flex; gap: 3px; align-items: flex-end; height: 18px; }
.marca-signo i { display: block; width: 5px; border-radius: 2px; }
.marca-signo i:nth-child(1) { height: 10px; background: var(--spy); }
.marca-signo i:nth-child(2) { height: 18px; background: var(--claude); }
.marca-signo i:nth-child(3) { height: 14px; background: var(--chatgpt); }
.paper { font-size: 0.75rem; font-weight: 600; color: var(--aviso); border: 1px solid currentColor;
  border-radius: 999px; padding: 1px 8px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.nav a, .nav button {
  font: inherit; font-size: 0.95rem; color: var(--niebla); text-decoration: none; background: none; border: 0;
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
}
.nav a:hover, .nav button:hover { color: var(--papel); }
.nav a[aria-current="page"] { color: var(--papel); background: var(--pizarra-alta); }
.nav form { display: contents; }

main { max-width: 1200px; margin: 0 auto; padding: 8px 20px 64px; }
.cabecera { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin: 18px 0 22px; }
.cabecera p { margin: 6px 0 0; }
.volver { display: inline-block; color: var(--niebla); text-decoration: none; margin: 10px 0 0; font-size: 0.95rem; }
.volver:hover { color: var(--papel); }

/* ---------- superficies ---------- */
.panel { background: var(--pizarra); border: 1px solid var(--linea); border-radius: var(--radio); padding: 22px; }
.panel, .carrera, .rejilla, .entrada { margin-bottom: 18px; }
.rejilla > .panel { margin-bottom: 0; }
.rejilla { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.panel > h2 { margin-bottom: 14px; }
.panel-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- el marcador (lo memorable) ---------- */
.carrera { background: var(--pizarra); border: 1px solid var(--linea); border-radius: 20px; padding: 26px 26px 18px; }
.carrera-titulo { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--niebla);
  margin-bottom: 18px; }
.carrera-titulo strong { color: var(--papel); font-weight: 600; }
.marcador { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 28px; }
.competidor { border-top: 3px solid var(--color); padding-top: 12px; min-width: 0; }
.competidor.claude { --color: var(--claude); }
.competidor.chatgpt { --color: var(--chatgpt); }
.competidor.spy { --color: var(--spy); }
.competidor-nombre { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.competidor-cifra {
  display: block; font-stretch: 125%; font-weight: 800; letter-spacing: -0.035em; line-height: 1;
  font-size: clamp(2rem, 0.9rem + 3.2vw, 3.9rem); color: var(--color); margin: 10px 0 8px; white-space: nowrap;
}
.competidor.spy .competidor-cifra { color: var(--papel); opacity: 0.72; }
.competidor-dato { color: var(--niebla); font-size: 0.95rem; }
.competidor-sin { font-stretch: 125%; font-weight: 800; font-size: clamp(2rem, 0.9rem + 3.2vw, 3.9rem);
  line-height: 1; color: var(--linea); margin: 10px 0 8px; }

.grafica { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; margin-top: 26px; }
.grafica-eje { display: flex; flex-direction: column; justify-content: space-between; color: var(--niebla);
  font-size: 0.8rem; text-align: right; padding: 2px 0; }
.carrera-svg { display: block; width: 100%; height: clamp(180px, 28vw, 300px); overflow: visible; }
.carrera-svg .cero { stroke: var(--linea); stroke-width: 1; stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.carrera-svg .linea { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round;
  vector-effect: non-scaling-stroke; }
.carrera-svg .punto { stroke-width: 11; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.carrera-svg .claude { stroke: var(--claude); }
.carrera-svg .chatgpt { stroke: var(--chatgpt); }
.carrera-svg .spy { stroke: var(--spy); }
.carrera-svg .linea.spy { stroke-dasharray: 2 6; stroke-width: 2; }
.grafica-fechas { grid-column: 2; display: flex; justify-content: space-between; color: var(--niebla);
  font-size: 0.8rem; margin-top: 8px; }
.chispa svg { display: block; width: 160px; height: 40px; }
.chispa .linea { stroke-width: 1.6; }
.chispa .punto { stroke-width: 6; }

/* ---------- estados ---------- */
.estado { display: inline-flex; align-items: center; gap: 7px; font-size: 0.875rem; font-weight: 500; white-space: nowrap; }
.estado::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--niebla); flex: none; }
.estado.activo::before, .estado.ok::before { background: var(--sube); box-shadow: 0 0 0 4px rgb(69 212 131 / 0.16); }
.estado.pausa::before, .estado.pendiente::before { background: var(--aviso); }
.estado.espera::before { background: transparent; border: 2px solid var(--aviso); width: 6px; height: 6px; }
.estado.parado::before, .estado.error::before { background: var(--baja); }
.estado.desactivado { color: var(--niebla); }
.sube { color: var(--sube); }
.baja { color: var(--baja); }

.aviso { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radio-peq);
  background: rgb(255 204 102 / 0.08); border: 1px solid rgb(255 204 102 / 0.35); color: var(--papel); margin: 0 0 18px; }
.aviso.error { background: rgb(255 107 107 / 0.08); border-color: rgb(255 107 107 / 0.45); }
.aviso.ok { background: rgb(69 212 131 / 0.08); border-color: rgb(69 212 131 / 0.4); }
.aviso p { margin: 0; }

/* ---------- bots ---------- */
.bot { position: relative; overflow: hidden; }
.bot::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--color); }
.bot.claude { --color: var(--claude); }
.bot.chatgpt { --color: var(--chatgpt); }
.datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin: 4px 0 18px; }
.datos dt { color: var(--niebla); font-size: 0.85rem; }
.datos dd { margin: 2px 0 0; font-size: 1.2rem; font-weight: 600; font-stretch: 108%; }
.motivo { font-size: 0.925rem; color: var(--papel); background: rgb(255 107 107 / 0.08); border-radius: var(--radio-peq);
  padding: 10px 12px; margin: 0 0 16px; }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acciones form { display: contents; }

/* ---------- pasos para empezar ---------- */
.pasos { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.paso { display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: center; padding: 16px 4px;
  border-top: 1px solid var(--linea); }
.paso:first-child { border-top: 0; }
.paso-num { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  border: 2px solid var(--linea); font-weight: 700; font-stretch: 112%; color: var(--niebla); }
.paso.hecho .paso-num { border-color: var(--sube); background: var(--sube); color: var(--tinta); }
.paso.siguiente .paso-num { border-color: var(--claude); color: var(--claude); }
.paso h3 { margin-bottom: 2px; }
.paso p { margin: 0; color: var(--niebla); font-size: 0.95rem; }
.paso.hecho h3 { color: var(--niebla); text-decoration: line-through; text-decoration-color: var(--linea); }

/* ---------- formularios ---------- */
label { display: block; font-weight: 500; margin: 0 0 16px; }
.ayuda { display: block; color: var(--niebla); font-weight: 400; font-size: 0.85rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 13px; font: inherit; font-weight: 400; color: var(--papel);
  background: var(--tinta); border: 1px solid var(--linea); border-radius: var(--radio-peq);
}
input::placeholder { color: var(--niebla); opacity: 0.7; }
input:hover, textarea:hover { border-color: #35506f; }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--chatgpt); outline-offset: 0; border-color: transparent; }
textarea { font-size: 0.9rem; line-height: 1.6; resize: vertical; min-height: 360px; }
.campos { display: grid; gap: 0 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { font-weight: 500; margin-bottom: 8px; }
.interruptores { display: flex; gap: 10px; flex-wrap: wrap; }
.interruptor { position: relative; margin: 0; }
.interruptor input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.interruptor span { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--linea); color: var(--niebla); font-weight: 600; }
.interruptor span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; }
.interruptor.claude { --color: var(--claude); }
.interruptor.chatgpt { --color: var(--chatgpt); }
.interruptor input:checked + span { color: var(--color); border-color: var(--color); }
.interruptor input:checked + span::before { background: var(--color); }
.interruptor input:focus-visible + span { outline: 2px solid var(--foco); outline-offset: 2px; }

.simbolos { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.simbolo { position: relative; margin: 0; }
.simbolo input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.simbolo span { display: inline-block; min-width: 64px; text-align: center; padding: 7px 12px; border-radius: var(--radio-peq);
  border: 1px solid var(--linea); color: var(--niebla); font-weight: 600; font-stretch: 112%; font-size: 0.9rem; }
.simbolo input:checked + span { color: var(--papel); background: var(--pizarra-alta); border-color: #3c5878; }
.simbolo input:focus-visible + span { outline: 2px solid var(--foco); outline-offset: 2px; }

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; min-height: 44px;
  border-radius: 999px; border: 1px solid transparent; background: var(--papel); color: var(--tinta);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.boton:hover { background: #ffffff; }
.boton.secundario { background: transparent; color: var(--papel); border-color: var(--linea); }
.boton.secundario:hover { border-color: var(--niebla); }
.boton.peligro { background: var(--baja); color: var(--tinta); }
.boton.ancho { width: 100%; }
.enlace { background: none; border: 0; padding: 0; font: inherit; color: var(--niebla); cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px; }

details.zona-peligro { margin-top: 16px; border-top: 1px solid var(--linea); padding-top: 12px; }
details summary { cursor: pointer; color: var(--niebla); font-size: 0.925rem; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: " +"; }
details[open] summary::after { content: " −"; }
details[open] summary { margin-bottom: 12px; }
details summary:hover { color: var(--papel); }

/* ---------- conexiones ---------- */
.conexion { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: start; }
.conexion + .conexion { border-top: 1px solid var(--linea); margin-top: 18px; padding-top: 18px; }
.conexion-cuerpo { grid-column: 1 / -1; }
.enlace-grande { display: block; word-break: break-all; padding: 12px 14px; border-radius: var(--radio-peq);
  background: var(--tinta); border: 1px solid var(--linea); color: var(--chatgpt); font-size: 0.875rem; margin: 8px 0 14px; }
.codigo-grande { display: inline-block; font-stretch: 125%; font-weight: 800; font-size: 2rem; letter-spacing: 0.04em;
  color: var(--papel); padding: 6px 0; user-select: all; }
.fila-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.fila-form label { flex: 1 1 260px; margin: 0; }
.cuenta-alpaca { border: 1px solid var(--linea); border-radius: var(--radio-peq); padding: 16px 16px 4px; position: relative; }
.cuenta-alpaca::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: var(--color); }
.cuenta-alpaca.claude { --color: var(--claude); }
.cuenta-alpaca.chatgpt { --color: var(--chatgpt); }
.cuenta-alpaca .panel-cabeza { margin-bottom: 10px; }

/* ---------- tablas ---------- */
.tabla { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th { text-align: left; font-weight: 500; color: var(--niebla); font-size: 0.85rem; padding: 0 12px 10px; white-space: nowrap; }
td { padding: 14px 12px; border-top: 1px solid var(--linea); vertical-align: middle; }
td.num, th.num { text-align: right; white-space: nowrap; }
.posicion { font-stretch: 125%; font-weight: 800; font-size: 1.2rem; color: var(--niebla); width: 1%; }
tr:first-child .posicion { color: var(--claude); }

.actividad { list-style: none; margin: 0; padding: 0; }
.actividad li { display: grid; grid-template-columns: 110px 1fr auto; gap: 4px 16px; padding: 12px 0;
  border-top: 1px solid var(--linea); align-items: baseline; }
.actividad li:first-child { border-top: 0; }
.actividad time { color: var(--niebla); font-size: 0.875rem; }
.actividad .detalle { grid-column: 2 / -1; color: var(--niebla); font-size: 0.875rem; }

/* ---------- diario ---------- */
.entrada { background: var(--pizarra); border: 1px solid var(--linea); border-radius: var(--radio); padding: 20px 22px; }
.entrada h2 { font-size: 1rem; font-stretch: 100%; font-weight: 600; color: var(--niebla); margin-bottom: 10px; }
.verificado { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 16px 0 0; padding: 12px 14px; border-radius: var(--radio-peq);
  background: var(--tinta); border: 1px solid var(--linea); font-size: 0.875rem; color: var(--niebla); }
.verificado dd { margin: 0; }
.verificado div:first-child dd { color: var(--papel); font-weight: 600; }
.entrada pre { white-space: pre-wrap; word-break: break-word; margin: 0; font: inherit; font-size: 0.95rem; line-height: 1.65;
  max-width: 78ch; }

/* ---------- acceso (login, alta del superadmin) ---------- */
.acceso { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.acceso-arte { position: relative; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: var(--pizarra); border-right: 1px solid var(--linea); overflow: hidden; }
.acceso-arte h1 { font-stretch: 125%; font-weight: 800; font-size: clamp(2.4rem, 1.4rem + 3.4vw, 4.4rem);
  letter-spacing: -0.035em; line-height: 0.98; max-width: 11ch; }
.acceso-arte p { color: var(--niebla); max-width: 40ch; margin-top: 18px; font-size: 1.05rem; }
.acceso-arte svg { display: block; width: calc(100% + 96px); margin: 28px -48px 24px; height: 220px; flex: none; }
.acceso-arte > div { margin-top: auto; }
.acceso-arte .arte-linea { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.acceso-arte .arte-claude { stroke: var(--claude); }
.acceso-arte .arte-chatgpt { stroke: var(--chatgpt); }
.acceso-arte .arte-spy { stroke: var(--spy); stroke-dasharray: 2 7; stroke-width: 2; }
.acceso-arte .leyenda { position: relative; display: flex; gap: 18px; color: var(--niebla); font-size: 0.9rem; flex-wrap: wrap; }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.leyenda .claude { background: var(--claude); }
.leyenda .chatgpt { background: var(--chatgpt); }
.leyenda .spy { background: var(--spy); }
.acceso-form { display: flex; align-items: center; justify-content: center; padding: 48px 28px; }
.acceso-form > div { width: 100%; max-width: 380px; }
.acceso-form h2 { font-size: 1.6rem; margin-bottom: 6px; }
.acceso-form .suave { margin-bottom: 26px; }

.caja { max-width: 520px; margin: 40px auto; }
.caja h1 { font-size: 1.7rem; margin-bottom: 10px; }
.caja .fila-form, .caja form { margin-bottom: 18px; }
.codigo-temporal { font-stretch: 125%; font-weight: 800; font-size: 1.7rem; letter-spacing: 0.02em; text-align: center;
  padding: 18px; margin: 16px 0 20px; border-radius: var(--radio-peq); border: 1px dashed var(--claude); user-select: all;
  word-break: break-all; }
.qr { background: #fff; border-radius: var(--radio-peq); padding: 12px; width: max-content; margin: 18px 0; }
.qr svg { display: block; width: 200px; height: auto; }
ol.instrucciones { padding-left: 20px; color: var(--niebla); }
ol.instrucciones li { margin-bottom: 6px; }

/* ---------- móvil ---------- */
@media (max-width: 760px) {
  .barra { padding: 14px 16px; }
  main { padding: 4px 16px 48px; }
  .panel { padding: 18px 16px; }
  .marcador { grid-template-columns: 1fr; gap: 18px; }
  .competidor { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 12px; }
  .competidor-cifra, .competidor-sin { grid-column: 2; grid-row: 1 / span 2; margin: 0; font-size: 2.3rem; }
  .carrera { padding: 20px 16px 14px; border-radius: 16px; }
  .acceso { grid-template-columns: 1fr; }
  .acceso-arte { min-height: 300px; padding: 28px 22px; border-right: 0; border-bottom: 1px solid var(--linea); }
  .acceso-arte svg { width: calc(100% + 44px); margin: 18px -22px; height: 140px; }
  .paso { grid-template-columns: 40px 1fr; }
  .paso .boton { grid-column: 2; justify-self: start; }
  .actividad li { grid-template-columns: 1fr auto; }
  .actividad time { grid-column: 1 / -1; }
  .actividad .detalle { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: no-preference) {
  .carrera-svg .linea { stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: trazar 1.4s cubic-bezier(.3, .7, .2, 1) forwards; }
  .carrera-svg .linea.chatgpt { animation-delay: 0.12s; }
  .carrera-svg .linea.spy { stroke-dasharray: 2 6; stroke-dashoffset: 0; animation: aparecer 0.9s ease-out both; }
  .carrera-svg .punto { animation: aparecer 0.4s 1.2s ease-out both; }
}
@keyframes trazar { to { stroke-dashoffset: 0; } }
@keyframes aparecer { from { opacity: 0; } }
