:root {
  --bg: #0b1020;
  --bg-alt: #11182e;
  --card: #161f3a;
  --text: #e7ecf6;
  --muted: #9aa6c4;
  --brand: #5b8cff;
  --brand-2: #8b5cff;
  --accent: #2ee6a6;
  --border: #243054;
  --radius: 14px;
  --maxw: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.container.narrow { max-width: 680px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 750; letter-spacing: -.01em; }
h3 { font-size: 1.15rem; font-weight: 700; }

p { margin: 0 0 1rem; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.grad {
  background: linear-gradient(90deg, var(--brand), var(--brand-2) 60%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: .6rem;
}
.center { text-align: center; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* Botones */
.btn {
  display: inline-block;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #fff;
  padding: .7rem 1.3rem;
  border-radius: 999px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
  box-shadow: 0 6px 20px rgba(91, 140, 255, .25);
}
.btn:hover { transform: translateY(-2px); text-decoration: none; opacity: .95; }
.btn-large { padding: .95rem 1.8rem; font-size: 1.05rem; }
.btn-small { padding: .5rem 1rem; font-size: .9rem; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  box-shadow: none;
  color: var(--text);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(11, 16, 32, .8);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding-top: .8rem; padding-bottom: .8rem; }
.logo { color: var(--text); font-size: 1.25rem; font-weight: 700; display: inline-flex; align-items: center; }
.logo:hover { text-decoration: none; }
.logo-img { height: 40px; width: auto; display: block; }
@media (max-width: 520px) { .logo-img { height: 34px; } }
.site-header nav { display: flex; align-items: center; gap: 1.3rem; }
.site-header nav a { color: var(--muted); font-weight: 600; font-size: .95rem; }
.site-header nav a:hover { color: var(--text); text-decoration: none; }
.site-header nav a.btn { color: #fff; }

/* Botón hamburguesa (oculto en escritorio) */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  cursor: pointer;
  align-items: center; justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.nav-toggle:hover { background: rgba(255,255,255,.08); }
.nav-toggle-bar { position: relative; }
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block; width: 20px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease, background .25s ease;
}
.nav-toggle-bar::before,
.nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { top: 0; transform: rotate(-45deg); }

/* Hero */
.hero { padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5rem); text-align: center; background: radial-gradient(1200px 500px at 50% -10%, rgba(91,140,255,.18), transparent 70%); }
.hero .lead { font-size: clamp(1.1rem, 2.2vw, 1.35rem); color: var(--muted); max-width: 680px; margin-inline: auto; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin: 2rem 0 1rem; }
.hero-note { color: var(--muted); font-size: .9rem; }

/* Secciones */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section h2 { margin-bottom: 1.5rem; }
.section .lead { color: var(--muted); }

/* Grids y tarjetas */
.grid { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--muted); margin: 0; }
.card-icon { font-size: 1.8rem; margin-bottom: .6rem; }
.feature { transition: transform .15s ease, border-color .15s ease; }
.feature:hover { transform: translateY(-3px); border-color: var(--brand); }

/* Pasos */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; counter-reset: step; }
.steps li { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem 1.5rem 1.5rem; position: relative; }
.step-num {
  display: inline-grid; place-items: center;
  width: 2.4rem; height: 2.4rem;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 800; font-size: 1.1rem;
  margin-bottom: .8rem;
}
.steps p { color: var(--muted); margin: 0; }

/* Precios */
.pricing .price { display: flex; flex-direction: column; }
.price-tag { font-size: 1.8rem; font-weight: 800; color: var(--text); margin: .3rem 0 1rem; }
.price-tag span { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); }
.price ul { list-style: none; padding: 0; margin: 0 0 1.5rem; flex: 1; }
.price li { padding: .4rem 0 .4rem 1.6rem; position: relative; color: var(--muted); }
.price li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }
.price .btn { width: 100%; text-align: center; }
.price.featured { border-color: var(--brand); box-shadow: 0 10px 40px rgba(91,140,255,.18); position: relative; }
.badge { position: absolute; top: -.8rem; left: 50%; transform: translateX(-50%); background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff; font-size: .75rem; font-weight: 700; padding: .25rem .8rem; border-radius: 999px; margin: 0; }

/* Formulario */
.contact-form { margin-top: 2rem; display: grid; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.contact-form label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 600; color: var(--muted); }
.contact-form input, .contact-form textarea {
  font: inherit;
  padding: .75rem .9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  width: 100%;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.form-status { display: none; margin-bottom: 1rem; padding: .9rem 1.1rem; border-radius: 12px; font-weight: 600; }
.form-status.ok { display: block; background: rgba(46,230,166,.12); border: 1px solid rgba(46,230,166,.4); color: #aef5db; }
.form-status.err { display: block; background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.4); color: #ffc9c9; }
.contact-form .form-check { display: flex !important; flex-direction: row; align-items: flex-start; justify-content: flex-start; gap: .55rem; font-weight: 500; color: var(--muted); font-size: .88rem; text-align: left; }
.contact-form .form-check input { width: auto; flex: 0 0 auto; margin: .2rem 0 0; }
.contact-form .form-check span { flex: 1; }
.contact-form .form-check a { color: var(--brand); }
.contact-form .btn { justify-self: start; }
.form-note { text-align: center; color: var(--muted); font-size: .9rem; margin: .5rem 0 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 2.8rem 0 1.8rem; margin-top: 3rem; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 1.6rem 2.5rem; align-items: start; }
.muted { color: var(--muted); }
.site-footer p { margin: 0; }
.footer-brand { max-width: 380px; }
.footer-logo { height: 46px; width: auto; display: block; margin-bottom: .2rem; }
.footer-brand .muted { font-size: .9rem; margin-top: .45rem; line-height: 1.55; }
.footer-nav { display: flex; flex-wrap: wrap; gap: .5rem .85rem; align-items: center; justify-content: flex-end; font-size: .9rem; }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--text); }
.footer-nav .sep { color: var(--border); }
.footer-legal { grid-column: 1 / -1; border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 1.3rem; text-align: center; font-size: .85rem; }
@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav { justify-content: flex-start; }
  .footer-legal { text-align: left; }
}

/* ===== Páginas legales ===== */
.legal-hero { padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem; background: radial-gradient(900px 400px at 30% -20%, rgba(91,140,255,.16), transparent 70%); }
.legal-hero h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.legal-hero .lead { color: var(--muted); max-width: 720px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .9rem; color: var(--muted); margin-bottom: 1.4rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--text); }

.legal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.6rem);
}
.legal-card h2 { font-size: 1.25rem; margin: 2rem 0 .6rem; }
.legal-card h2:first-of-type { margin-top: .5rem; }
.legal-card h3 { font-size: 1.05rem; margin: 1.4rem 0 .5rem; }
.legal-card p { color: var(--muted); }
.legal-card ul { color: var(--muted); margin: 0 0 1rem 1.2rem; }
.legal-card li { margin-bottom: .5rem; }
.legal-card a { color: var(--brand); text-decoration: underline; }
.legal-card a:hover { color: var(--brand-2); }
.legal-card strong { color: var(--text); }

.legal-updated {
  display: inline-block;
  font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  padding: .35rem .8rem; border-radius: 999px;
  margin: 0 0 1.4rem;
}

.data-table { display: grid; gap: .7rem; margin: 1.2rem 0; }
.data-row { display: grid; grid-template-columns: 200px 1fr; gap: 1rem; padding: .9rem 1.1rem; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; }
.data-row strong { color: var(--text); }
.data-row span { color: var(--muted); word-break: break-word; }

.info-box { background: rgba(91,140,255,.08); border: 1px solid rgba(91,140,255,.25); border-radius: 12px; padding: 1.1rem 1.2rem; margin: 1.2rem 0; }
.info-box p { margin: 0; color: var(--text); }

.cookie-grid { display: grid; gap: .7rem; margin: 1.2rem 0; }
.cookie-row { display: grid; gap: .25rem; padding: 1rem 1.1rem; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; }
.cookie-row strong { color: var(--text); }
.cookie-row span { color: var(--muted); }

@media (max-width: 560px) {
  .data-row { grid-template-columns: 1fr; gap: .25rem; }
}

/* ===== Blog ===== */
.blog-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; margin-top: 1rem; }
.post-card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; transition: transform .15s ease, border-color .15s ease;
}
.post-card:hover { transform: translateY(-3px); border-color: var(--brand); text-decoration: none; }
.post-cat { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: .6rem; }
.post-card h2, .post-card h3 { font-size: 1.2rem; margin: 0 0 .5rem; color: var(--text); line-height: 1.3; }
.post-card p { color: var(--muted); margin: 0 0 1rem; flex: 1; }
.post-meta { font-size: .8rem; color: var(--muted); }
.post-readmore { color: var(--brand); font-weight: 700; font-size: .9rem; margin-top: .8rem; }

/* Artículo (prosa) — reutiliza .legal-card como contenedor */
.article-hero h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); max-width: 800px; }
.article-meta { color: var(--muted); font-size: .9rem; margin-top: .8rem; }
.article p { color: #cdd6ec; }
.article h2 { font-size: 1.45rem; margin: 2rem 0 .7rem; }
.article h3 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.article ul, .article ol { color: #cdd6ec; margin: 0 0 1.2rem 1.2rem; }
.article li { margin-bottom: .55rem; }
.article a { color: var(--brand); text-decoration: underline; }
.article a:hover { color: var(--brand-2); }
.article strong { color: var(--text); }
.article .lead { font-size: 1.15rem; color: var(--muted); }
.article blockquote { margin: 1.4rem 0; padding: 1rem 1.3rem; border-left: 3px solid var(--brand); background: rgba(91,140,255,.07); border-radius: 0 10px 10px 0; color: var(--text); }
.article code { background: rgba(255,255,255,.06); border: 1px solid var(--border); border-radius: 6px; padding: .1rem .4rem; font-size: .9em; }
.article-cta { margin-top: 2.5rem; text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }
.article-cta h2 { margin-top: 0; }

@media (max-width: 700px) { .blog-grid { grid-template-columns: 1fr; } }

/* Responsive */
@media (max-width: 820px) {
  .grid-2, .grid-3, .steps, .pricing { grid-template-columns: 1fr; }

  /* Menú móvil: hamburguesa + panel desplegable */
  .nav-toggle { display: inline-flex; }
  .site-header nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(11, 16, 32, .98);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0,0,0,.4);
    padding: .25rem 1.25rem 1rem;
    max-height: 0; overflow: hidden;
    opacity: 0; visibility: hidden;
    transition: max-height .3s ease, opacity .25s ease, visibility .25s;
  }
  .site-header nav.open { max-height: 85vh; overflow: auto; opacity: 1; visibility: visible; }
  .site-header nav a { padding: .95rem .2rem; font-size: 1rem; border-bottom: 1px solid var(--border); }
  .site-header nav a.btn { margin-top: .9rem; text-align: center; border-bottom: none; }
}
@media (max-width: 520px) {
  .form-row { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-brand { max-width: none; }
  .footer-nav { justify-content: center; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
  .err-links { flex-direction: column; }
  .err-links .btn { width: 100%; }
}

/* ===== Hero en dos columnas + demo de chat ===== */
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2.5rem; align-items: center; text-align: left; }
.hero-grid .hero-cta { justify-content: flex-start; }
.hero-grid .lead { margin-inline: 0; }

.hero-demo { perspective: 1000px; }
.chat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  overflow: hidden;
  transform: rotateY(-6deg) rotateX(3deg);
  transition: transform .4s ease;
}
.hero-demo:hover .chat { transform: rotateY(0) rotateX(0); }
.chat-head {
  display: flex; align-items: center; gap: .5rem;
  padding: .9rem 1.1rem;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border);
  font-size: .85rem; font-weight: 700; color: var(--muted);
}
.chat-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
.chat-body { padding: 1.1rem; min-height: 280px; display: flex; flex-direction: column; gap: .8rem; }

.msg { max-width: 85%; padding: .7rem .95rem; border-radius: 14px; font-size: .92rem; line-height: 1.45; opacity: 0; transform: translateY(8px); animation: msgIn .35s ease forwards; }
@keyframes msgIn { to { opacity: 1; transform: translateY(0); } }
.msg.user { align-self: flex-end; background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 4px; }
.msg.ai .hl { color: var(--accent); font-weight: 700; }
.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,60%,100% { opacity: .25; } 30% { opacity: 1; } }

/* ===== Banda de estadísticas ===== */
.stats-band { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 2.5rem 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; text-align: center; }
.stat { display: flex; flex-direction: column; gap: .3rem; }
.stat-num { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; background: linear-gradient(90deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { font-size: .85rem; color: var(--muted); }

/* ===== Animaciones al hacer scroll ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.stagger > * { opacity: 0; transform: translateY(24px); transition: opacity .5s ease, transform .5s ease; }
.stagger.in > * { opacity: 1; transform: none; }
.stagger.in > *:nth-child(2) { transition-delay: .08s; }
.stagger.in > *:nth-child(3) { transition-delay: .16s; }
.stagger.in > *:nth-child(4) { transition-delay: .24s; }
.stagger.in > *:nth-child(5) { transition-delay: .32s; }
.stagger.in > *:nth-child(6) { transition-delay: .40s; }

/* ===== Nav activo ===== */
.site-header nav a.active { color: var(--text); }
.site-header nav a.active::after { content: ""; display: block; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); margin-top: 2px; }

/* ===== FAQ desplegable ===== */
.faq-cat { font-size: 1.2rem; margin: 2.5rem 0 .2rem; display: flex; align-items: center; gap: .5rem; }
.faq-cat:first-of-type { margin-top: 1rem; }
.faq { margin-top: 1rem; display: grid; gap: .8rem; }
.faq-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 1.2rem; transition: border-color .15s ease; }
.faq-item[open] { border-color: var(--brand); }
.faq-item summary { cursor: pointer; list-style: none; padding: 1.1rem 0; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.4rem; font-weight: 400; color: var(--brand); transition: transform .2s ease; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { color: var(--muted); margin: 0 0 1.1rem; }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-grid .hero-cta { justify-content: center; }
  .hero-grid .lead { margin-inline: auto; }
  .hero-demo { max-width: 420px; margin: 0 auto; }
  .chat { transform: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .reveal, .stagger > * { opacity: 1 !important; transform: none !important; }
  .chat { transform: none; }
}

/* El texto de los botones siempre en blanco y sin subrayado,
   aunque estén dentro de .legal-card o .article (que pintan los enlaces de azul). */
a.btn, a.btn:hover, a.btn:focus,
.legal-card a.btn, .article a.btn { color: #fff; text-decoration: none; }
