/* ============================================================
   UbiaTek · Demos · Sistema de diseño compartido
   Base: paleta "noche" de la landing (dark, gradientes, Space Grotesk)
   ============================================================ */

:root {
  --bg: #010613;
  --bg-2: #040b1b;
  --surface: #07111f;
  --surface-2: #0c1830;
  --line: rgba(158, 172, 195, 0.16);
  --line-strong: rgba(158, 172, 195, 0.3);
  --text: #eef1f5;
  --text-muted: #a8b3c2;
  --text-dim: #687789;
  --accent-a: #8b9cb8;
  --accent-b: #d7e0ec;
  --highlight: #eef1f5;
  --grad: linear-gradient(120deg, #232763 0%, #2859ad 100%);
  --grad-soft: linear-gradient(120deg, rgba(35, 39, 99, 0.35), rgba(40, 89, 173, 0.3));
  --wa: #25d366;
  --wa-dark: #0b141a;
  --wa-surface: #111b21;
  --wa-in: #005c4b;
  --wa-in-2: #025144;
  --wa-out: #202c33;
  --grid: rgba(139, 156, 184, 0.07);
  --orb-a: rgba(139, 156, 184, 0.4);
  --orb-b: rgba(215, 224, 236, 0.28);
  --ghost-soft: rgba(255, 255, 255, 0.02);
  --ghost: rgba(255, 255, 255, 0.04);
  --ghost-strong: rgba(255, 255, 255, 0.07);
  --field-bg: rgba(255, 255, 255, 0.04);
  --field-bg-focus: rgba(139, 156, 184, 0.06);
  --on-grad: #ffffff;
  --link-hover: #ffffff;
  --shadow: 0 20px 60px -24px rgba(0, 0, 0, 0.7);
  --radius: 16px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-b); text-decoration: none; }
a:hover { color: var(--link-hover); }

/* ---------- Navegación común ---------- */
.demo-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: linear-gradient(90deg, rgba(11, 20, 37, 0.92), rgba(35, 42, 104, 0.9));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.demo-nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--nav-text, #fff);
}
.demo-nav .brand .logo { width: 30px; height: 30px; border-radius: 8px; }
.demo-nav .brand small { font-weight: 500; font-size: 11px; color: rgba(255,255,255,0.6); display: block; line-height: 1.1; }
.demo-nav .badge {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: #ffd166;
  border: 1px solid rgba(255, 209, 102, 0.4);
  background: rgba(255, 209, 102, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}
.demo-nav .links { display: flex; gap: 6px; }
.demo-nav .links a {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  color: rgba(255,255,255,0.8);
  border: 1px solid transparent;
}
.demo-nav .links a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.demo-nav .links a.active {
  background: var(--grad);
  color: #fff;
  border-color: rgba(255,255,255,0.15);
}

/* ---------- Página principal ---------- */
.demo-main {
  padding-top: 74px;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}
.demo-main::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
}

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(160deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: 999px;
  padding: 11px 20px;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
  background: var(--grad);
  color: #fff;
}
.btn:hover { transform: translateY(-1px); opacity: .95; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
}
.btn.ghost:hover { color: var(--text); border-color: var(--accent-a); }
.btn.wa { background: var(--wa); color: #0b141a; }
.btn.sm { padding: 7px 14px; font-size: 13px; }

/* ---------- Formularios ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.field input, .field select {
  width: 100%;
  background: var(--field-bg);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 11px 14px;
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, background .15s;
}
.field input:focus, .field select:focus { border-color: var(--accent-a); background: var(--field-bg-focus); }
.field select option { background: var(--surface); }

/* ---------- Badges de estado ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-muted);
  background: var(--ghost);
}
.chip.ok { color: #4ade80; border-color: rgba(74,222,128,.35); background: rgba(74,222,128,.08); }
.chip.warn { color: #fbbf24; border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.08); }

/* ---------- Sección informativa ---------- */
.info-block { text-align: center; max-width: 640px; margin: 0 auto; padding: 48px 20px 28px; }
.info-block h1 { font-family: var(--font-display); font-size: clamp(26px, 4vw, 40px); font-weight: 700; margin-bottom: 12px; }
.info-block p { color: var(--text-muted); font-size: 16px; }

/* ---------- Utilidades ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.center { text-align: center; }
.mt { margin-top: 16px; }
.mt2 { margin-top: 32px; }

@media (max-width: 720px) {
  .demo-nav .links a { display: none; }
  .demo-nav .links a:last-child { display: inline-flex; }
  .info-block { padding-top: 32px; }
}
