/* Estilos de la landing. Los colores/tipografías salen de brand.css (tokens). */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-sans); line-height: 1.6; -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--on-brand); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px; font-weight: 600; font-size: 1rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  font-family: inherit; text-decoration: none !important;
}
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: var(--on-brand); box-shadow: 0 8px 22px rgba(52,152,219,.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(52,152,219,.45); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-elev); }
.btn-lg { padding: 1rem 1.8rem; font-size: 1.05rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; text-decoration: none !important; }
.brand img { width: 34px; height: 34px; }
.nav-links { display: none; gap: 26px; align-items: center; }
.nav-links a { color: var(--text-muted); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
@media (min-width: 900px) { .nav-links { display: flex; } }
.nav .btn { padding: .55rem 1.1rem; font-size: .92rem; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 72px 0 40px; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 90%; z-index: -1;
  background: radial-gradient(600px 360px at 20% 20%, var(--hero-glow-1), transparent 70%),
              radial-gradient(520px 340px at 85% 10%, var(--hero-glow-2), transparent 70%);
}
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr .95fr; } .hero { padding-top: 96px; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; font-size: .85rem; margin-bottom: 20px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(34,160,107,.2); }
.hero h1 { font-size: clamp(2.2rem, 5.2vw, 3.7rem); font-weight: 800; }
.gradient-text { background: linear-gradient(120deg, var(--brand), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-muted); max-width: 56ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 22px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; list-style: none; color: var(--text-muted); font-size: .92rem; }
.hero-points li::before { content: "✓"; color: var(--success); font-weight: 800; margin-right: 6px; }

/* Secciones */
section { padding: 84px 0; }
.section-alt { background: var(--bg-sunken); }
.section-head { max-width: 720px; margin: 0 auto 52px; text-align: center; }
.section-head .kicker { color: var(--brand-strong); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; margin-bottom: 10px; }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 800; }
.section-head p { color: var(--text-muted); font-size: 1.08rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 44px 0; color: var(--text-muted); font-size: .92rem; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
.footer-grid nav { display: flex; gap: 20px; flex-wrap: wrap; }

/* Animaciones de entrada (las controla app.js; sin JS todo queda visible) */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal[data-delay="1"] { transition-delay: .08s; }
.js .reveal[data-delay="2"] { transition-delay: .16s; }
.js .reveal[data-delay="3"] { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ===== Clientes ===== */
.clients { padding: 28px 0 56px; }
.clients-title { text-align: center; color: var(--text-muted); font-size: .9rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 20px; }
.client-logos { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .client-logos { grid-template-columns: repeat(4, 1fr); } }
.client-logo {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 76px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev); color: var(--text); text-align: center; padding: 10px;
}
.client-logo span { color: var(--text-muted); font-size: .8rem; }
.client-logo.ghost { border-style: dashed; background: transparent; }

/* ===== Cómo funciona ===== */
.steps { list-style: none; margin: 0 0 36px; padding: 0; display: grid; gap: 20px; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); position: relative; }
.step-n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--accent-2)); color: var(--on-brand); font-weight: 800; font-family: var(--font-display); margin-bottom: 14px; }
.step h3 { font-size: 1.2rem; }
.step p { color: var(--text-muted); margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.embed { background: #0b1626; color: #cfe6fa; border-radius: var(--radius); padding: 20px 24px; overflow-x: auto; margin: 0 auto; max-width: 720px; border: 1px solid #1d3047; box-shadow: var(--shadow); }

/* ===== Funciones ===== */
.feature-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }
.feature {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); }
.feature .ico { width: 46px; height: 46px; padding: 11px; border-radius: 13px; background: var(--brand-soft); color: var(--brand-strong); margin-bottom: 16px; }
.feature h3 { font-size: 1.1rem; margin-bottom: .4em; }
.feature p { color: var(--text-muted); margin: 0; font-size: .96rem; }

/* ===== Demo del widget ===== */
.demo-split { display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) { .demo-split { grid-template-columns: 1fr 1fr; } }
.kicker { color: var(--brand-strong); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; margin-bottom: 10px; }
.demo-split h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 800; }
.checks { list-style: none; padding: 0; margin: 0 0 26px; color: var(--text-muted); }
.checks li { margin-bottom: 8px; }
.checks li::before { content: "✓"; color: var(--success); font-weight: 800; margin-right: 10px; }

/* ===== Casos ===== */
.cases { display: grid; gap: 18px; }
@media (min-width: 860px) { .cases { grid-template-columns: repeat(3, 1fr); } }
.case { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; border-top: 4px solid var(--brand); }
.case p { color: var(--text-muted); margin: 0; }

/* ===== Seguridad ===== */
.security { display: grid; gap: 44px; align-items: start; }
@media (min-width: 960px) { .security { grid-template-columns: .9fr 1.1fr; } }
.security h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 800; }
.sec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.sec-list li { background: var(--bg-elev); border: 1px solid var(--border); border-left: 4px solid var(--success); border-radius: var(--radius-sm); padding: 16px 20px; color: var(--text-muted); }
.sec-list strong { color: var(--text); }

/* ===== FAQ ===== */
.faq-wrap { max-width: 820px; }
.faq details { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; overflow: hidden; }
.faq summary { cursor: pointer; padding: 18px 22px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--brand-strong); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 22px 20px; margin: 0; color: var(--text-muted); }

/* ===== CTA / formulario ===== */
.cta { background: linear-gradient(135deg, #12304a, #1b2a6b); color: #fff; }
.cta .kicker { color: #9dd3f7; }
.cta h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 800; }
.cta .lead { color: #cfe0f1; }
.cta-grid { display: grid; gap: 44px; align-items: center; }
@media (min-width: 960px) { .cta-grid { grid-template-columns: 1fr 1fr; } }
.form { background: var(--bg-elev); color: var(--text); border-radius: var(--radius); padding: 28px; display: grid; gap: 14px; box-shadow: var(--shadow-lg); }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
.form input, .form textarea {
  font: inherit; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
}
.form input:focus-visible, .form textarea:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
.form input[aria-invalid="true"] { border-color: #d64545; }
.form-status { margin: 0; min-height: 1.4em; font-size: .92rem; }
.form-status.ok { color: var(--success); }
.form-status.err { color: #d64545; }

/* ===== Maqueta del chat (hero y demo) ===== */
.chat {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg);
  overflow: hidden; max-width: 440px; margin-inline: auto; width: 100%; display: flex; flex-direction: column;
}
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: var(--on-brand); }
.chat-head img { width: 30px; height: 30px; background: #fff; border-radius: 50%; padding: 3px; }
.chat-head b { display: block; font-size: .95rem; line-height: 1.2; }
.chat-head small { opacity: .9; font-size: .75rem; }
.chat-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: 330px; background: var(--bg); }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 14px; font-size: .9rem; line-height: 1.4; animation: pop .35s ease both; }
.msg.user { align-self: flex-end; background: var(--brand-soft); color: var(--text); border-bottom-right-radius: 4px; border: 1px solid var(--border); }
.msg.bot { align-self: flex-start; background: var(--bg-elev); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.sys { align-self: center; background: transparent; color: var(--text-muted); font-size: .78rem; padding: 2px 8px; }
.pcard {
  align-self: flex-start; width: 82%; display: flex; gap: 10px; align-items: center; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: 12px; padding: 8px; animation: pop .35s ease both;
}
.pcard .thumb { width: 48px; height: 48px; flex: none; border-radius: 8px; background: linear-gradient(135deg, var(--brand-soft), var(--bg-sunken)); display: grid; place-items: center; color: var(--brand-strong); font-weight: 800; }
.pcard b { display: block; font-size: .86rem; }
.pcard span { font-size: .78rem; color: var(--text-muted); }
.pcard em { font-style: normal; font-size: .72rem; color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); border-radius: 99px; padding: 1px 8px; margin-left: 6px; }
.typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 11px 14px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: blink 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
.chat-foot { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--bg-elev); }
.chat-foot span { flex: 1; font-size: .85rem; color: var(--text-muted); padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; }
.chat-foot b { background: var(--brand); color: var(--on-brand); border-radius: 10px; padding: 9px 14px; font-size: .85rem; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-note { display: block; text-align: center; font-size: .72rem; color: var(--text-muted); padding: 6px 0 10px; background: var(--bg-elev); }
.sprite { position: absolute; width: 0; height: 0; }
