/* ============================================================
   ELIOGPT · DESIGN SYSTEM (v1)
   Tokens + base + tipografía + layout + header/footer +
   botones + tarjetas + paneles + chips + badges + estados.
   Producto B2B: morado serio, profundidad, aire, claridad.
   ============================================================ */

/* ---------- 1. TOKENS ---------- */
:root {
  /* Fondos y superficies */
  --elio-bg: #07070B;
  --elio-bg-deep: #030208;
  --elio-surface: #0E0B19;
  --elio-surface-elevated: #151022;
  --elio-surface-soft: #1B1330;

  /* Marca */
  --elio-primary: #8B3DFF;
  --elio-primary-bright: #A855F7;
  --elio-purple: #6D28D9;
  --elio-violet: #7C3AED;
  --elio-magenta: #C026D3;
  --elio-brand-core: #663399;

  /* Texto */
  --elio-white: #FFFFFF;
  --elio-text: #F4F1FA;
  --elio-text-muted: #B9B1C8;
  --elio-text-soft: #8F879F;

  /* Estados */
  --elio-success: #2EE59D;
  --elio-warning: #FFD166;
  --elio-danger: #FF4D6D;

  /* Bordes / líneas */
  --elio-line: rgba(139, 92, 246, 0.16);
  --elio-line-strong: rgba(139, 92, 246, 0.34);
  --elio-hairline: rgba(255, 255, 255, 0.06);

  /* Gradientes */
  --elio-grad-cta: linear-gradient(135deg, #663399 0%, #7C3AED 55%, #C026D3 100%);
  --elio-grad-text: linear-gradient(120deg, #A855F7 0%, #C026D3 100%);
  --elio-grad-panel: linear-gradient(160deg, rgba(27,19,48,0.9) 0%, rgba(14,11,25,0.9) 100%);

  /* Sombras y glow */
  --elio-shadow-sm: 0 2px 10px rgba(3, 2, 8, 0.5);
  --elio-shadow-md: 0 16px 40px rgba(3, 2, 8, 0.55);
  --elio-shadow-lg: 0 30px 80px rgba(3, 2, 8, 0.6);
  --elio-glow: 0 0 0 1px rgba(139, 92, 246, 0.28), 0 18px 60px rgba(124, 58, 237, 0.28);
  --elio-glow-soft: 0 12px 40px rgba(124, 58, 237, 0.18);

  /* Radios */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* Espaciado */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Layout */
  --container: 1200px;
  --container-wide: 1280px;
  --gutter: 24px;
  --header-h: 72px;

  /* Tipografía */
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;

  /* Transiciones / easing */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 160ms;
  --t-base: 260ms;
  --t-slow: 480ms;

  /* z-index */
  --z-bg: 0;
  --z-base: 1;
  --z-header: 900;
  --z-menu: 950;
  --z-widget: 9999;
}

/* ---------- 2. RESET / BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--elio-text);
  background: var(--elio-bg-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

ul { list-style: none; padding: 0; }

:focus-visible {
  outline: 2px solid var(--elio-primary-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: rgba(168, 85, 247, 0.35); color: #fff; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 1000;
  background: var(--elio-surface-elevated);
  color: var(--elio-text);
  padding: 10px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--elio-line-strong);
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- 3. TIPOGRAFÍA ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--elio-white);
}

h1 { font-size: clamp(2.5rem, 5vw, 4.25rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 3rem); line-height: 1.08; }
h3 { font-size: clamp(1.3rem, 1.8vw, 1.7rem); font-weight: 650; letter-spacing: -0.02em; }
h4 { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; }

p { color: var(--elio-text-muted); }

.text-grad {
  background: var(--elio-grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--elio-text-muted);
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--elio-success);
  box-shadow: 0 0 10px rgba(46, 229, 157, 0.8);
}

.lead {
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  line-height: 1.65;
  color: var(--elio-text-muted);
  max-width: 60ch;
}

/* ---------- 4. LAYOUT ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: var(--container-wide); }

.section { padding-block: clamp(56px, 8vw, 104px); position: relative; }
.section--tight { padding-block: clamp(40px, 5vw, 64px); }

.section-head {
  max-width: 720px;
  margin: 0 auto clamp(32px, 4vw, 56px);
  text-align: center;
}
.section-head .eyebrow { margin-bottom: 14px; }
.section-head p { margin-top: 14px; font-size: 1.05rem; }
.section-head--left { text-align: left; margin-inline: 0; }

.grid { display: grid; gap: var(--space-6); }
.stack-6 > * + * { margin-top: var(--space-6); }

/* ---------- 5. HEADER / NAV ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(7, 7, 11, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--elio-hairline);
  transition: background var(--t-base), border-color var(--t-base);
}
.site-header.scrolled {
  background: rgba(6, 5, 12, 0.9);
  border-bottom-color: var(--elio-line);
  box-shadow: 0 10px 30px rgba(3, 2, 8, 0.4);
}
.site-header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand__logo { height: 30px; width: auto; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav__list { display: flex; align-items: center; gap: 6px; }
.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--elio-text-muted);
  border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
}
.nav__link:hover { color: var(--elio-text); background: rgba(255,255,255,0.04); }
.nav__link.active { color: var(--elio-white); }
.nav__link.active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--elio-grad-cta);
}
.nav__cta { flex-shrink: 0; }
.nav__close { display: none; }

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  border: 1px solid var(--elio-line);
}
.nav__toggle span {
  display: block;
  width: 20px; height: 2px;
  margin-inline: auto;
  background: var(--elio-text);
  border-radius: 2px;
  transition: transform var(--t-fast), opacity var(--t-fast);
}
.nav__toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.active span:nth-child(2) { opacity: 0; }
.nav__toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 6. BUTTONS ---------- */
.btn {
  --btn-h: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-h);
  padding: 0 22px;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-base), border-color var(--t-fast);
}
.btn--primary,
.btn-primary {
  color: #fff;
  background: var(--elio-grad-cta);
  background-size: 160% 160%;
  background-position: 0% 50%;
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.35);
}
.btn--primary:hover,
.btn-primary:hover {
  background-position: 100% 50%;
  transform: translateY(-1px);
  box-shadow: 0 14px 38px rgba(192, 38, 211, 0.4);
}
.btn--outline,
.btn--secondary,
.btn-ghost {
  color: var(--elio-text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--elio-line-strong);
}
.btn--outline:hover,
.btn--secondary:hover,
.btn-ghost:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: var(--elio-primary);
  transform: translateY(-1px);
}
.btn--large { --btn-h: 54px; padding: 0 30px; font-size: 1rem; }
.btn-primary, .btn-ghost { /* legacy aliases share .btn sizing */
  height: 48px; padding: 0 22px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 0.95rem;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-base), border-color var(--t-fast);
}
.btn-primary.big, .btn-ghost.big { height: 54px; padding: 0 30px; font-size: 1rem; }
.w-full { width: 100%; }
.btn .btn__arrow { transition: transform var(--t-fast); }
.btn:hover .btn__arrow { transform: translate(2px, -2px); }

/* ---------- 7. CARDS / PANELS ---------- */
.card {
  background: var(--elio-surface);
  border: 1px solid var(--elio-line);
  border-radius: var(--r-lg);
  padding: 26px;
  transition: transform var(--t-base) var(--ease), border-color var(--t-base), box-shadow var(--t-base);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--elio-line-strong);
  box-shadow: var(--elio-glow-soft);
}
.card__icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  margin-bottom: 16px;
  color: var(--elio-primary-bright);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid var(--elio-line-strong);
}
.card h3 { margin-bottom: 8px; }
.card p { font-size: 0.96rem; line-height: 1.6; }
.card__tag {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--elio-text-soft);
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--elio-hairline);
}

.panel {
  position: relative;
  background: var(--elio-grad-panel);
  border: 1px solid var(--elio-line-strong);
  border-radius: var(--r-xl);
  box-shadow: var(--elio-shadow-md);
  overflow: hidden;
}
.panel__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--elio-hairline);
  background: rgba(255,255,255,0.02);
}
.panel__dots { display: inline-flex; gap: 6px; }
.panel__dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.18); display:block; }
.panel__dots i:nth-child(1){ background:#FF5F57; }
.panel__dots i:nth-child(2){ background:#FEBC2E; }
.panel__dots i:nth-child(3){ background:#28C840; }
.panel__title { font-size: 0.86rem; font-weight: 600; color: var(--elio-text-muted); }
.panel__body { padding: 20px; }

/* ---------- 8. CHIPS / BADGES / STATUS ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--elio-text-muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--elio-line);
  border-radius: var(--r-pill);
}
.chip svg, .chip .chip__ico { width: 16px; height: 16px; color: var(--elio-primary-bright); }
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--elio-text);
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid var(--elio-line-strong);
  border-radius: var(--r-pill);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--elio-text-muted);
}
.status::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--elio-success);
  box-shadow: 0 0 8px rgba(46, 229, 157, 0.7);
}
.status--wait::before { background: var(--elio-warning); box-shadow: 0 0 8px rgba(255, 209, 102, 0.7); }
.status--info::before { background: var(--elio-primary-bright); box-shadow: 0 0 8px rgba(168, 85, 247, 0.7); }

.tag-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--elio-text-soft);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.03);
  border: 1px dashed var(--elio-line-strong);
}

/* ---------- 9. FOOTER ---------- */
.site-footer {
  position: relative;
  border-top: 1px solid var(--elio-hairline);
  background: var(--elio-bg-deep);
  padding-block: clamp(48px, 6vw, 72px) 32px;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
}
.site-footer__brand p { margin-top: 14px; font-size: 0.92rem; max-width: 34ch; }
.site-footer__col h4 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--elio-text-soft);
  margin-bottom: 14px;
}
.site-footer__col a {
  display: block;
  padding: 5px 0;
  font-size: 0.92rem;
  color: var(--elio-text-muted);
  transition: color var(--t-fast);
}
.site-footer__col a:hover { color: var(--elio-text); }
.site-footer__bottom {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--elio-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--elio-text-soft);
}

/* ---------- 10. REVEAL / MOTION ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* Utilities */
.is-hidden { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

/* ---------- 11. HEADER / NAV RESPONSIVE + MOBILE MENU ---------- */
@media (max-width: 960px) {
  .nav__toggle { display: flex; }
  .nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(360px, 86vw);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    padding: 84px 24px 32px;
    background: rgba(9, 8, 16, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--elio-line);
    box-shadow: -30px 0 80px rgba(0,0,0,0.6);
    transform: translateX(105%);
    transition: transform var(--t-base) var(--ease);
    z-index: var(--z-menu);
    overflow-y: auto;
  }
  .nav.show-menu { transform: translateX(0); }
  .nav__list { flex-direction: column; align-items: stretch; gap: 4px; }
  .nav__link { padding: 14px 14px; font-size: 1.02rem; min-height: 48px; }
  .nav__link.active::after { display: none; }
  .nav__link.active { background: rgba(139, 92, 246, 0.12); }
  .nav__cta { margin-top: 12px; height: 52px; }
  .nav__close {
    display: grid;
    place-items: center;
    position: absolute;
    top: 18px; right: 18px;
    width: 42px; height: 42px;
    border-radius: var(--r-md);
    border: 1px solid var(--elio-line);
    background: rgba(255,255,255,0.03);
  }
  .nav__close::before,
  .nav__close::after {
    content: "";
    position: absolute;
    width: 18px; height: 2px;
    background: var(--elio-text);
    border-radius: 2px;
  }
  .nav__close::before { transform: rotate(45deg); }
  .nav__close::after { transform: rotate(-45deg); }
}

@media (max-width: 720px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 460px) {
  :root { --gutter: 18px; }
  .site-footer__grid { grid-template-columns: 1fr; }
}

/* ---------- 12. REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
