/* ============================================
   JAI Agentes - CSS Externo
   Versión mejorada: 2026-07-29
   ============================================ */

/* --- Variables CSS (Design Tokens) --- */
:root {
  --bg: #07111f;
  --bg-2: #0c1730;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.12);
  --text: #eef4ff;
  --muted: #c5d1e5;
  --primary: #56a8ff;
  --primary-2: #9ed7ff;
  --accent: #2fd6c8;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --max: 1160px;
}

/* --- Reset & Base --- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(86, 168, 255, 0.16), transparent 24%),
    radial-gradient(circle at 82% 10%, rgba(47, 214, 200, 0.10), transparent 18%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

/* --- Screen Reader Only (sr-only) --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Skip-nav --- */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 999;
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  transition: top 0.2s ease;
}
.skip-nav:focus {
  top: 12px;
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* --- Layout --- */
.container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

/* --- Eyebrow --- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(158, 215, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--primary-2);
  font-size: 0.84rem;
  letter-spacing: 0.03em;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  box-shadow: 0 0 16px rgba(86, 168, 255, 0.5);
}

/* --- Header / Nav --- */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(7, 17, 31, 0.74);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(86, 168, 255, 0.24), rgba(47, 214, 200, 0.14));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font-weight: 800;
}

.brand small {
  display: block;
  color: #92a6c5;
  font-size: 0.78rem;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}
.nav-links a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 4px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  color: white;
  background: linear-gradient(135deg, #1c7fff, #42b6ff);
  box-shadow: 0 12px 28px rgba(28, 127, 255, 0.28);
}

.btn-secondary {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

/* --- Mobile Toggle --- */
.mobile-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

/* --- Hero --- */
.hero {
  padding: 78px 0 42px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 32px;
  align-items: stretch;
}

.hero-copy h1 {
  margin: 18px 0;
  font-size: clamp(2.6rem, 5vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
  max-width: 11ch;
}

.lead {
  margin: 0 0 22px;
  max-width: 65ch;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero-proof {
  margin: 0 0 28px;
  padding: 14px 16px;
  border-left: 3px solid rgba(86, 168, 255, 0.5);
  border-radius: 0 12px 12px 0;
  background: linear-gradient(90deg, rgba(86, 168, 255, 0.08), transparent 80%);
  color: var(--primary-2);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-micro {
  margin-top: 16px;
  color: #92a6c5;
  font-size: 0.94rem;
}

.hero-side,
.glass-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-side {
  padding: 26px;
  position: relative;
  overflow: hidden;
}

.hero-side::after {
  content: "";
  position: absolute;
  inset: auto -10% -26% auto;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(66, 182, 255, 0.18), transparent 60%);
  pointer-events: none;
}

.hero-side h2 {
  margin: 0 0 10px;
  font-size: 1.4rem;
}

.hero-side p {
  margin: 0;
  color: var(--muted);
}

/* --- Stats Grid --- */
.stats-grid,
.cards-grid,
.steps-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 22px;
}

.stat,
.card,
.step {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: rgba(7, 17, 31, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.06rem;
}

.stat p,
.card p,
.step p {
  margin: 0;
  color: var(--muted);
}

/* --- Sections --- */
.section {
  padding: clamp(32px, 6vw, 72px) 0;
}

.section-title {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
  max-width: 760px;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.section-title p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

/* --- Cards Grid --- */
.cards-grid {
  grid-template-columns: repeat(3, 1fr);
}

.card h3,
.step h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

/* --- Results --- */
.results {
  padding: 30px;
}

.result-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.result {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.result strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

.result span {
  color: var(--muted);
  font-size: 0.95rem;
}

/* --- Steps --- */
.steps-grid {
  grid-template-columns: repeat(4, 1fr);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(86, 168, 255, 0.14);
  color: var(--primary-2);
  font-weight: 800;
}

/* --- CTA --- */
.cta {
  padding: 30px;
}

.cta-grid {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 22px;
  align-items: start;
}

.cta-note {
  margin-top: 18px;
  color: var(--muted);
}

/* --- Contact Stack --- */
.contact-stack {
  display: grid;
  gap: 14px;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.contact-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.contact-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.contact-item strong {
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}

/* --- Footer --- */
footer {
  padding: 28px 0 46px;
  color: #92a6c5;
  font-size: 0.92rem;
}

.footer-inner {
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* --- Back to Top Button --- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 30;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(7, 17, 31, 0.9);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(8px);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: rgba(86, 168, 255, 0.2);
  border-color: var(--primary);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.back-to-top svg {
  width: 24px;
  height: 24px;
}

/* --- Media Queries --- */

/* Tablet */
@media (max-width: 1024px) {
  .hero-grid,
  .cta-grid {
    grid-template-columns: 1fr;
  }

  .cards-grid,
  .steps-grid,
  .result-list,
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 768px) {
  .nav-links,
  .desktop-only {
    display: none;
  }

  .mobile-toggle {
    display: inline-grid;
    place-items: center;
  }

  .nav.open .nav-links {
    display: flex;
    position: absolute;
    top: 76px;
    left: 16px;
    right: 16px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(7, 17, 31, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: flex-start;
  }

  .nav.open .nav-links a {
    min-height: 44px;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0 10px;
  }

  .hero {
    padding-top: 42px;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .container {
    width: min(var(--max), calc(100% - 20px));
  }

  .hero-copy h1 {
    font-size: 2.2rem;
  }

  .btn {
    width: 100%;
    min-height: 44px;
  }

  .hero-actions {
    width: 100%;
  }

  .cards-grid,
  .steps-grid,
  .result-list,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 46px 0;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover,
  .btn:focus-visible { transform: none; }
  .eyebrow::before { animation: none; }
  .back-to-top {
    transition: none;
  }
}

/* Light Mode */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --bg-2: #f1f5f9;
    --surface: rgba(0, 0, 0, 0.06);
    --surface-2: rgba(0, 0, 0, 0.08);
    --line: rgba(0, 0, 0, 0.12);
    --text: #0f172a;
    --muted: #475569;
    --primary: #2563eb;
    --primary-2: #3b82f6;
    --accent: #0d9488;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  }
  body {
    background:
      radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 24%),
      radial-gradient(circle at 82% 10%, rgba(13, 148, 136, 0.06), transparent 18%),
      linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  }
  header {
    background: rgba(248, 250, 252, 0.86);
    border-bottom-color: rgba(0, 0, 0, 0.08);
  }
  .nav.open .nav-links {
    background: rgba(248, 250, 252, 0.98);
  }
  .skip-nav {
    background: var(--primary);
    color: white;
  }
}
