/* SagaWire — suite de apps para Bitrix24.
   Estilo: tipografía Inter afinada, azul marino + violeta, degradé inclinado arriba,
   tarjetas blancas con sombra en capas y bandas alternas. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --sunk: #f6f9fc;
  --ink: #0a2540;            /* títulos */
  --text: #425466;           /* cuerpo */
  --muted: #697386;
  --line: #e3e8ee;
  --accent: #635bff;
  --accent-hover: #0a2540;
  --accent-ink: #ffffff;
  --accent-soft: #eeedff;
  --ok: #0e8a5f;
  --ok-soft: #e2f5ec;
  --navy: #0a2540;
  --cyan: #00d4ff;
  --c-backup: #635bff;  --c-backup-soft: #eeedff;
  --c-gerente: #a42fc4; --c-gerente-soft: #f6e7fb;
  --c-comisiones: #0073e6; --c-comisiones-soft: #e3f0fd;
  --c-helpdesk: #e8467f; --c-helpdesk-soft: #ffe8f0;
  --c-agente: #00a37a; --c-agente-soft: #dcf5ec;
  --c-voz: #e5730e; --c-voz-soft: #fff0e1;
  --shadow: 0 13px 27px -5px rgba(50, 50, 93, .25), 0 8px 16px -8px rgba(0, 0, 0, .3);
  --shadow-sm: 0 2px 5px -1px rgba(50, 50, 93, .25), 0 1px 3px -1px rgba(0, 0, 0, .3);
  --shadow-lg: 0 50px 100px -20px rgba(50, 50, 93, .25), 0 30px 60px -30px rgba(0, 0, 0, .3);
  --f: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a2540; --surface: #0f2d4d; --sunk: #0c2846; --ink: #ffffff; --text: #adbdcc; --muted: #8ea2b7;
    --line: #1f4266; --accent: #8c86ff; --accent-hover: #ffffff; --accent-ink: #0a2540; --accent-soft: #24305e;
    --ok: #4fd8a4; --ok-soft: #123d3a; --navy: #06192c;
    --c-backup: #8c86ff; --c-backup-soft: #24305e;
    --c-gerente: #df8ff2; --c-gerente-soft: #3a2149;
    --c-comisiones: #4da3ff; --c-comisiones-soft: #133a5e;
    --c-helpdesk: #ff7fae; --c-helpdesk-soft: #4a2340;
    --c-agente: #3fd6a8; --c-agente-soft: #10413c;
    --c-voz: #ffa552; --c-voz-soft: #4a3320;
    --shadow: 0 13px 27px -5px rgba(0, 0, 0, .45), 0 8px 16px -8px rgba(0, 0, 0, .5);
    --shadow-sm: 0 2px 5px -1px rgba(0, 0, 0, .45);
    --shadow-lg: 0 50px 100px -20px rgba(0, 0, 0, .5), 0 30px 60px -30px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.6 var(--f); font-feature-settings: "ss01", "cv11"; letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; position: relative; overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; font-weight: 500; }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); position: relative; }
.narrow { max-width: 760px; }
main, footer { position: relative; z-index: 1; }

/* ---------- degradé inclinado ---------- */
.hero-bg {
  position: absolute; top: 0; left: 0; right: 0; height: 260px; z-index: 0; overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 62%, 0 100%);
  background:
    radial-gradient(40% 70% at 85% 25%, #ff5996 0%, transparent 70%),
    radial-gradient(35% 60% at 60% 10%, #ffb44d 0%, transparent 70%),
    radial-gradient(45% 80% at 100% 80%, #a960ee 0%, transparent 70%),
    radial-gradient(40% 70% at 30% 40%, #90e0ff 0%, transparent 70%),
    linear-gradient(120deg, #c4f1ff 0%, #a960ee 55%, #ff5996 100%);
  background-size: 160% 160%;
}
.hero-bg.tall { height: 640px; clip-path: polygon(0 0, 100% 0, 100% 72%, 0 100%); }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 60%, transparent) 38%, transparent 62%); }
.hero-bg:not(.tall)::after { background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 35%, transparent), transparent 70%); }
@media (prefers-reduced-motion: no-preference) {
  .hero-bg { animation: drift 22s ease-in-out infinite alternate; }
  @keyframes drift { from { background-position: 0% 30%; } to { background-position: 100% 70%; } }
}
@media (max-width: 880px) {
  .hero-bg.tall { height: 300px; clip-path: polygon(0 0, 100% 0, 100% 55%, 0 100%); }
  .hero-bg.tall::after { background: linear-gradient(180deg, transparent 30%, color-mix(in srgb, var(--bg) 40%, transparent) 100%); }
}

/* ---------- encabezado ---------- */
header.site { position: relative; z-index: 5; padding-top: env(safe-area-inset-top, 0px); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 22px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 700 21px/1 var(--f); color: var(--ink); letter-spacing: -0.03em; }
.brand:hover { color: var(--ink); }
.brand svg { width: 24px; height: 24px; }
nav.main { display: flex; align-items: center; gap: 4px 26px; flex-wrap: wrap; font-size: 15px; }
nav.main a { color: var(--ink); font-weight: 500; opacity: .86; }
nav.main a:hover, nav.main a[aria-current="page"] { opacity: 1; }
nav.main .lang { background: color-mix(in srgb, var(--bg) 70%, transparent); padding: 5px 12px; border-radius: 999px; font-size: 13px; opacity: 1; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; font: 600 15px/1.4 var(--f); background: var(--accent); color: var(--accent-ink); border: 0; }
.btn::after { content: ""; width: 6px; height: 6px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); margin-left: 2px; }
.btn:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.ghost { background: transparent; color: var(--accent); padding-inline: 8px; }
.btn.ghost:hover { color: var(--accent-hover); background: transparent; }
.btn.small { font-size: 14px; padding: 8px 16px; }
@media (prefers-reduced-motion: no-preference) { .btn::after { transition: transform .15s; } .btn:hover::after { transform: translateX(3px) rotate(45deg); } }
.actions { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; }

/* ---------- títulos ---------- */
h1, h2, h3 { color: var(--ink); }
.eyebrow { font: 600 15px/1.4 var(--f); color: var(--accent); margin: 0; }
h1 { font: 700 clamp(40px, 6.4vw, 76px)/1.03 var(--f); letter-spacing: -0.045em; margin: 14px 0 22px; text-wrap: balance; }
h1 em { font-style: normal; color: var(--accent); }
h2 { font: 700 clamp(30px, 3.8vw, 44px)/1.12 var(--f); letter-spacing: -0.035em; margin: 8px 0 16px; text-wrap: balance; }
h3 { font: 600 17px/1.4 var(--f); letter-spacing: -0.01em; }
.lede { font-size: 19px; line-height: 1.6; color: var(--text); max-width: 34em; margin: 0 0 30px; }
.sub { color: var(--text); margin: 0; font-size: 18px; max-width: 38em; }

/* ---------- hero ---------- */
.hero { padding-block: 72px 96px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
@media (max-width: 880px) { .hero { grid-template-columns: minmax(0, 1fr); padding-block: 150px 56px; gap: 44px; } }

/* maqueta de Bitrix24 */
.mock { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-lg); overflow: hidden; min-width: 0; }
.mock-bar { display: flex; gap: 6px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.mock-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.mock-body { display: grid; grid-template-columns: 148px minmax(0, 1fr); min-height: 300px; }
@media (max-width: 480px) { .mock-body { grid-template-columns: 108px minmax(0, 1fr); } }
.mock-menu { background: var(--sunk); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.mock-menu div { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock-menu div b { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.mock-menu .on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.mock-main { padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mock-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: var(--surface); min-width: 0; }
.mock-card .k { font-size: 12px; font-weight: 500; color: var(--muted); }
.mock-card .v { font-weight: 600; color: var(--ink); margin-top: 4px; font-variant-numeric: tabular-nums; }
.mock-card .row { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--ok-soft); color: var(--ok); }
.bar { height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; width: 72%; background: linear-gradient(90deg, var(--c-comisiones), var(--cyan)); border-radius: 3px; }

/* ---------- secciones ---------- */
section.band { padding-block: 104px; position: relative; }
section.band.sunk { background: var(--sunk); }
section.band.dark { background: var(--navy); color: #adbdcc; }
section.band.dark h2, section.band.dark b { color: #fff; }
section.band.dark .sub { color: #adbdcc; }
@media (max-width: 700px) { section.band { padding-block: 72px; } }
.section-head { max-width: 640px; margin-bottom: 48px; }

/* catálogo de apps */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.app-card { position: relative; background: var(--surface); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 8px; min-width: 0; color: inherit; font-weight: 400; box-shadow: var(--shadow-sm); }
.app-card:hover { color: inherit; box-shadow: var(--shadow); }
@media (prefers-reduced-motion: no-preference) { .app-card { transition: box-shadow .2s, transform .2s; } .app-card:hover { transform: translateY(-2px); } }
.app-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; border-radius: 8px 8px 0 0; background: var(--c, var(--accent)); }
.app-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--c-soft, var(--accent-soft)); color: var(--c, var(--accent)); }
.app-icon svg { width: 22px; height: 22px; }
.app-card h3 { margin: 10px 0 0; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.app-card p { margin: 0; color: var(--text); font-size: 16px; }
.status { position: absolute; top: 26px; right: 24px; font: 600 12px/1 var(--f); padding: 5px 8px; border-radius: 4px; }
.status.live { background: var(--ok-soft); color: var(--ok); }
.status.soon { background: var(--sunk); color: var(--muted); }
.app-card .more { margin-top: auto; padding-top: 10px; font-weight: 600; font-size: 15px; color: var(--c, var(--accent)); display: inline-flex; align-items: center; gap: 6px; }
.app-card .more::after { content: ""; width: 6px; height: 6px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); }
.app-backup { --c: var(--c-backup); --c-soft: var(--c-backup-soft); }
.app-gerente { --c: var(--c-gerente); --c-soft: var(--c-gerente-soft); }
.app-comisiones { --c: var(--c-comisiones); --c-soft: var(--c-comisiones-soft); }
.app-helpdesk { --c: var(--c-helpdesk); --c-soft: var(--c-helpdesk-soft); }
.app-agente { --c: var(--c-agente); --c-soft: var(--c-agente-soft); }
.app-voz { --c: var(--c-voz); --c-soft: var(--c-voz-soft); }

/* listas con filete a la izquierda (pasos y funciones) */
.steps, .features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px 32px; counter-reset: step; }
.step, .features > div { position: relative; padding-left: 16px; border-left: 1px solid var(--line); min-width: 0; }
.step::before, .features > div::before { content: ""; position: absolute; left: -1px; top: 4px; height: 18px; width: 1px; background: var(--c, var(--accent)); }
.step { counter-increment: step; }
.step h3::before { content: "0" counter(step); display: block; font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.step h3, .features h3 { margin: 0 0 6px; font-size: 16px; }
.step p, .features p { margin: 0; color: var(--text); font-size: 15px; line-height: 1.6; }

/* seguridad (banda oscura) */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 36px 32px; }
.sec { padding-left: 16px; border-left: 1px solid #1f4266; position: relative; min-width: 0; }
.sec::before { content: ""; position: absolute; left: -1px; top: 4px; height: 18px; width: 1px; background: var(--cyan); }
.sec b { display: block; font-weight: 600; font-size: 16px; margin-bottom: 6px; }
.sec span { font-size: 15px; line-height: 1.6; }

/* precios */
.cycle { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--line); margin-bottom: 24px; }
.cycle button, .tabs button { border: 0; background: none; font: 600 14px/1 var(--f); color: var(--text); padding: 9px 16px; border-radius: 999px; cursor: pointer; }
.cycle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.tabs button { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); box-shadow: none; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; align-items: start; }
.plan { background: var(--surface); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 10px; min-width: 0; box-shadow: var(--shadow-sm); }
.plan.featured { box-shadow: var(--shadow); outline: 2px solid var(--accent); }
.plan .tag { align-self: flex-start; font: 600 12px/1 var(--f); padding: 5px 8px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); }
.plan h3 { margin: 0; font-size: 18px; }
.price { font: 700 40px/1 var(--f); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.04em; }
.price small { font: 500 15px/1 var(--f); color: var(--muted); letter-spacing: 0; }
.alt-price { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.plan ul { margin: 8px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); list-style: none; color: var(--text); display: flex; flex-direction: column; gap: 9px; font-size: 15px; }
.plan li { padding-left: 24px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 3px; top: .5em; width: 10px; height: 5px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.trial { font-size: 13px; font-weight: 600; color: var(--ok); }
.soon-box { background: var(--surface); border-radius: var(--radius); padding: 28px; color: var(--text); box-shadow: var(--shadow-sm); max-width: 640px; }
.soon-box p { margin: 0; }
.fineprint { font-size: 14px; color: var(--muted); margin-top: 26px; max-width: 74ch; }
[data-cycle-show="yearly"] { display: none; }
.is-yearly [data-cycle-show="yearly"] { display: block; }
.is-yearly [data-cycle-show="monthly"] { display: none; }

/* FAQ */
.faq { max-width: 760px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); padding: 20px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-top: 6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
@media (prefers-reduced-motion: no-preference) { .faq summary::after { transition: transform .2s; } }
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: 10px; }
.faq details p { margin: -6px 0 20px; color: var(--text); max-width: 62ch; }

/* llamada final */
.cta { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: end; }
.cta h2 { margin-top: 0; }
.cta p { margin: 0; color: var(--text); font-size: 18px; max-width: 34em; }
.cta > a { justify-self: start; }
@media (max-width: 760px) { .cta { grid-template-columns: minmax(0, 1fr); } }

/* página de app */
.app-hero { padding-block: 56px 72px; }
.app-hero .app-icon { width: 52px; height: 52px; border-radius: 12px; box-shadow: var(--shadow-sm); background: var(--surface); }
.app-hero .app-icon svg { width: 28px; height: 28px; }
.back { display: inline-flex; margin-bottom: 30px; color: var(--ink); font-size: 15px; }
.problem { font-size: clamp(20px, 2.4vw, 26px); line-height: 1.45; color: var(--ink); letter-spacing: -0.02em; margin: 10px 0 0; font-weight: 500; }

/* legales */
.legal { padding-block: 40px 96px; }
.legal h1 { font-size: clamp(34px, 4.4vw, 52px); }
.legal h2 { font-size: 22px; margin-top: 40px; letter-spacing: -0.02em; }
.legal p, .legal li { max-width: 70ch; }
.meta { font-size: 14px; color: var(--muted); }

/* pie */
footer.site { background: var(--sunk); padding-block: 64px 56px; color: var(--muted); font-size: 14px; }
footer.site .cols { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
@media (max-width: 760px) { footer.site .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
footer.site h4 { margin: 4px 0 14px; font-size: 14px; font-weight: 600; color: var(--ink); }
footer.site ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
footer.site a { color: var(--text); font-weight: 400; }
footer.site a:hover { color: var(--ink); }
footer.site a.brand { color: var(--ink); font-weight: 700; }
footer.site .legal-line { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }

/* comparación de planes */
.plan-for { margin: -2px 0 4px; font-size: 14px; color: var(--muted); }
.compare-h { font-size: 22px; letter-spacing: -0.02em; margin: 64px 0 18px; }
.compare-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.compare { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; }
.compare th, .compare td { padding: 14px 18px; border-bottom: 1px solid var(--line); text-align: center; }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare th[scope="row"], .compare thead th:first-child { text-align: left; font-weight: 500; color: var(--ink); }
.compare thead th { font-size: 14px; font-weight: 600; color: var(--ink); background: var(--sunk); }
.compare thead th.feat { color: var(--accent); }
.compare td { color: var(--ink); font-variant-numeric: tabular-nums; }
.compare .yes { display: inline-block; width: 12px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg) translateY(-2px); }
.compare .no { color: var(--muted); }
