/* Atiende IA — sitio público. Extiende el sistema del dashboard (azul royal). */

:root {
  /* Superficies */
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-alt: #eef2f9;
  --surface-deep: #0b1733;

  /* Líneas */
  --line: #d8e0ec;
  --line-strong: #b5c2d6;

  /* Texto */
  --text: #0b1733;
  --text-muted: #4b5b78;
  --text-dim: #8597b3;
  --text-on-brand: #ffffff;
  --text-on-deep: #dfe8fb;

  /* Marca */
  --brand: #1e40af;
  --brand-hover: #1d3a9e;
  --brand-light: #2563eb;
  --brand-soft: rgba(37, 99, 235, 0.10);

  /* Señales */
  --signal: #047857;
  --signal-soft: rgba(4, 120, 87, 0.12);
  --amber: #b45309;
  --amber-soft: rgba(180, 83, 9, 0.12);

  /* Chat */
  --chat-bg: #eef2f9;
  --chat-in: #ffffff;
  --chat-out: #d7e6d6;
  --chat-out-text: #10240f;

  /* Forma */
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(11, 23, 51, 0.05), 0 10px 30px rgba(11, 23, 51, 0.06);
  --shadow-soft: 0 1px 2px rgba(11, 23, 51, 0.04);
  --maxw: 1120px;
  --transition: 0.16s ease;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070d1c;
    --surface: #0f1a33;
    --surface-alt: #16233f;
    --surface-deep: #0f1a33;
    --line: #233250;
    --line-strong: #33456a;
    --text: #e8eefc;
    --text-muted: #9fb0cd;
    --text-dim: #6d7f9d;
    --text-on-brand: #ffffff;
    --text-on-deep: #dfe8fb;
    --brand: #6b93ff;
    --brand-hover: #8fb0ff;
    --brand-light: #8fb0ff;
    --brand-soft: rgba(107, 147, 255, 0.14);
    --signal: #34d399;
    --signal-soft: rgba(52, 211, 153, 0.14);
    --amber: #fbbf24;
    --amber-soft: rgba(251, 191, 36, 0.14);
    --chat-bg: #0b1428;
    --chat-in: #16233f;
    --chat-out: #1d4f3f;
    --chat-out-text: #dcf5e9;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.35);
  }
}

:root[data-theme="dark"] {
  --bg: #070d1c;
  --surface: #0f1a33;
  --surface-alt: #16233f;
  --surface-deep: #0f1a33;
  --line: #233250;
  --line-strong: #33456a;
  --text: #e8eefc;
  --text-muted: #9fb0cd;
  --text-dim: #6d7f9d;
  --text-on-brand: #ffffff;
  --text-on-deep: #dfe8fb;
  --brand: #6b93ff;
  --brand-hover: #8fb0ff;
  --brand-light: #8fb0ff;
  --brand-soft: rgba(107, 147, 255, 0.14);
  --signal: #34d399;
  --signal-soft: rgba(52, 211, 153, 0.14);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.14);
  --chat-bg: #0b1428;
  --chat-in: #16233f;
  --chat-out: #1d4f3f;
  --chat-out-text: #dcf5e9;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.35);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
}

h1, h2, h3, h4 {
  font-family: 'Archivo', 'Inter', -apple-system, Helvetica, Arial, sans-serif;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
  font-weight: 700;
}

a { color: var(--brand); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-hover); }

:focus-visible {
  outline: 2px solid var(--brand-light);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ---------- Navegación ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 66px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand-mark { width: 26px; height: 26px; flex: none; }
.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav-links a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-muted);
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--brand); color: var(--text-on-brand); }
.btn-primary:hover { background: var(--brand-hover); color: var(--text-on-brand); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); border-color: var(--text-dim); }
.btn-lg { padding: 13px 22px; font-size: 15.5px; }
.btn svg { flex: none; }

/* ---------- Secciones ---------- */

section { padding: 84px 0; }
.section-head { max-width: 660px; display: flex; flex-direction: column; gap: 14px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 38px); }
.section-head p { color: var(--text-muted); font-size: 17px; }
.rule { height: 1px; background: var(--line); border: 0; }

/* ---------- Hero ---------- */

.hero { padding: 68px 0 78px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(36px, 5.2vw, 57px);
  margin: 16px 0 20px;
}
.hero-lead {
  font-size: 18.5px;
  color: var(--text-muted);
  max-width: 34em;
}
.hero-actions { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.hero-facts {
  display: flex;
  gap: 28px;
  margin-top: 38px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.fact { display: flex; flex-direction: column; gap: 3px; }
.fact strong {
  font-family: 'Archivo', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.fact span { font-size: 13.5px; color: var(--text-dim); }

/* ---------- Ventana de chat ---------- */

.phone {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.phone-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 13px;
  flex: none;
}
.phone-who { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.phone-who b { font-size: 14.5px; font-weight: 600; }
.phone-status {
  font-size: 12px;
  color: var(--signal);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); flex: none; }
.thread {
  background: var(--chat-bg);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.msg {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14.5px;
  line-height: 1.5;
  box-shadow: var(--shadow-soft);
  position: relative;
}
.msg time {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.msg-in { background: var(--chat-in); border-top-left-radius: 4px; align-self: flex-start; }
.msg-out {
  background: var(--chat-out);
  color: var(--chat-out-text);
  border-top-right-radius: 4px;
  align-self: flex-end;
}
.msg-out time { color: color-mix(in srgb, var(--chat-out-text) 55%, transparent); }
.msg-system {
  align-self: center;
  max-width: 90%;
  background: var(--amber-soft);
  color: var(--amber);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
  box-shadow: none;
}
.phone-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-dim);
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* ---------- Lista de hechos ---------- */

.facts-list { display: grid; gap: 0; margin-top: 40px; }
.facts-list > li {
  list-style: none;
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 28px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.facts-list > li:last-child { border-bottom: 1px solid var(--line); }
.facts-list dt, .facts-list .k {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-top: 3px;
}
.facts-list .v { color: var(--text-muted); font-size: 16.5px; }
.facts-list .v b { color: var(--text); font-weight: 600; }

/* ---------- Pasos numerados ---------- */

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 44px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.step { background: var(--surface); padding: 26px 22px; display: flex; flex-direction: column; gap: 10px; }
.step-n {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand);
  letter-spacing: 0.06em;
}
.step h3 { font-size: 17.5px; font-weight: 600; }
.step p { font-size: 14.5px; color: var(--text-muted); }

/* ---------- Capas (anti-alucinación) ---------- */

.layers { display: flex; flex-direction: column; gap: 12px; margin-top: 40px; }
.layer {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 20px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  align-items: start;
}
.layer-n {
  font-family: 'Archivo', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.layer h3 { font-size: 17.5px; font-weight: 600; margin-bottom: 5px; }
.layer p { font-size: 15px; color: var(--text-muted); }
.layer code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  background: var(--surface-alt);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--text);
}

/* ---------- Grid genérico de tarjetas ---------- */

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.card h3 { font-size: 17.5px; font-weight: 600; }
.card p { font-size: 14.8px; color: var(--text-muted); }
.card ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; }
.card li { font-size: 14.8px; color: var(--text-muted); }

/* ---------- Banda oscura / CTA ---------- */

.band {
  background: var(--surface-deep);
  color: var(--text-on-deep);
  border-radius: var(--radius);
  padding: 54px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.band h2 { color: #ffffff; font-size: clamp(25px, 3vw, 33px); max-width: 17em; }
.band p { color: var(--text-on-deep); margin-top: 12px; max-width: 40em; font-size: 16.5px; }
.band .btn-primary { background: #ffffff; color: #0b1733; }
.band .btn-primary:hover { background: #dfe8fb; color: #0b1733; }

/* ---------- FAQ ---------- */

.faq { margin-top: 40px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  padding: 20px 0;
  font-family: 'Archivo', sans-serif;
  font-weight: 600;
  font-size: 17px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: 'IBM Plex Mono', monospace;
  font-size: 19px;
  color: var(--brand);
  flex: none;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 0 22px; color: var(--text-muted); max-width: 62em; font-size: 15.5px; }

/* ---------- Contacto ---------- */

.contact-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 52px; align-items: start; }
.channel {
  display: flex;
  gap: 16px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  align-items: flex-start;
}
.channel:last-child { border-bottom: 1px solid var(--line); }
.channel-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  flex: none;
}
.channel h3 { font-size: 16.5px; font-weight: 600; margin-bottom: 3px; }
.channel p { font-size: 14.8px; color: var(--text-muted); }
.channel a { font-weight: 500; }

/* ---------- Nota / aviso ---------- */

.note {
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  font-size: 15px;
  color: var(--text-muted);
  border-left: 3px solid var(--brand);
}
.note b { color: var(--text); }

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 44px 0 56px;
  margin-top: 40px;
}
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { font-size: 14.5px; color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }
.footer small { color: var(--text-dim); font-size: 13.5px; display: block; margin-top: 10px; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 42px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .cards, .cards-2 { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .band { padding: 40px 30px; }
  section { padding: 62px 0; }
}

@media (max-width: 620px) {
  .nav-links { gap: 16px; }
  .nav-links .nav-hide { display: none; }
  .steps { grid-template-columns: 1fr; }
  .facts-list > li { grid-template-columns: 1fr; gap: 8px; }
  .band { padding: 34px 24px; }
}

/* ---------- Documento legal ---------- */

.legal { max-width: 760px; }
.legal h2 {
  font-size: 23px;
  margin: 44px 0 12px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.legal h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 34px; }
.legal h3 { font-size: 17px; font-weight: 600; margin: 24px 0 8px; }
.legal p { color: var(--text-muted); margin-bottom: 14px; font-size: 16px; }
.legal ul { margin: 0 0 16px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.legal li { color: var(--text-muted); font-size: 16px; }
.legal li b, .legal p b { color: var(--text); font-weight: 600; }
.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0 20px;
  font-size: 14.8px;
}
.legal .table-scroll { overflow-x: auto; }
.legal th, .legal td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.legal th {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 500;
  white-space: nowrap;
}
.legal td { color: var(--text-muted); }
.legal td:first-child { color: var(--text); font-weight: 500; white-space: nowrap; }
.legal-meta {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
}
