@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #0b1220;
  --surface: #131c31;
  --surface-2: #1b2740;
  --border: #263354;
  --text: #e8ecf4;
  --text-muted: #8894ac;
  --accent: #3d7cf0;
  --accent-hover: #2f65d1;
  --success: #34d399;
  --warning: #f5a623;
  --danger: #ef4444;
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
}

a { color: var(--accent); }

button {
  font-family: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-weight: 500;
  font-size: 14px;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); }

.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #d63b3b; }

input, select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  width: 100%;
}
input::placeholder { color: var(--text-muted); }

label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field { margin-bottom: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 100px;
  font-family: 'IBM Plex Mono', monospace;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; }

.badge-on { background: rgba(52,211,153,0.12); color: var(--success); }
.badge-on .badge-dot { background: var(--success); }

.badge-off { background: rgba(136,148,172,0.12); color: var(--text-muted); }
.badge-off .badge-dot { background: var(--text-muted); }

.badge-warn { background: rgba(245,166,35,0.12); color: var(--warning); }
.badge-warn .badge-dot { background: var(--warning); }

.badge-danger { background: rgba(239,68,68,0.12); color: var(--danger); }
.badge-danger .badge-dot { background: var(--danger); }

/* --- Firma visual: línea de flujo animada en sectores activos --- */
.flow-line {
  height: 3px;
  border-radius: 2px;
  background-image: repeating-linear-gradient(
    90deg, var(--success) 0 8px, transparent 8px 16px
  );
  background-size: 32px 100%;
  animation: flow 0.6s linear infinite;
}
@keyframes flow {
  from { background-position: 0 0; }
  to   { background-position: -32px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .flow-line { animation: none; }
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  margin-top: 10px;
  min-height: 18px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}
