:root {
  --bg: #ffffff;
  --bg-alt: #f8fafb;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #94a3b8;
  --primary: #14b8a6;
  --primary-dark: #0d9488;
  --primary-light: #f0fdfa;
  --primary-glow: rgba(20, 184, 166, 0.18);
  --accent: #f97316;
  --accent-light: #fff7ed;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);
  --radius: 14px;
  --radius-lg: 20px;
  --container: 92%;
  --marquee-speed: 28s;
  --font-heading: "Sora", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --topbar-bg: rgba(255, 255, 255, 0.92);
  --hero-gradient: linear-gradient(180deg, #f0fdfa 0%, #ffffff 100%);
  --accordion-open-bg: #fafffe;
  --accordion-open-border: #99f6e4;
  --pill-bg: #f0fdfa;
  --pill-border: #99f6e4;
  --plan-featured-bg: linear-gradient(180deg, var(--primary-light) 0%, #fff 60%);
  --footer-gradient: linear-gradient(135deg, var(--primary-dark) 0%, #0f766e 100%);
  --footer-text: rgba(255,255,255,0.8);
  --trial-color: var(--text-subtle);
}

/* ── Dark Mode ── */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --bg-card: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --primary-light: rgba(20, 184, 166, 0.12);
  --primary-glow: rgba(20, 184, 166, 0.25);
  --border: #334155;
  --border-strong: #475569;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.2);
  --shadow: 0 4px 16px rgba(0,0,0,0.3), 0 1px 4px rgba(0,0,0,0.2);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.25);
  --topbar-bg: rgba(15, 23, 42, 0.92);
  --hero-gradient: linear-gradient(180deg, #0f2a2a 0%, #0f172a 100%);
  --accordion-open-bg: rgba(20, 184, 166, 0.06);
  --accordion-open-border: #0d9488;
  --pill-bg: rgba(20, 184, 166, 0.12);
  --pill-border: #0d9488;
  --plan-featured-bg: linear-gradient(180deg, rgba(20, 184, 166, 0.12) 0%, var(--bg-card) 60%);
  --footer-gradient: linear-gradient(135deg, #134e4a 0%, #0f172a 100%);
  --footer-text: rgba(255,255,255,0.7);
  --trial-color: var(--text-muted);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary-dark);
}

[data-theme="dark"] .logo {
  color: var(--primary);
}

nav {
  position: absolute;
  top: 68px;
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem;
  box-shadow: var(--shadow);
}

nav.open {
  display: flex;
  align-items: flex-start;
}

nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  width: 100%;
  transition: color 0.15s ease;
}

nav a:hover {
  color: var(--text);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-card);
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
}

/* ── Theme toggle ── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-card);
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  background: var(--bg-alt);
}

/* ── Hero ── */
.hero {
  padding: 3rem 0 3.5rem;
  background: var(--hero-gradient);
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: start;
}

.pill {
  display: inline-flex;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--pill-border);
  background: var(--pill-bg);
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

[data-theme="dark"] .pill {
  color: var(--primary);
}

h1 {
  font-family: var(--font-heading);
  margin: 0.8rem 0;
  font-size: clamp(1.9rem, 7vw, 3.2rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

h1 span {
  color: var(--primary);
}

h2 {
  font-family: var(--font-heading);
  margin: 0 0 0.6rem;
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text);
}

.lead,
.section-lead {
  color: var(--text-muted);
  max-width: 64ch;
  line-height: 1.65;
  font-size: 1.05rem;
}

.hero-cta {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.hero-trial {
  font-size: 0.85rem;
  color: var(--trial-color);
  margin: 0.5rem 0 0;
}

.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  width: 100%;
}

.hero-card h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.hero-card ul {
  color: var(--text-muted);
  line-height: 1.85;
  padding-left: 1.1rem;
  margin: 0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid transparent;
  min-height: 46px;
  width: 100%;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-family: var(--font-body);
  font-size: 0.97rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-sm {
  min-height: 40px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-lg {
  padding: 0.95rem 1.5rem;
  min-height: 52px;
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 12px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-outline {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--bg-card);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-light);
}

[data-theme="dark"] .btn-outline:hover {
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.btn-white {
  background: #fff;
  color: var(--primary-dark);
  border-color: transparent;
  font-weight: 700;
}

.btn-white:hover {
  background: var(--primary-light);
}

[data-theme="dark"] .btn-white {
  background: #f1f5f9;
  color: #0d9488;
}

[data-theme="dark"] .btn-white:hover {
  background: #e2e8f0;
}

/* ── Hero metrics ── */
.hero-metrics {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.hero-metrics li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  box-shadow: var(--shadow-sm);
}

.hero-metrics strong {
  display: block;
  font-size: 1.3rem;
  font-family: var(--font-heading);
  color: var(--primary-dark);
}

[data-theme="dark"] .hero-metrics strong {
  color: var(--primary);
}

.hero-metrics span {
  font-size: 0.87rem;
  color: var(--text-muted);
}

/* ── Sections ── */
.section {
  padding: 3.2rem 0;
}

.section.alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ── Marquee ── */
.logos {
  padding: 1.5rem 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.logos-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.marquee {
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: max-content;
  animation: marqueeScroll var(--marquee-speed) linear infinite;
  padding: 0.5rem 0;
}

.marquee-track span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

/* ── Cards & Steps ── */
.cards,
.steps,
.testimonials {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.card,
.step,
.testimonial {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.card:hover,
.step:hover,
.testimonial:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.card p,
.step p,
.testimonial p {
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0.4rem 0 0;
}

.step-number {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

[data-theme="dark"] .step-number {
  color: var(--primary);
}

.testimonial {
  position: relative;
}

.testimonial p {
  font-style: italic;
  margin: 0 0 0.75rem;
}

.testimonial strong {
  font-size: 0.88rem;
  color: var(--text-subtle);
  font-style: normal;
}

/* ── Module tabs/accordion ── */
.module-tabs {
  display: none;
}

.module-accordion {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.module-accordion details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 0.75rem 1rem;
  transition: border-color 0.2s, background 0.2s;
}

.module-accordion details[open] {
  border-color: var(--accordion-open-border);
  background: var(--accordion-open-bg);
}

.module-accordion summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--text);
}

.module-accordion ul {
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.tab-panels {
  display: none;
}

/* ── Vertical tabs ── */
.vertical-tabs {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.vertical-btn,
.tab-btn {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  border-radius: 10px;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.vertical-btn:hover,
.tab-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.vertical-btn.active,
.tab-btn.active {
  background: var(--primary-light);
  border-color: #5eead4;
  color: var(--primary-dark);
}

[data-theme="dark"] .vertical-btn.active,
[data-theme="dark"] .tab-btn.active {
  border-color: var(--primary-dark);
  color: var(--primary);
}

.vertical-panels {
  margin-top: 1rem;
}

.vertical-panel {
  display: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.vertical-panel.active {
  display: block;
}

.vertical-panel h3 {
  margin-top: 0;
}

.vertical-panel p {
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

/* ── Plans ── */
.plans {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.plan {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.plan:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.plan.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow);
  background: var(--plan-featured-bg);
}

.plan-tag {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

[data-theme="dark"] .plan-tag {
  color: var(--primary);
}

.plan.featured .plan-tag::after {
  content: " · Más popular";
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0;
}

.plan h3 {
  margin: 0;
  font-size: 1.15rem;
}

.plan-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.plan-price {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.plan-price span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.plan ul {
  padding-left: 1.1rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin: 0;
  flex: 1;
}

.plan .btn {
  margin-top: auto;
}

/* ── FAQ ── */
.faq {
  margin-top: 1rem;
  display: grid;
  gap: 0.6rem;
}

.faq details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  transition: border-color 0.2s;
}

.faq details[open] {
  border-color: var(--accordion-open-border);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  min-height: 32px;
  display: flex;
  align-items: center;
}

.faq details p {
  color: var(--text-muted);
  margin: 0.5rem 0 0;
  line-height: 1.65;
}

/* ── Footer ── */
.footer {
  padding: 4rem 0 3.5rem;
}

.footer-wrap {
  background: var(--footer-gradient);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  color: #fff;
}

.footer-wrap h2 {
  color: #fff;
  margin: 0 0 0.5rem;
}

.footer-wrap p {
  color: var(--footer-text);
  max-width: 55ch;
  line-height: 1.6;
  margin: 0;
}

/* ── Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Marquee animation ── */
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Tablet (>=640px) ── */
@media (min-width: 640px) {
  .hero-cta {
    flex-direction: row;
  }

  .btn {
    width: auto;
  }

  .cards,
  .steps,
  .testimonials,
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .vertical-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .footer-wrap .btn {
    justify-self: start;
  }
}

/* ── Desktop (>=1024px) ── */
@media (min-width: 1024px) {
  .nav {
    min-height: 72px;
  }

  .menu-toggle {
    display: none;
  }

  nav {
    position: static;
    display: flex;
    flex-direction: row;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    gap: 1rem;
    align-items: center;
  }

  nav a {
    width: auto;
    min-height: auto;
  }

  .hero {
    padding: 4.5rem 0 5rem;
  }

  .hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
  }

  .section {
    padding: 4rem 0;
  }

  .cards,
  .steps,
  .testimonials {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .plans {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .module-accordion {
    display: none;
  }

  .module-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
  }

  .tab-btn {
    width: auto;
  }

  .tab-panels {
    display: block;
    margin-top: 1rem;
  }

  .tab-panel {
    display: none;
  }

  .tab-panel.active {
    display: block;
  }

  .tab-panel .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-wrap {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .footer-wrap .btn {
    justify-self: end;
  }
}

/* ── XL (>=1280px) ── */
@media (min-width: 1280px) {
  :root {
    --container: min(1200px, 90%);
    --marquee-speed: 22s;
  }

  .hero {
    padding: 5.5rem 0 6rem;
  }

  .hero-grid {
    gap: 2.5rem;
  }

  .section {
    padding: 4.5rem 0;
  }
}
