/* ==========================================================================
   InfoSec Demo Lab — Rediseño Corporate Trust
   Paleta: Azul #2563eb + Violeta #7c3aed
   Mobile-first | Inmersivo | Dark + Light theme (toggleable)
   ========================================================================== */

/* ---------- 1. Reset & Variables ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== TEMA OSCURO (por defecto) ===== */
:root {
  color-scheme: dark;

  /* Backgrounds */
  --bg-base: #0a0e1a;
  --bg-surface: #111827;
  --bg-elevated: #1a2236;
  --bg-card: #151d30;
  --bg-glass: rgba(17, 24, 39, 0.7);

  /* Borders */
  --border-subtle: rgba(148, 163, 184, 0.12);
  --border-default: rgba(148, 163, 184, 0.2);
  --border-strong: rgba(148, 163, 184, 0.35);

  /* Brand */
  --blue: #2563eb;
  --blue-bright: #3b82f6;
  --blue-hover: #1d4ed8;
  --violet: #7c3aed;
  --violet-bright: #8b5cf6;
  --violet-hover: #6d28d9;
  --gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --gradient-soft: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(124, 58, 237, 0.15) 100%);
  --gradient-text: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-on-brand: #ffffff;

  /* Status */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Background ambient grid + glow */
  --grid-color: rgba(148, 163, 184, 0.03);
  --glow-color: rgba(124, 58, 237, 0.12);
  --bg-navbar-glass: rgba(10, 14, 26, 0.7);
  --bg-navbar-solid: rgba(10, 14, 26, 0.95);
  --bg-hero-canvas: '10, 14, 26';
  --network-opacity: 0.6;
  --network-node-color: '167, 139, 250';
  --network-halo-color: '139, 92, 246';
  --network-line-blue: '37, 99, 235';
  --network-line-violet: '124, 58, 237';

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow-blue: 0 0 32px rgba(37, 99, 235, 0.4);
  --shadow-glow-violet: 0 0 32px rgba(124, 58, 237, 0.4);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --container-max: 1200px;
  --navbar-height: 70px;
}

/* ===== TEMA CLARO ===== */
/* Se activa cuando <html data-theme="light"> */
[data-theme="light"] {
  color-scheme: light;

  /* Backgrounds */
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-elevated: #f1f5f9;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.8);

  /* Borders */
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-default: rgba(15, 23, 42, 0.14);
  --border-strong: rgba(15, 23, 42, 0.25);

  /* Brand — más saturados para contraste sobre fondo claro */
  --blue: #2563eb;
  --blue-bright: #1d4ed8;
  --blue-hover: #1e40af;
  --violet: #7c3aed;
  --violet-bright: #6d28d9;
  --violet-hover: #5b21b6;
  --gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --gradient-soft: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
  --gradient-text: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-on-brand: #ffffff;

  /* Status — más oscuros para legibilidad */
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;

  /* Background ambient grid + glow (más sutiles en claro) */
  --grid-color: rgba(15, 23, 42, 0.04);
  --glow-color: rgba(124, 58, 237, 0.08);
  --bg-navbar-glass: rgba(255, 255, 255, 0.8);
  --bg-navbar-solid: rgba(248, 250, 252, 0.97);
  --bg-hero-canvas: '248, 250, 252';
  --network-opacity: 0.4;
  --network-node-color: '124, 58, 237';
  --network-halo-color: '139, 92, 246';
  --network-line-blue: '37, 99, 235';
  --network-line-violet: '124, 58, 237';

  /* Shadows — más definidas en claro */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --shadow-glow-blue: 0 0 32px rgba(37, 99, 235, 0.18);
  --shadow-glow-violet: 0 0 32px rgba(124, 58, 237, 0.18);
}

/* ---------- 2. Base Typography ---------- */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background ambient grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
  transition: background-image 0.4s var(--ease-out);
}

body::after {
  content: '';
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse at center, var(--glow-color) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  filter: blur(40px);
  transition: background 0.4s var(--ease-out);
}

/* ---------- Network Graph Background Canvas ---------- */
/* Canvas fijo que dibuja un grafo animado de nodos y aristas
   simulando una red. Sutil, no interactúa con el cursor. */
#network-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: var(--network-opacity);
  transition: opacity 0.4s var(--ease-out);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

a {
  color: var(--blue-bright);
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}

a:hover {
  color: var(--violet-bright);
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

/* ---------- 3. Layout Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  position: relative;
  z-index: 1;
}

.section {
  padding: var(--space-4xl) 0;
  position: relative;
  z-index: 1;
}

.section--tight {
  padding: var(--space-3xl) 0;
}

.section__header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-3xl);
}

.section__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--violet-bright);
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.25);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-lg);
}

.section__title {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  margin-bottom: var(--space-md);
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section__subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: var(--gradient);
  color: var(--text-on-brand);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn--primary:hover {
  color: var(--text-on-brand);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.5);
}

.btn--primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s var(--ease-out);
}

.btn--primary:hover::before {
  left: 100%;
}

.btn--secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn--secondary:hover {
  color: var(--text-primary);
  border-color: var(--blue-bright);
  background: rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn--ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn--lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.btn--block {
  width: 100%;
}

.btn--sm {
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
}

/* ---------- 5. Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  z-index: 1000;
  background: var(--bg-navbar-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.4s var(--ease-out), border-color 0.4s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.navbar--scrolled {
  background: var(--bg-navbar-solid);
  border-bottom-color: var(--border-default);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.navbar__brand:hover {
  color: var(--text-primary);
}

.navbar__brand-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--gradient);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-glow-blue);
}

.navbar__brand-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

.navbar__brand-logo,
.footer__brand-logo {
  height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.navbar__nav {
  display: none;
  align-items: center;
  gap: var(--space-xl);
}

.navbar__link {
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
}

.navbar__link::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: width 0.3s var(--ease-out);
}

.navbar__link:hover {
  color: var(--text-primary);
}

.navbar__link:hover::after {
  width: 100%;
}

.navbar__actions {
  display: none;
  align-items: center;
  gap: var(--space-md);
}

.navbar__toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  z-index: 1001;
}

.navbar__toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s var(--ease-out);
}

.navbar__toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.navbar__toggle.active span:nth-child(2) {
  opacity: 0;
}

.navbar__toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-base);
  z-index: 999;
  padding: var(--space-2xl) var(--space-lg);
  transform: translateX(100%);
  transition: transform 0.4s var(--ease-out);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.mobile-menu.active {
  transform: translateX(0);
}

.mobile-menu__link {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-menu__link:hover {
  color: var(--violet-bright);
}

.mobile-menu__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

/* ---------- 6. Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding: calc(var(--navbar-height) + var(--space-3xl)) 0 var(--space-4xl);
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
}

.hero__inner {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.hero__logo {
  display: block;
  height: 72px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  margin: 0 auto var(--space-md);
}

.hero__portal-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 auto var(--space-lg);
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--violet-bright);
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.3);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-xl);
  animation: fadeInUp 0.8s var(--ease-out) both;
}

.hero__badge-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}

.hero__title {
  font-size: clamp(2.25rem, 7vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--space-lg);
  letter-spacing: -0.03em;
  position: relative;
}

.hero__title-line {
  display: block;
}

.hero__title-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glitch effect */
.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-base);
}

.glitch::before {
  left: 2px;
  text-shadow: -2px 0 var(--violet-bright);
  clip-path: inset(0 0 0 0);
  animation: glitch-1 3s infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: -2px 0 var(--blue-bright);
  clip-path: inset(0 0 0 0);
  animation: glitch-2 2.5s infinite linear alternate-reverse;
}

.hero__typing {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  min-height: 1.6em;
}

.hero__typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--violet-bright);
  vertical-align: middle;
  animation: blink 1s infinite;
}

.hero__description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
  line-height: 1.7;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
  margin-bottom: var(--space-3xl);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero__meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.hero__meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.hero__scroll {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: bounce 2s infinite;
}

.hero__scroll-line {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
}

/* ---------- 7. Stats Band ---------- */
.stats {
  padding: var(--space-3xl) 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 1;
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.stat {
  text-align: center;
  padding: var(--space-lg);
  position: relative;
}

.stat:not(:last-child)::after {
  content: '';
  display: none;
}

.stat__value {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: var(--space-xs);
  font-variant-numeric: tabular-nums;
}

.stat__label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat__sublabel {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

/* ---------- 8. How It Works ---------- */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  counter-reset: step;
}

.step {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-xl);
  position: relative;
  transition: all 0.3s var(--ease-out);
  counter-increment: step;
}

.step:hover {
  border-color: var(--blue-bright);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.step__number {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: var(--space-md);
  display: block;
}

.step__number::before {
  content: counter(step, decimal-leading-zero);
}

.step__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--gradient-soft);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  color: var(--violet-bright);
}

.step__icon svg {
  width: 24px;
  height: 24px;
}

.step__title {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.step__desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ---------- 9. Modules ---------- */
.modules__header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: var(--space-3xl);
}

.modules__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.modules__meta-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.4rem 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

.modules__meta-item--success {
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
}

.modules__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  position: relative;
  overflow: hidden;
  transition: all 0.35s var(--ease-out);
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}

.module-card:hover {
  border-color: var(--blue-bright);
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.module-card:hover::before {
  transform: scaleX(1);
}

.module-card__icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  background: var(--gradient-soft);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xl);
  color: var(--violet-bright);
  position: relative;
}

.module-card__icon svg {
  width: 30px;
  height: 30px;
}

.module-card__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-bright);
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.25);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
}

.module-card__title {
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.module-card__desc {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-xl);
}

.module-card__features {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.module-card__feature {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.module-card__feature-check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  background: rgba(16, 185, 129, 0.15);
  border-radius: 50%;
  color: var(--success);
  margin-top: 2px;
}

.module-card__feature-check svg {
  width: 12px;
  height: 12px;
}

.module-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.module-card__risk {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.module-card__risk-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

/* ---------- 10. Testimonials ---------- */
.testimonials {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.testimonials__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.testimonial {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  position: relative;
  transition: all 0.3s var(--ease-out);
}

.testimonial:hover {
  border-color: var(--violet-bright);
  transform: translateY(-4px);
}

.testimonial__quote-mark {
  font-family: var(--font-mono);
  font-size: 4rem;
  line-height: 1;
  color: var(--violet);
  opacity: 0.3;
  position: absolute;
  top: var(--space-md);
  right: var(--space-lg);
}

.testimonial__text {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
  position: relative;
  z-index: 1;
}

.testimonial__author {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.testimonial__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: white;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.testimonial__author-info {
  display: flex;
  flex-direction: column;
}

.testimonial__name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.testimonial__role {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ---------- 11. FAQ ---------- */
.faq__list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.3s var(--ease-out);
}

.faq-item.active {
  border-color: var(--violet-bright);
}

.faq-item__question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 600;
  transition: color 0.2s var(--ease-out);
}

.faq-item__question:hover {
  color: var(--violet-bright);
}

.faq-item__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--violet-bright);
  transition: transform 0.3s var(--ease-out);
}

.faq-item.active .faq-item__icon {
  transform: rotate(45deg);
}

.faq-item__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease-out);
}

.faq-item__answer-inner {
  padding: 0 var(--space-xl) var(--space-lg);
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.95rem;
}

/* ---------- 12. CTA Final ---------- */
.cta-final {
  padding: var(--space-4xl) 0;
}

.cta-final__box {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl) var(--space-2xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-final__box::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -10%;
  width: 120%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.cta-final__title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  margin-bottom: var(--space-md);
  position: relative;
}

.cta-final__desc {
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto var(--space-2xl);
  font-size: 1.05rem;
  line-height: 1.7;
  position: relative;
}

.cta-final__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
  position: relative;
}

/* ---------- 13. Footer ---------- */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-3xl) 0 var(--space-xl);
  position: relative;
  z-index: 1;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--border-subtle);
}

.footer__brand-block {
  max-width: 320px;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.footer__brand-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--gradient);
  border-radius: var(--radius-sm);
}

.footer__brand-icon svg {
  width: 18px;
  height: 18px;
  color: white;
}

.footer__desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

.footer__social {
  display: flex;
  gap: var(--space-sm);
}

.footer__social-link {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all 0.25s var(--ease-out);
}

.footer__social-link:hover {
  color: var(--text-on-brand);
  background: var(--gradient);
  border-color: transparent;
  transform: translateY(-2px);
}

.footer__social-link svg {
  width: 18px;
  height: 18px;
}

.footer__col-title {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__link {
  color: var(--text-secondary);
  font-size: 0.92rem;
  transition: color 0.2s var(--ease-out);
}

.footer__link:hover {
  color: var(--violet-bright);
}

.footer__newsletter {
  max-width: 320px;
}

.footer__newsletter-form {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.footer__newsletter-input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: border-color 0.2s var(--ease-out);
}

.footer__newsletter-input:focus {
  outline: none;
  border-color: var(--blue-bright);
}

.footer__newsletter-input::placeholder {
  color: var(--text-muted);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer__bottom-links {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.footer__bottom-link {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer__bottom-link:hover {
  color: var(--text-secondary);
}

/* ---------- 14. Auth Forms (Login / Registro / Solicitar) ---------- */
.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--navbar-height) + var(--space-2xl)) var(--space-lg) var(--space-2xl);
  position: relative;
}

.auth__card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl) var(--space-2xl);
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
}

.auth__card--wide {
  max-width: 560px;
}

.auth__header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.auth__icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: var(--gradient);
  border-radius: var(--radius-md);
  margin: 0 auto var(--space-lg);
  box-shadow: var(--shadow-glow-violet);
}

.auth__icon svg {
  width: 28px;
  height: 28px;
  color: white;
}

.auth__logo {
  display: block;
  height: 72px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  margin: 0 auto var(--space-lg);
}

.auth__title {
  font-size: 1.75rem;
  margin-bottom: var(--space-sm);
}

.auth__subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.form-group__label-required {
  color: var(--violet-bright);
  margin-left: 2px;
}

.form-group__input-wrap {
  position: relative;
}

.form-group__input-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.form-group__input-icon svg {
  width: 18px;
  height: 18px;
}

.form-control {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all 0.2s var(--ease-out);
}

.form-control--with-icon {
  padding-left: 2.75rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control--error {
  border-color: var(--danger);
}

.form-control--error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-group__error {
  display: none;
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: var(--space-xs);
  align-items: center;
  gap: var(--space-xs);
}

.form-group__error.visible {
  display: flex;
}

.form-group__error svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.form-group__hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.form-group__toggle-pwd {
  position: absolute;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: grid;
  place-items: center;
}

.form-group__toggle-pwd:hover {
  color: var(--text-secondary);
}

.form-group__toggle-pwd svg {
  width: 18px;
  height: 18px;
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  font-size: 0.88rem;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  cursor: pointer;
}

.form-check input {
  flex-shrink: 0;
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--violet);
  cursor: pointer;
}

.form-check label {
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.form-check a {
  color: var(--blue-bright);
}

.form-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth__footer {
  text-align: center;
  margin-top: var(--space-xl);
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.auth__footer a {
  font-weight: 600;
}

.auth__alert {
  display: none;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  font-size: 0.9rem;
}

.auth__alert.visible {
  display: flex;
}

.auth__alert--error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.auth__alert--success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.auth__alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Password strength meter */
.pwd-strength {
  margin-top: var(--space-sm);
}

.pwd-strength__bars {
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-xs);
}

.pwd-strength__bar {
  flex: 1;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  transition: background 0.3s var(--ease-out);
}

.pwd-strength__bar.active-1 { background: var(--danger); }
.pwd-strength__bar.active-2 { background: var(--warning); }
.pwd-strength__bar.active-3 { background: #eab308; }
.pwd-strength__bar.active-4 { background: var(--success); }

.pwd-strength__label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ---------- 15. Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

@keyframes glitch-1 {
  0% { clip-path: inset(20% 0 60% 0); }
  20% { clip-path: inset(80% 0 5% 0); }
  40% { clip-path: inset(40% 0 40% 0); }
  60% { clip-path: inset(10% 0 75% 0); }
  80% { clip-path: inset(60% 0 20% 0); }
  100% { clip-path: inset(30% 0 50% 0); }
}

@keyframes glitch-2 {
  0% { clip-path: inset(70% 0 10% 0); }
  20% { clip-path: inset(15% 0 65% 0); }
  40% { clip-path: inset(55% 0 30% 0); }
  60% { clip-path: inset(85% 0 5% 0); }
  80% { clip-path: inset(25% 0 70% 0); }
  100% { clip-path: inset(50% 0 35% 0); }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ---------- 16. Responsive — Tablet ---------- */
@media (min-width: 640px) {
  .stats__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .stat {
    border-right: 1px solid var(--border-subtle);
  }

  .stat:last-child {
    border-right: none;
  }

  .modules__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .testimonials__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }

  .footer__newsletter {
    grid-column: span 3;
    max-width: none;
  }

  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- 17. Responsive — Desktop ---------- */
@media (min-width: 900px) {
  :root {
    --space-4xl: 7rem;
  }

  .navbar__nav {
    display: flex;
  }

  .navbar__actions {
    display: flex;
  }

  .navbar__toggle {
    display: none;
  }

  .mobile-menu {
    display: none;
  }

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

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

  .steps {
    grid-template-columns: repeat(4, 1fr);
  }

  .footer__grid {
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  }

  .footer__newsletter {
    grid-column: auto;
  }

  .hero__cta {
    flex-wrap: nowrap;
  }
}

/* ---------- 18. Theme Toggle Button ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--violet-bright);
  border-color: var(--violet-bright);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.5s var(--ease-spring), opacity 0.3s var(--ease-out);
}

/* Icono de sol (visible en modo oscuro, click → pasa a claro) */
.theme-toggle .icon-sun {
  display: block;
}

.theme-toggle .icon-moon {
  display: none;
}

/* En modo claro, mostramos la luna (click → pasa a oscuro) */
[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

/* Animación de rotación al cambiar de tema */
.theme-toggle--spinning svg {
  animation: theme-spin 0.6s var(--ease-spring);
}

@keyframes theme-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(0.7); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Transición suave global al cambiar de tema */
body,
.navbar,
.mobile-menu,
.module-card,
.testimonial,
.faq-item,
.step,
.stat,
.cta-final__box,
.auth__card,
.form-control,
.footer,
.stats,
.testimonials,
footer__social-link {
  transition-property: background-color, border-color, color, box-shadow;
  transition-duration: 0.4s;
  transition-timing-function: var(--ease-out);
}

/* Asegurar que los selects y options hereden el tema */
select.form-control,
select.form-control option {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
}

/* ---------- 19. Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 2px;
}

::selection {
  background: rgba(124, 58, 237, 0.35);
  color: var(--text-primary);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 5px;
  border: 2px solid var(--bg-base);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--blue-hover);
}

button.navbar__link,
button.footer__link {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  text-align: inherit;
}

.public-logout {
  margin: 0;
}

@media (min-width: 900px) {
  .footer__grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
}
