/* ==========================================================================
   Ztask — landing page
   Sistema: Nocturne (adaptado a la paleta de marca Ztask: #A3E635 / #020617)
   Tokens primero, capa de componentes después. Sin frameworks.
   ========================================================================== */

:root {
  /* Grounds y texto */
  --bg: #020617;
  --surface: #0b1120;
  --surface-2: #111a2e;
  --text: #e8eaf1;
  --muted: #94a3b8;
  --faint: #64748b;
  --line: rgba(232, 234, 241, 0.13);
  --line-strong: rgba(232, 234, 241, 0.22);

  /* Acento de marca (rampa lima, reemplaza el blurple de Nocturne) */
  --accent: #a3e635;
  --accent-300: #d9f99d;
  --accent-600: #84cc16;
  --accent-tint: rgba(163, 230, 53, 0.08);
  --accent-tint-2: rgba(163, 230, 53, 0.16);
  --accent-edge: rgba(163, 230, 53, 0.30);

  /* Banda de presencia (equivalente a --color-section de Nocturne) */
  --band: #08140a;
  --band-glow: #12240d;

  /* Estado (sólo para semáforo de datos, no es color de marca) */
  --alert: #f0a5a5;

  --font: system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Escala densa 0.7x de Nocturne */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s6: 24px; --s8: 32px; --s12: 48px;

  --r-sm: 4px; --r: 8px; --r-lg: 14px;

  --sh-sm: 0 0 0 1px rgba(232, 234, 241, 0.10);
  --sh-md: 0 0 0 1px rgba(232, 234, 241, 0.16), 0 6px 18px rgba(0, 0, 0, 0.55);
  --glow: 0 0 0 1px rgba(163, 230, 53, 0.5), 0 10px 34px -14px rgba(163, 230, 53, 0.38);
}

/* — base — */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.6 var(--font); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: break-word;
}
h1, h2, h3, h4, h5, h6 { font-weight: 500; line-height: 1.12; letter-spacing: -0.018em; margin: 0; }
h1 { font-size: clamp(33px, 5vw, 57px); line-height: 1.04; letter-spacing: -0.028em; }
h2 { font-size: clamp(25px, 3.3vw, 37px); letter-spacing: -0.024em; }
h3 { font-size: 16px; }
p { margin: 0; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-300); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: rgba(163, 230, 53, 0.28); }
section[id] { scroll-margin-top: 78px; }
.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;
}

/* — layout — */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.section { padding: clamp(52px, 7vw, 100px) 0; }
.section--surface { background: var(--surface); border-block: 1px solid var(--line); }
.kicker {
  font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-300); margin: 0 0 var(--s3);
}
.lede { color: var(--muted); font-size: 16.5px; max-width: 62ch; margin-top: var(--s4); }
.head { max-width: 44ch; }
.grid { display: grid; gap: 14px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); }
@media (min-width: 600px) {
  #funcionalidades .grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); }
.mt-8 { margin-top: var(--s8); }
.mt-12 { margin-top: var(--s12); }

/* Regla que se desvanece en los extremos — firma de Nocturne */
.rule {
  height: 1px; border: 0; margin: 0;
  background: linear-gradient(to right, transparent, var(--line) 48px, var(--line) calc(100% - 48px), transparent);
}

/* — botones — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  font: 500 14px/1.2 var(--font); color: var(--text); text-decoration: none; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: var(--r);
  padding: 11px 17px;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.btn-primary { color: var(--accent); border-color: var(--accent-edge); background: var(--accent-tint); }
.btn-primary:hover { color: var(--accent); background: var(--accent-tint-2); box-shadow: var(--glow); transform: translateY(-1px); }
.btn-primary:active { background: rgba(163, 230, 53, 0.24); transform: none; box-shadow: none; }
.btn-ghost { border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--text); background: rgba(232, 234, 241, 0.06); border-color: var(--line-strong); }
.btn-ghost:active { background: rgba(232, 234, 241, 0.12); }
.btn-lg { padding: 14px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--s8); }
.hint { color: var(--faint); font-size: 12.5px; margin-top: var(--s4); }

/* — etiquetas — */
.tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
}
.tag--accent { color: var(--accent-300); border-color: var(--accent-edge); }
.tag--alert { color: var(--alert); border-color: rgba(240, 165, 165, 0.28); }
.pill {
  display: inline-flex; align-items: center; gap: var(--s2); font-size: 12px; font-weight: 500;
  color: var(--accent-300); border: 1px solid var(--accent-edge); border-radius: 999px; padding: 6px 13px;
}
.pill i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); display: block; }

/* — funcionalidades secundarias agrupadas como chips — */
.feature-more { margin-top: 28px; }
.feature-more__label {
  font-size: 11.5px; font-weight: 700; color: var(--faint);
  text-transform: uppercase; letter-spacing: .07em; margin: 0 0 10px;
}
.feature-more__list { display: flex; flex-wrap: wrap; gap: 8px; }

/* — header — */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: rgba(2, 6, 23, 0.84); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s6); height: 64px; }
.nav__brand { display: flex; align-items: center; }
.nav__brand img { height: 21px; width: auto; }
.nav__links { display: none; }
.nav__links a { color: var(--muted); font-size: 14px; }
.nav__links a:hover { color: var(--text); }
.nav__cta { display: flex; gap: 8px; }
.nav__demo { display: none; }

/* — hero — */
.hero { padding-top: clamp(96px, 12vw, 148px); padding-bottom: clamp(48px, 6vw, 88px); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(32px, 5vw, 56px); align-items: center; }

/* — tarjetas — */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-sm); padding: 20px; }
.card h3 { margin: var(--s4) 0 6px; }
.card p { color: var(--muted); font-size: 14px; }
.card--hover { transition: box-shadow .18s ease, transform .18s ease; }
.card--hover:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.ico {
  width: 34px; height: 34px; border-radius: var(--r); display: grid; place-items: center;
  color: var(--accent); border: 1px solid var(--accent-edge); background: var(--accent-tint);
}

/* — pasos — */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps .card { position: relative; }
.num {
  width: 30px; height: 30px; border-radius: var(--r); display: grid; place-items: center;
  border: 1px solid var(--accent-edge); color: var(--accent); font-size: 13px; font-weight: 500;
}

/* — bloques de producto — */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.checks { list-style: none; padding: 0; margin: var(--s6) 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.checks li { display: flex; gap: 10px; font-size: 14.5px; }
.checks svg { color: var(--accent); flex: none; margin-top: 4px; }

/* — mockups de interfaz — */
.mock { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-md); overflow: hidden; }
.mock__bar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #060b1a; border-bottom: 1px solid var(--line); }
.mock__dots { display: flex; gap: 5px; }
.mock__dots i { width: 8px; height: 8px; border-radius: 50%; background: #2b3a55; display: block; }
.mock__url { flex: 1; min-width: 0; font-size: 11px; color: var(--faint); background: rgba(232, 234, 241, 0.05); border-radius: 6px; padding: 4px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app { display: flex; }
.app__rail { width: 44px; flex: none; border-right: 1px solid var(--line); padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.app__rail i { width: 22px; height: 22px; border-radius: 6px; background: rgba(232, 234, 241, 0.06); display: block; }
.app__rail i.on { background: var(--accent-tint-2); box-shadow: 0 0 0 1px var(--accent-edge); }
.app__body { flex: 1; min-width: 0; padding: 13px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 11px; }
.app__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.app__head strong { font-size: 12.5px; font-weight: 500; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { border: 1px solid var(--line); border-radius: var(--r); padding: 9px 10px; }
.stat span { display: block; font-size: 9.5px; color: var(--faint); }
.stat b { font-size: 18px; font-weight: 500; }
.stat b.accent { color: var(--accent); }
.stat b.alert { color: var(--alert); }
.kb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kb__col { border: 1px solid var(--line); border-radius: var(--r); padding: 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-content: start; }
.kb__h { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--faint); }
.tk { border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: rgba(232, 234, 241, 0.03); }
.tk p { font-size: 10.5px; line-height: 1.35; }
.tk--on { border-color: var(--accent-edge); background: var(--accent-tint); }
.tk .meta { display: flex; align-items: center; gap: 5px; margin-top: 7px; font-size: 9px; color: var(--faint); }
.tk .bar { height: 3px; border-radius: 2px; background: rgba(232, 234, 241, 0.12); margin-top: 7px; }
.tk .bar i { display: block; height: 3px; border-radius: 2px; background: var(--accent); }
.av { width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; font-size: 7px; font-weight: 500; color: var(--text); background: #2b3a55; flex: none; }
.av--accent { background: rgba(163, 230, 53, 0.22); color: var(--accent-300); }
.feed { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; border: 1px solid var(--line); border-radius: var(--r); padding: 10px; }
.feed p { font-size: 10.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.feed b { color: var(--text); font-weight: 500; }

/* chat */
.chat { display: grid; gap: 11px; padding: 14px; }
.chat__msg { display: flex; gap: 9px; }
.chat__msg--reply { padding-left: 26px; }
.chat__bubble { border: 1px solid var(--line); border-radius: var(--r); padding: 9px 11px; background: rgba(232, 234, 241, 0.03); }
.chat__bubble strong { display: block; font-size: 10.5px; font-weight: 500; margin-bottom: 4px; }
.chat__bubble p { font-size: 12px; line-height: 1.5; color: var(--muted); }
.chat__pinned { border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: var(--r); padding: 10px 12px; background: var(--accent-tint); }
.chat__pinned span { font-size: 9.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent-300); }
.chat__pinned p { font-size: 12px; margin-top: 5px; }
.chat__input { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: var(--r); padding: 9px 11px; font-size: 12px; color: var(--faint); }
.chat__input i { width: 22px; height: 22px; border-radius: 6px; background: var(--accent-tint-2); box-shadow: 0 0 0 1px var(--accent-edge); display: block; margin-left: auto; }
.reactions { display: flex; gap: 5px; margin-top: 8px; }

/* — banda de reportes — */
.band {
  background: radial-gradient(120% 150% at 12% 0%, var(--band-glow) 0%, var(--band) 58%, var(--bg) 100%);
  border-block: 1px solid var(--line);
}
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: var(--s6); }
.kpi b { display: block; font-size: clamp(22px, 2.4vw, 30px); font-weight: 500; }
.kpi b.accent { color: var(--accent); }
.kpi span { font-size: 11.5px; color: var(--faint); }
.chart { display: flex; align-items: flex-end; gap: 12px; height: 148px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.chart i { flex: 1; display: block; background: rgba(232, 234, 241, 0.13); border-radius: 4px 4px 0 0; }
.chart i.on { background: var(--accent); box-shadow: 0 0 24px -6px rgba(163, 230, 53, 0.5); }
.chart__x { display: flex; gap: 12px; margin-top: 8px; }
.chart__x span { flex: 1; font-size: 9.5px; color: var(--faint); text-align: center; }

/* — roles: tabla — */
.table-wrap { overflow-x: auto; margin-top: var(--s8); }
table.perm { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }
table.perm th, table.perm td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
table.perm thead th { font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
table.perm tbody th { font-weight: 500; }
table.perm td { color: var(--muted); }
table.perm svg { color: var(--accent); }
table.perm td .no { color: #3b4a63; }

/* — CTA — */
.cta { text-align: center; }
.cta .lede { margin-inline: auto; }
.cta .actions { justify-content: center; }

/* — FAQ — */
.faq { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; max-width: 820px; margin-top: var(--s8); }
.faq__item { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.faq__q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  text-align: left; background: transparent; border: 0; border-radius: var(--r-lg);
  color: var(--text); font: 500 15.5px/1.4 var(--font); padding: 17px 19px; cursor: pointer;
}
.faq__q:hover { background: rgba(232, 234, 241, 0.04); }
.faq__q svg { color: var(--accent); flex: none; transition: transform .2s ease; }
.faq__q[aria-expanded='true'] svg { transform: rotate(45deg); }
.faq__a { padding: 0 19px 18px; color: var(--muted); font-size: 14.5px; max-width: 72ch; }
.faq__a[hidden] { display: none; }

/* — footer — */
.foot { background: var(--surface); border-top: 1px solid var(--line); padding: clamp(44px, 6vw, 68px) 0 22px; }
.foot__grid { display: grid; gap: var(--s8); grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); }
.foot img { height: 20px; width: auto; }
.foot p { color: var(--muted); font-size: 14px; margin-top: var(--s4); max-width: 34ch; }
.foot h6 { font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); margin-bottom: var(--s3); }
.foot nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; }
.foot nav a { overflow-wrap: break-word; }
.foot nav a { color: var(--muted); font-size: 14px; }
.foot nav a:hover { color: var(--accent); }
.foot__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  margin-top: var(--s12); padding-top: var(--s6); border-top: 1px solid var(--line);
  color: var(--faint); font-size: 12.5px;
}

/* — escritorio — */
@media (min-width: 980px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--rev .split__media { order: 2; }
  .band__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
}
@media (min-width: 1000px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr); }
}
@media (min-width: 560px) {
  .nav__demo { display: inline-flex; }
}
@media (min-width: 960px) {
  .nav__links { display: flex; gap: 26px; }
}

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

/* — mobile: grillas compactas de 2 columnas y menos aire entre secciones — */
@media (max-width: 599px) {
  .section { padding: 32px 0; }
  .hero { padding-top: clamp(88px, 20vw, 148px); padding-bottom: 32px; }
  .kicker { margin-bottom: 6px; }
  .lede { font-size: 15px; margin-top: 8px; }
  .head + .lede { margin-top: 6px; }
  .foot { padding: 32px 0 18px; }
  .foot__bottom { margin-top: var(--s8); padding-top: var(--s4); }

  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .mt-12 { margin-top: var(--s6); }
  .card { padding: 14px; }
  .card h3 { font-size: 13.5px; margin: 10px 0 4px; }
  .card p { font-size: 12px; line-height: 1.4; }
  .ico { width: 28px; height: 28px; }
  .ico svg { width: 15px; height: 15px; }

  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .steps .card { padding: 14px; }
  .num { width: 26px; height: 26px; font-size: 12px; margin-bottom: 4px; }

  .split { gap: 24px; }
  .split > div:not(.split__media) h2 { font-size: clamp(21px, 6vw, 26px); }

  .foot__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 16px; }
  .foot__grid > div:first-child { grid-column: 1 / -1; }

  /* mockups de interfaz: el rail decorativo y la grilla fija de 3 columnas
     no entran comodas en una pantalla angosta — el rail se saca y el
     tablero pasa a scroll horizontal con snap, en vez de aplastarse. */
  .app__rail { display: none; }
  .stats { gap: 6px; }
  .stat { padding: 8px 9px; }
  .stat span { font-size: 8.5px; }
  .stat b { font-size: 15px; }
  .kb {
    grid-auto-flow: column;
    grid-auto-columns: 158px;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    margin: 0 -13px;
    padding: 2px 13px 6px;
  }
  .kb__col { scroll-snap-align: start; }

  /* tabla de roles: se convierte en una tarjeta por rol, sin scroll lateral */
  .table-wrap { overflow: visible; }
  table.perm { min-width: 0; width: 100%; border-collapse: separate; }
  table.perm thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.perm tbody { display: block; }
  table.perm tbody tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 14px 16px;
    margin-bottom: 10px;
    background: var(--surface);
  }
  table.perm tbody tr:last-child { margin-bottom: 0; }
  table.perm tbody th,
  table.perm tbody td {
    display: block;
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
  }
  table.perm tbody th {
    font-size: 15px;
    border-bottom-color: var(--line-strong);
    margin-bottom: 2px;
  }
  table.perm tbody td:last-child { border-bottom: 0; }
  table.perm td::before {
    content: attr(data-label);
    display: block;
    color: var(--faint);
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 3px;
  }
}
