/* ==========================================================================
   Lapsi.mx — Plataforma clínica (SaaS) · hoja de estilos del sitio público
   Mismo lenguaje visual que el sitio anterior: tema oscuro + glassmorphism
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --bg-dark: hsl(222, 47%, 6%);
  --bg-dark-card: hsla(222, 47%, 10%, 0.55);
  --border-light: hsla(220, 14%, 96%, 0.08);
  --border-glow: hsla(263, 95%, 68%, 0.28);

  --primary: hsl(263, 90%, 65%);
  --primary-light: hsl(263, 95%, 76%);
  --secondary: hsl(190, 95%, 45%);
  --secondary-light: hsl(190, 95%, 62%);
  --accent: hsl(340, 95%, 60%);

  --text-main: hsl(0, 0%, 100%);
  --text-muted: hsl(215, 20%, 75%);

  --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --shadow-glow: 0 10px 36px rgba(99, 102, 241, 0.18);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 16px;
  --container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
}

/* Halos de fondo */
body::before,
body::after {
  content: '';
  position: fixed;
  width: 48vw;
  height: 48vw;
  z-index: -1;
  pointer-events: none;
  filter: blur(90px);
}
body::before { top: -14%; left: -12%; background: radial-gradient(circle, hsla(263, 90%, 65%, 0.16) 0%, transparent 70%); }
body::after { bottom: -16%; right: -12%; background: radial-gradient(circle, hsla(190, 95%, 45%, 0.13) 0%, transparent 70%); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

h1, h2, h3 { font-family: var(--font-title); line-height: 1.15; letter-spacing: -0.01em; }

.scroll-mt { scroll-margin-top: 92px; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { max-width: 860px; }
.muted { color: var(--text-muted); }
.small { font-size: 0.86rem; }
.text-gradient {
  background: linear-gradient(100deg, var(--primary-light), var(--secondary-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.glass-panel {
  background: var(--bg-dark-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ===== Header ===== */
.main-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding: 1rem 0;
  transition: var(--transition);
  background: transparent;
}
.main-header.scrolled {
  padding: 0.55rem 0;
  background: hsla(222, 47%, 6%, 0.88);
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(14px);
}
.navbar { display: flex; align-items: center; gap: 1.5rem; }
.logo { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-title); font-weight: 700; font-size: 1.15rem; }
.logo-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), hsl(280, 90%, 55%));
  font-size: 1.2rem;
  box-shadow: var(--shadow-glow);
}
.logo-text span { color: var(--primary-light); }

.nav-links { display: flex; gap: 1.4rem; margin-left: auto; }
.nav-links a { font-size: 0.94rem; color: var(--text-muted); transition: var(--transition); }
.nav-links a:hover { color: var(--text-main); }

.nav-actions { display: flex; gap: 0.6rem; align-items: center; }

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.4rem;
}
.mobile-menu-btn span { display: block; width: 22px; height: 2.5px; background: var(--text-main); border-radius: 2px; transition: var(--transition); }

/* ===== Botones ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-lg { padding: 0.9rem 1.8rem; font-size: 1.02rem; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), hsl(285, 85%, 58%));
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-secondary {
  background: hsla(190, 95%, 45%, 0.12);
  border-color: hsla(190, 95%, 45%, 0.45);
  color: var(--secondary-light);
}
.btn-secondary:hover { background: hsla(190, 95%, 45%, 0.22); transform: translateY(-2px); }
.btn-ghost { color: var(--text-muted); border-color: var(--border-light); }
.btn-ghost:hover { color: var(--text-main); border-color: var(--border-glow); }

/* ===== Hero ===== */
.hero-section { padding: 9.5rem 0 4rem; }
.hero-content { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.badge-pill {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.42rem 1rem;
  border: 1px solid var(--border-glow);
  border-radius: 999px;
  background: hsla(263, 90%, 65%, 0.10);
  font-size: 0.83rem;
  color: var(--text-muted);
}
.badge-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--secondary-light); box-shadow: 0 0 10px var(--secondary-light); }
.hero-title { font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-weight: 800; }
.hero-description { max-width: 760px; font-size: 1.06rem; color: var(--text-muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 0.4rem; }
.hero-actions.center { justify-content: center; }

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; width: 100%; margin-top: 2.6rem; text-align: left; }
.feature-card { padding: 1.5rem; transition: var(--transition); }
.feature-card:hover { transform: translateY(-4px); border-color: var(--border-glow); }
.feature-icon {
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 13px; margin-bottom: 0.9rem;
  background: linear-gradient(135deg, hsla(263, 90%, 65%, 0.28), hsla(190, 95%, 45%, 0.22));
  font-family: var(--font-title); font-size: 1.25rem; font-weight: 700;
}
.feature-card h3 { font-size: 1.06rem; margin-bottom: 0.4rem; }
.feature-card p { font-size: 0.92rem; color: var(--text-muted); }

/* ===== Secciones ===== */
.section { padding: 3.6rem 0; }
.section-header { text-align: center; max-width: 800px; margin: 0 auto 2.4rem; }
.section-subtitle {
  display: inline-block; margin-bottom: 0.6rem;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--secondary-light);
}
.section-title { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin-bottom: 0.7rem; }
.section-header p { color: var(--text-muted); }

.grid-3, .grid-2 { display: grid; gap: 1.1rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card { padding: 1.5rem; }
.card-title { font-size: 1.05rem; margin-bottom: 0.5rem; }
.card p { color: var(--text-muted); font-size: 0.94rem; }

/* ===== Módulos ===== */
.modules { grid-template-columns: repeat(3, 1fr); }
.module-card { padding: 1.35rem; transition: var(--transition); }
.module-card:hover { transform: translateY(-4px); border-color: var(--border-glow); }
.module-icon {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; margin-bottom: 0.75rem;
  border-radius: 11px;
  background: hsla(263, 90%, 65%, 0.16);
  border: 1px solid var(--border-glow);
  color: var(--primary-light);
  font-size: 1.05rem;
}
.module-card h3 { font-size: 1rem; margin-bottom: 0.35rem; }
.module-card p { font-size: 0.9rem; color: var(--text-muted); }


/* ===== Ciclo clínico (pasos) ===== */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.1rem; counter-reset: paso; }
.step { padding: 1.5rem 1.4rem 1.4rem; position: relative; transition: var(--transition); }
.step:hover { transform: translateY(-4px); border-color: var(--border-glow); }
.step-num {
  position: absolute; top: -14px; left: 1.3rem;
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), hsl(285, 85%, 58%));
  font-family: var(--font-title); font-weight: 700; font-size: 0.95rem;
  box-shadow: var(--shadow-glow);
}
.step h3 { font-size: 1rem; margin: 0.6rem 0 0.35rem; }
.step p { font-size: 0.9rem; color: var(--text-muted); }

/* ===== Paneles con listas ===== */
.panel-pad { padding: 1.6rem; }
.check-list li, .role-list li { padding-left: 1.6rem; position: relative; margin-bottom: 0.6rem; font-size: 0.93rem; color: var(--text-muted); }
.check-list li::before {
  content: '✓';
  position: absolute; left: 0; top: 0;
  color: var(--secondary-light); font-weight: 700;
}
.role-list strong { display: block; color: var(--text-main); font-size: 0.95rem; }
.role-list li::before {
  content: '';
  position: absolute; left: 0; top: 0.55rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--primary-light);
}
.role-list li { padding-left: 1.5rem; margin-bottom: 0.9rem; }
.role-list span { display: block; }

.note {
  margin-top: 1.8rem; text-align: center; font-size: 0.93rem; color: var(--text-muted);
  padding: 1rem 1.2rem; border: 1px dashed var(--border-light); border-radius: var(--radius);
}
.note a { color: var(--secondary-light); text-decoration: underline; }

/* ===== FAQ ===== */
.faq { padding: 1.1rem 1.3rem; margin-bottom: 0.8rem; }
.faq summary {
  cursor: pointer; font-family: var(--font-title); font-weight: 600; font-size: 1rem;
  list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.25rem; color: var(--primary-light); transition: var(--transition); }
.faq[open] summary::after { content: '−'; }
.faq p { margin-top: 0.7rem; color: var(--text-muted); font-size: 0.94rem; }
.faq a { color: var(--secondary-light); text-decoration: underline; }

/* ===== CTA final ===== */
.cta-final { padding-bottom: 5rem; }
.cta-box { padding: 2.6rem 1.8rem; text-align: center; border-color: var(--border-glow); }
.cta-box h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); margin-bottom: 0.6rem; }
.cta-box p { color: var(--text-muted); margin-bottom: 1.4rem; }

/* ===== Footer ===== */
.main-footer {
  border-top: 1px solid var(--border-light);
  padding: 3rem 0 2.2rem;
  background: hsla(222, 47%, 8%, 0.6);
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.5fr 1fr; gap: 1.6rem; }
.footer-brand p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.7rem; }
.footer-col h3 { font-size: 0.95rem; margin-bottom: 0.8rem; color: var(--text-main); }
.footer-col ul li { margin-bottom: 0.45rem; }
.footer-col a { color: var(--text-muted); font-size: 0.9rem; transition: var(--transition); }
.footer-col a:hover { color: var(--secondary-light); }
.footer-freeware a { font-weight: 600; color: var(--text-main); }
.footer-freeware span { display: block; margin-top: 0.15rem; }

/* ===== Scroll top ===== */
.scroll-top {
  position: fixed; right: 1.2rem; bottom: 1.2rem;
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--border-glow);
  background: hsla(263, 90%, 65%, 0.85); color: #fff;
  cursor: pointer; opacity: 0; pointer-events: none;
  transition: var(--transition);
}
.scroll-top.visible { opacity: 1; pointer-events: auto; }
.scroll-top:hover { transform: translateY(-3px); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .modules { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: hsla(222, 47%, 6%, 0.98);
    border-bottom: 1px solid var(--border-light);
    max-height: 0; overflow: hidden;
    transition: var(--transition);
  }
  .nav-links.open { max-height: 420px; padding: 0.5rem 0; }
  .nav-links a { padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border-light); }
  .mobile-menu-btn { display: flex; }
  .nav-actions .btn-ghost { display: none; }
  .features-grid, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero-section { padding-top: 8rem; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .modules { grid-template-columns: 1fr; }
  .btn-lg { padding: 0.8rem 1.4rem; font-size: 0.96rem; }
}


/* ===== Páginas legales (términos y privacidad) ===== */
.legal-page { padding: 8.5rem 0 4rem; }
.legal-page .legal-doc { max-width: 100%; }
.legal-page h1 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); margin-bottom: 0.5rem; }
.legal-page .legal-updated { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 1.8rem; }
.legal-page h2 { font-size: 1.32rem; margin: 2rem 0 0.7rem; }
.legal-page h3 { font-size: 1.08rem; margin: 1.5rem 0 0.5rem; }
.legal-page h4 { font-family: var(--font-title); font-size: 1rem; margin: 1.2rem 0 0.4rem; color: var(--text-main); }
.legal-page p, .legal-page li { color: var(--text-muted); font-size: 0.95rem; }
.legal-page ul, .legal-page ol { margin: 0.5rem 0 0 1.2rem; }
.legal-page ul { list-style: disc; }
.legal-page ol { list-style: decimal; }
.legal-page ul li, .legal-page ol li { margin-bottom: 0.35rem; }
.legal-page a { color: var(--secondary-light); text-decoration: underline; }
.legal-page .legal-box { padding: 1.4rem 1.6rem; margin-top: 2rem; }
.legal-page blockquote {
  margin: 1rem 0;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--primary);
  border-radius: 0 10px 10px 0;
  background: rgba(255, 255, 255, 0.04);
}
.legal-page blockquote p { margin: 0.2rem 0; }
.legal-page code {
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.88em;
  overflow-wrap: anywhere;
}
.legal-page hr { border: 0; border-top: 1px solid var(--border-light); margin: 2rem 0; }
.legal-page table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.legal-page th, .legal-page td {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border-light);
  text-align: left;
  vertical-align: top;
}
.legal-page th { background: rgba(255, 255, 255, 0.06); color: var(--text-main); font-weight: 600; }
.legal-page td { color: var(--text-muted); }
.legal-table-wrap {
  margin: 1rem 0;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}
.legal-table-wrap table { margin: 0; min-width: 620px; }
.legal-toc {
  margin: 1rem 0 1.6rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}
.legal-toc h2 { margin: 0 0 0.6rem; font-size: 1.08rem; }
.legal-toc ul { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 2rem; }
.legal-toc li { margin-bottom: 0.25rem; break-inside: avoid; }
.legal-toc a { color: var(--secondary-light); }
.legal-status {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-glow);
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--text-muted);
  font-size: 0.78rem;
}
.legal-simplificado {
  margin: 0 0 2.2rem;
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}
.legal-simplificado > h2:first-child { margin-top: 0; }
.legal-fold {
  margin: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}
.legal-fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  cursor: pointer;
  list-style: none;
}
.legal-fold > summary::-webkit-details-marker { display: none; }
.legal-fold > summary h1 { flex: 1; margin: 0; }
.legal-fold > summary::after {
  content: '+';
  flex: 0 0 auto;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--primary-light);
  transition: var(--transition);
}
.legal-fold[open] > summary::after { content: '−'; }
.legal-fold > summary:hover { background: rgba(255, 255, 255, 0.03); }
.legal-fold > summary:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
  border-radius: var(--radius);
}
.legal-fold__body { padding: 0 1.4rem 1.4rem; }
.legal-fold__body > blockquote:first-child { margin-top: 0; }
.legal-anchor { display: block; scroll-margin-top: 96px; }
.legal-page h1, .legal-page h2, .legal-page h3, .legal-page h4 { scroll-margin-top: 96px; }
@media (max-width: 700px) {
  .legal-toc ul { columns: 1; }
  .legal-page { padding-top: 7.5rem; }
  .legal-fold > summary { padding: 0.9rem 1rem; }
  .legal-fold__body { padding: 0 1rem 1rem; }
}

@media print {
  body { background: #fff !important; color: #111 !important; }
  body::before, body::after, .main-header, .main-footer, .scroll-top { display: none !important; }
  .legal-page { padding: 0 !important; }
  .legal-page h1, .legal-page h2, .legal-page h3, .legal-page h4,
  .legal-page p, .legal-page li, .legal-page td, .legal-page th { color: #111 !important; }
  .legal-page a { color: #0b5fff !important; }
  .legal-toc, .legal-simplificado, .legal-status, .legal-page blockquote,
  .legal-table-wrap { border-color: #ccc !important; background: #fff !important; }
  .legal-page th { background: #f2f2f2 !important; }
  .legal-page table { font-size: 9pt; }
  .legal-fold { border: 0 !important; background: #fff !important; }
  .legal-fold > summary { padding: 0 !important; }
  .legal-fold > summary::after { display: none !important; }
  .legal-fold > summary h1 { margin: 0 0 0.5rem !important; }
  .legal-fold__body,
  .legal-fold:not([open]) > .legal-fold__body {
    display: block !important;
    padding: 0 !important;
    content-visibility: visible !important;
  }
  .legal-fold__body > blockquote:first-child { margin-top: 1rem !important; }
  .legal-page h2, .legal-page h3, .legal-page h4 { page-break-after: avoid; }
  .legal-table-wrap { overflow: visible !important; }
  .legal-table-wrap table { min-width: 0 !important; }
}


/* ===== Ajustes comerciales de la portada ===== */
.hero-sub { color: var(--text-muted); font-size: 1.02rem; margin-top: -0.7rem; }
.grid-4 { display: grid; gap: 1.1rem; grid-template-columns: repeat(4, 1fr); }
.note-strong { border-style: solid; border-color: var(--border-glow); color: var(--text-main); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
}


/* ===== Cómo funciona (solo títulos) ===== */
.steps-titles { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.steps-titles .step { padding: 1.9rem 1.2rem 1.3rem; }
.steps-titles .step h3 { font-size: 0.98rem; margin: 0; line-height: 1.35; }

