/* ==========================================================================
   FinActionable — Premium Animated Web Design System
   Estándar: Obsidian Dark / Executive Light + Emerald Green + IBCS Visuals
   ========================================================================== */

:root {
  /* Dark Mode Tokens (Default) */
  --bg-base: #080C14;
  --bg-surface: #0D1322;
  --bg-header: rgba(8, 12, 20, 0.85);
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-card-inner: rgba(10, 15, 28, 0.65);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(16, 185, 129, 0.35);

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --logo-text-color: #FFFFFF;

  --color-emerald: #10B981;
  --color-emerald-dark: #059669;
  --color-emerald-light: #34D399;
  --color-emerald-bg: rgba(16, 185, 129, 0.08);
  --color-danger: #EF4444;
  --color-alert: #F59E0B;
  --color-cyan: #06B6D4;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-editorial: 'Newsreader', serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --canvas-opacity: 0.92;
}

/* Light Theme Tokens (Alto Contraste y Nitidez Ejecutiva) */
[data-theme="light"] {
  --bg-base: #F8FAFC;
  --bg-surface: #F1F5F9;
  --bg-header: rgba(255, 255, 255, 0.94);
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-inner: rgba(241, 245, 249, 0.96);
  --border-subtle: rgba(0, 0, 0, 0.12);
  --border-active: rgba(4, 120, 87, 0.45);

  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --logo-text-color: #0F172A;

  /* Tonos esmeralda oscuros profundos para máxima legibilidad sobre fondo blanco */
  --color-emerald: #047857;        /* Emerald 700 (Contraste 5.8:1 AAA) */
  --color-emerald-dark: #064E3B;   /* Forest Emerald 900 */
  --color-emerald-light: #047857;  /* Deep Emerald para itálicas y acentos */
  --color-emerald-bg: rgba(4, 120, 87, 0.1);

  --canvas-opacity: 0.78;
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  overflow-x: hidden;
  position: relative;
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.08) 0%, var(--bg-base) 70%);
}

/* Typography Utilities */
.font-sans { font-family: var(--font-sans); }
.font-mono { font-family: var(--font-mono); }
.text-emerald { color: var(--color-emerald) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-center { text-align: center; }
.max-w-700 { max-width: 700px; margin-left: auto; margin-right: auto; }

/* --------------------------------------------------------------------------
   Sticky Canvas Background Engine (Asimétrico Pantalla Completa a la Derecha)
   -------------------------------------------------------------------------- */
.canvas-sticky-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

#morph-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: var(--canvas-opacity);
  filter: contrast(1.15) brightness(1.02);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.canvas-overlay-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 12, 20, 0.98) 0%, rgba(8, 12, 20, 0.88) 44%, rgba(8, 12, 20, 0.15) 75%, transparent 100%);
  pointer-events: none;
  transition: background 0.3s ease;
}

[data-theme="light"] .canvas-overlay-vignette {
  background: linear-gradient(90deg, rgba(248, 250, 252, 0.98) 0%, rgba(248, 250, 252, 0.88) 44%, rgba(248, 250, 252, 0.15) 75%, transparent 100%);
  pointer-events: none;
  transition: background 0.3s ease;
}

.canvas-ambient-glow {
  position: absolute;
  top: 15%;
  right: 10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Layout & Container (Asimétrico Pantalla Completa - Flujo Izquierdo)
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 58vw;
  margin-left: 0;
  margin-right: auto;
  padding: 0 4vw 0 6vw;
}

.content-stream {
  position: relative;
  z-index: 10;
}

.section {
  padding: 100px 0;
  position: relative;
}

/* --------------------------------------------------------------------------
   Navigation Header (Ancho Completo de Extremo a Extremo)
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 76px;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.3s ease;
}

.header-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 6vw;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-identity {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.brand-identity:hover {
  transform: scale(1.02);
}

.brand-logo-svg {
  display: block;
  height: 42px;
  width: auto;
}

.logo-text-fin {
  fill: var(--logo-text-color);
  transition: fill 0.3s ease;
}

.logo-subtext {
  fill: var(--text-muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--color-emerald);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Language Switch */
.lang-switch {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 3px;
  border: 1px solid var(--border-subtle);
}

[data-theme="light"] .lang-switch {
  background: rgba(0, 0, 0, 0.05);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.2s ease;
}

.lang-btn.active {
  background: var(--color-emerald);
  color: #FFFFFF;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.05rem;
  transition: all 0.2s ease;
}

[data-theme="light"] .theme-toggle-btn {
  background: rgba(0, 0, 0, 0.05);
}

.theme-toggle-btn:hover {
  border-color: var(--color-emerald);
  transform: scale(1.06);
}

/* LogIn Button */
.btn-login {
  background: var(--color-emerald-bg);
  color: var(--color-emerald);
  border: 1px solid var(--border-active);
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 600;
}

.btn-login:hover {
  background: var(--color-emerald);
  color: #FFFFFF;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Buttons & Badges
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  text-decoration: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.24s var(--ease-out);
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-emerald) 0%, var(--color-emerald-dark) 100%);
  color: #FFFFFF !important;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #FFFFFF !important;
  box-shadow: 0 4px 18px rgba(4, 120, 87, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(16, 185, 129, 0.45);
  color: #FFFFFF !important;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  backdrop-filter: blur(10px);
}

[data-theme="light"] .btn-secondary {
  background: rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 14px 26px;
  font-size: 1rem;
}

.section-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-emerald);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--color-emerald-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .gradient-text {
  background: linear-gradient(135deg, #0F172A 20%, #047857 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.glass-inner {
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
}

/* --------------------------------------------------------------------------
   01. Hero Section
   -------------------------------------------------------------------------- */
.section-hero {
  min-height: 100vh;
  padding-top: 130px;
  padding-bottom: 60px;
  display: flex;
  align-items: center;
}

.hero-split-container {
  width: 100%;
  padding: 0 4vw 0 6vw;
  display: grid;
  grid-template-columns: minmax(460px, 600px) 1fr;
  gap: 40px;
  align-items: center;
}

.hero-left-content {
  max-width: 600px;
  position: relative;
  z-index: 10;
}

.hero-tagline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 30px;
  background: var(--color-emerald-bg);
  border: 1px solid var(--border-active);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--color-emerald);
  letter-spacing: 0.06em;
  margin-bottom: 24px;
}

.tag-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-emerald);
  box-shadow: 0 0 10px var(--color-emerald);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: 3.6rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 22px;
}

.hero-lead {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 34px;
  max-width: 580px;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 44px;
}

/* Centered Metrics Bar */
.hero-metrics-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  padding: 20px 24px;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 10px;
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}

.metric-val small {
  font-size: 0.95rem;
  color: var(--color-emerald);
  margin-left: 2px;
}

.metric-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.25;
}

.metric-divider {
  width: 1px;
  height: 42px;
  background: var(--border-subtle);
}

/* Mini Preview Card */
.floating-interactive-card {
  padding: 24px;
  position: relative;
  border-color: rgba(16, 185, 129, 0.2);
}

.card-header-clean {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 18px;
}

.badge-status.online {
  font-size: 0.75rem;
  color: var(--color-emerald);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-status.online::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-emerald);
}

.dataset-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.preview-row {
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  font-size: 0.84rem;
}

.account-code {
  color: var(--color-cyan);
}

.badge-tag {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.badge-tag.green { background: var(--color-emerald-bg); color: var(--color-emerald); font-weight: 700; }
.badge-tag.alert { background: rgba(245, 158, 11, 0.15); color: #D97706; font-weight: 700; }

.preview-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 10px 0;
}

.total-row {
  grid-template-columns: 1fr auto auto;
  padding-top: 10px;
}

.card-footer-mini {
  margin-top: 18px;
  text-align: center;
  padding-top: 12px;
  border-top: 1px dashed var(--border-subtle);
}

.scroll-hint-text {
  font-size: 0.78rem;
  color: var(--color-emerald);
  font-weight: 600;
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   02. El Problema Real
   -------------------------------------------------------------------------- */
.quote-container {
  margin: 20px 0 24px;
}

.editorial-quote {
  font-family: var(--font-editorial);
  font-size: 2.4rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--text-primary);
}

.editorial-quote em {
  color: var(--color-emerald);
  font-style: italic;
  font-weight: 600;
}

.problema-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 820px;
  margin-bottom: 48px;
  line-height: 1.7;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.comparison-card {
  padding: 34px;
  border-radius: 18px;
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
}

.card-traditional {
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.18);
}

.card-finactionable {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.28);
  box-shadow: 0 10px 40px rgba(16, 185, 129, 0.08);
}

.comparison-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.icon-indicator {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.icon-danger { background: rgba(239, 68, 68, 0.18); color: var(--color-danger); }
.icon-success { background: rgba(16, 185, 129, 0.18); color: var(--color-emerald); }

.comparison-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comparison-list li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.comparison-list strong {
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   03. El Recorrido (Cómo Funciona)
   -------------------------------------------------------------------------- */
.section-heading {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-subheading {
  font-size: 1.08rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 48px;
  max-width: 780px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-card {
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-emerald);
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.step-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.step-body {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
  flex-grow: 1;
}

.step-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.step-badge {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
}

.step-badge.auto { color: var(--color-cyan); }
.step-badge.human { color: var(--color-alert); }

/* --------------------------------------------------------------------------
   04. 13 Puertas de Validación
   -------------------------------------------------------------------------- */
.gates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.gate-item {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.25s ease;
  position: relative;
}

.gate-item:hover {
  border-color: var(--color-emerald);
  transform: translateY(-3px);
  background: rgba(16, 185, 129, 0.05);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.gate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gate-code {
  color: var(--color-cyan);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.gate-class-badge {
  font-size: 0.70rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gate-class-badge.class-a {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.gate-class-badge.class-b {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.gate-class-badge.class-sys {
  background: rgba(148, 163, 184, 0.15);
  color: #94A3B8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.gate-class-badge.class-audit {
  background: rgba(16, 185, 129, 0.2);
  color: var(--color-emerald);
  border: 1px solid var(--color-emerald);
}

.gate-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.gate-text {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
  flex-grow: 1;
}

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

.gate-signer {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}

.gate-status {
  color: var(--color-emerald);
  font-weight: 700;
  font-size: 0.78rem;
  background: rgba(16, 185, 129, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
}

.full-width-gate {
  grid-column: 1 / -1;
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.35);
}

/* --------------------------------------------------------------------------
   05. Showcase Interactivo: Los 7 Entregables (Amplitud Total sin Ascensor)
   -------------------------------------------------------------------------- */
.container-wide,
.section-entregables .container {
  max-width: 88vw !important;
  width: 100%;
}

.no-wrap-heading {
  white-space: nowrap;
  margin-bottom: 6px;
}

/* En pantallas estrechas el titular no cabe en una linea, y forzarlo
 * ensanchaba el documento a 585px sobre una pantalla de 375: la pagina
 * entera se desplazaba de lado. `nowrap` es una preferencia estetica
 * para pantallas anchas, no una regla. */
@media (max-width: 1024px) {
  .no-wrap-heading { white-space: normal; }
}

.entregables-header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  margin-bottom: 26px;
  width: 100%;
}

.entregables-header-left .section-subheading {
  margin-bottom: 0;
  max-width: 780px;
}

.interactive-deliverables-app {
  border-radius: 20px;
  overflow: hidden;
  border-color: rgba(16, 185, 129, 0.25);
  width: 100%;
}

.app-tab-bar {
  display: flex;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: hidden;
  padding: 8px 12px;
  gap: 6px;
  width: 100%;
}

.app-tab {
  flex: 1 1 0;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.90rem;
  font-weight: 600;
  padding: 12px 14px;
  cursor: pointer;
  border-radius: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.app-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.app-tab.active {
  color: var(--color-emerald);
  background: rgba(16, 185, 129, 0.12);
  font-weight: 700;
}

.app-tab-viewport {
  padding: 30px;
}

.tab-view {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.view-title-group h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 4px;
}

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

/* Financial Table IBCS */
.financial-table-wrapper {
  overflow-x: auto;
}

.financial-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.financial-table th {
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: right;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.financial-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: right;
}

.text-left { text-align: left !important; }
.w-160 { width: 160px; }
.w-120 { width: 120px; }

.row-header {
  background: rgba(255, 255, 255, 0.02);
}

.row-highlight {
  background: rgba(16, 185, 129, 0.06);
  font-weight: 700;
}

.row-ebitda {
  background: rgba(16, 185, 129, 0.1);
  font-weight: 700;
  border-top: 1px solid rgba(16, 185, 129, 0.3);
  border-bottom: 2px solid rgba(16, 185, 129, 0.4);
}

.bar-ibcs {
  height: 8px;
  background: #475569;
  border-radius: 2px;
}

.bar-ibcs.emerald-bar { background: var(--color-emerald); }
.bar-ibcs.base-bar { background: #CBD5E1; }

.var-bar {
  height: 8px;
  border-radius: 2px;
}

.var-bar.pos { background: #22C55E; }
.var-bar.neg { background: #EF4444; }

/* Balance Columns Grid */
.balance-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.balance-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 1px dashed var(--border-subtle);
}

.balance-total {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 2px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
}

/* Cashflow Rows */
.cashflow-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 700px;
  margin: 0 auto;
}

.cashflow-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-card-inner);
  border-radius: 8px;
  font-size: 0.92rem;
}

.cashflow-highlight {
  display: flex;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 700;
}

/* KPIs Grid */
.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.kpi-card {
  display: flex;
  flex-direction: column;
}

.kpi-category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.kpi-name {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.kpi-val {
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.kpi-val small { font-size: 0.85rem; color: var(--text-secondary); }

.kpi-delta {
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.kpi-benchmark {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

/* Simulador de Escenarios */
.sim-container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 30px;
  align-items: center;
}

.sim-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--color-emerald);
  height: 6px;
  background: var(--border-subtle);
  border-radius: 4px;
  outline: none;
}

.sim-result-card {
  text-align: center;
  padding: 34px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.sim-res-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.sim-res-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-emerald);
  margin-bottom: 8px;
}

.sim-res-delta {
  font-size: 0.85rem;
}

/* Terceros Grid */
.terceros-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.terceros-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 1px dashed var(--border-subtle);
}

.terceros-highlight {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   06. Narrativa Verificada
   -------------------------------------------------------------------------- */
.narrativa-interactive-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.narrativa-prose-card {
  padding: 34px;
}

.prose-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 16px;
}

.prose-text {
  font-family: var(--font-editorial);
  font-size: 1.35rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.audit-token {
  color: var(--color-emerald);
  border-bottom: 2px solid var(--color-emerald);
  font-weight: 600;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 3px;
  transition: all 0.2s ease;
}

.audit-token:hover, .audit-token.active {
  background: rgba(16, 185, 129, 0.25);
  color: var(--text-primary);
}

.prose-tip {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.narrativa-trace-card {
  padding: 28px;
  background: var(--bg-card-inner);
  border-color: rgba(6, 182, 212, 0.25);
}

.trace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--color-cyan);
}

.trace-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 0;
}

.trace-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid transparent;
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.trace-row.active {
  background: rgba(6, 182, 212, 0.12);
  border-color: var(--color-cyan);
}

.trace-key { color: var(--text-secondary); }

.trace-footer {
  display: flex;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   07. 4 Formatos Nativos
   -------------------------------------------------------------------------- */
.formatos-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.formato-card {
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: all 0.25s var(--ease-out);
}

.formato-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-active);
}

.formato-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.formato-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.formato-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
  flex-grow: 1;
}

.formato-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-emerald);
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   08. Formulario Nativo: Cierre Piloto con tu Data
   -------------------------------------------------------------------------- */
.cta-box {
  max-width: 900px;
  margin: 0 auto;
  padding: 50px 44px;
  border-color: rgba(16, 185, 129, 0.3);
  border-radius: 24px;
}

.cta-header-group {
  margin-bottom: 36px;
}

.cta-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.cta-lead {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.max-w-700 {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Executive Lead Form */
.executive-form {
  width: 100%;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
  text-align: left;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.full-width-group {
  grid-column: 1 / -1;
  text-align: left;
  margin-bottom: 20px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 13px 16px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  transition: all 0.2s ease;
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
  background: rgba(16, 185, 129, 0.03);
}

.form-select {
  cursor: pointer;
  appearance: auto;
}

.form-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.form-textarea {
  resize: vertical;
  min-height: 70px;
}

/* Privacy note */
.form-privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid var(--border-active);
  border-radius: 30px;
  padding: 8px 18px;
  font-size: 0.78rem;
  color: var(--color-emerald);
  margin-bottom: 26px;
}

.btn-submit {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  cursor: pointer;
}

.form-feedback-msg {
  margin-top: 20px;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  animation: fadeIn 0.3s ease;
}

.form-feedback-msg.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--color-emerald);
  color: var(--color-emerald);
}

.form-feedback-msg.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--color-danger);
  color: var(--color-danger);
}

.btn-demo-link:hover {
  color: var(--color-emerald-light);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 60px 0 40px;
  position: relative;
  z-index: 10;
}

.footer-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
}

.footer-brand {
  max-width: 420px;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 14px;
}

.footer-meta {
  text-align: right;
}

.footer-links {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
  justify-content: flex-end;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--color-emerald); }

.footer-rights {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints (Acción Centrada)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 24px;
  }
  .hero-split-container {
    grid-template-columns: 1fr;
    padding: 0 24px;
  }
  .hero-left-content {
    max-width: 100%;
  }
  .hero-title { font-size: 2.8rem; }
  .steps-grid { grid-template-columns: 1fr; }
  .gates-grid { grid-template-columns: repeat(2, 1fr); }
  .full-width-gate { grid-column: span 2; }
  .formatos-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .sim-container { grid-template-columns: 1fr; }
  .narrativa-interactive-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .hero-title { font-size: 2.2rem; }
  .hero-metrics-bar {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  .metric-divider { display: none; }
  .comparison-grid { grid-template-columns: 1fr; }
  .gates-grid { grid-template-columns: 1fr; }
  .full-width-gate { grid-column: span 1; }
  .formatos-grid { grid-template-columns: 1fr; }
  .kpi-cards-grid { grid-template-columns: 1fr; }
  .balance-cards-grid { grid-template-columns: 1fr; }
  .terceros-grid { grid-template-columns: 1fr; }
  .entregables-header-flex { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* --------------------------------------------------------------------------
   Cabecera en portátiles medianos
   --------------------------------------------------------------------------
   Con seis enlaces la barra cabía justo —holgura exacta de 0px a 1180— y el
   séptimo («Contáctanos») la pasó de largo. Marca + navegación + acciones no
   caben en 1180 con separaciones de 28px.

   Se aprieta la navegación en vez de esconderla: quien entra desde un portátil
   de 1280 es exactamente el lector al que va dirigida esta página, y quitarle
   los enlaces para ganar 80 píxeles sería resolver el problema equivocado. */
@media (max-width: 1400px) {
  .nav-links { gap: 18px; }
  .nav-link { font-size: 0.86rem; }
}

@media (max-width: 1240px) {
  .nav-links { gap: 14px; }
  .nav-link { font-size: 0.82rem; }
  .header-container { padding: 0 4vw; }
}

/* --------------------------------------------------------------------------
   El canvas en pantallas estrechas
   --------------------------------------------------------------------------
   `initCanvasScrollMorph` ni siquiera lo arranca por debajo de 1024px —ver el
   comentario alli—, asi que aqui solo se quita el hueco que dejaria y se le
   devuelve al hero un fondo propio. Sin esto el hero se queda sobre el
   degradado del `body`, que se diseño contando con la imagen encima. */
@media (max-width: 1023px) {
  .canvas-sticky-container { display: none; }
  .section-hero {
    background:
      radial-gradient(circle at 85% 12%, rgba(16, 185, 129, 0.16) 0%, transparent 55%),
      radial-gradient(circle at 10% 85%, rgba(6, 182, 212, 0.10) 0%, transparent 50%);
  }
  /* El hueco vacio de la columna derecha no tiene nada que reservar. */
  .hero-right-visual { display: none; }
  .section-hero { min-height: auto; padding-top: 110px; padding-bottom: 40px; }
}

/* --------------------------------------------------------------------------
   El canvas en tema claro
   --------------------------------------------------------------------------
   Las dos imagenes son capturas OSCURAS. Sobre el fondo oscuro son una textura
   de fondo; sobre el claro son un elemento que compite con el texto —la cita
   editorial quedaba encima de una tabla negra—. Se baja la opacidad y la
   veladura se lleva mas hacia la derecha, de modo que la imagen se lea como
   ambiente y no como contenido. */
[data-theme="light"] #morph-canvas {
  opacity: 0.30;
  filter: contrast(0.92) brightness(1.25);
}

[data-theme="light"] .canvas-overlay-vignette {
  background: linear-gradient(90deg,
    rgba(248, 250, 252, 0.99) 0%,
    rgba(248, 250, 252, 0.96) 52%,
    rgba(248, 250, 252, 0.55) 78%,
    rgba(248, 250, 252, 0.18) 100%);
}

/* --------------------------------------------------------------------------
   La cabecera en teléfonos
   --------------------------------------------------------------------------
   Medido en un 375: marca 192 + idioma 82 + tema 38 + «Entrar» 99, más las
   separaciones, dan 453 sobre 345 disponibles. El botón de entrar empezaba en
   el píxel 355 y acababa en el 454: fuera de la pantalla. Desde un teléfono no
   se podía entrar a la aplicación.

   Se encoge todo en proporción en vez de esconder algo. El conmutador de
   idioma y el de tema son de una sola pulsación y no estorban; «Entrar» es la
   acción de la página y no puede quedarse fuera. */
@media (max-width: 520px) {
  .header-container { padding: 0 4vw; }
  .header-actions { gap: 8px; }

  /* El SVG escala por altura: el ancho lo sigue solo. */
  .brand-logo-svg { height: 30px; }

  .lang-btn { padding: 4px 7px; font-size: 0.72rem; }
  .theme-toggle-btn { width: 32px; height: 32px; font-size: 0.95rem; }
  .btn-login { padding: 7px 12px; font-size: 0.8rem; }
  .btn-login svg { display: none; }
}

/* --------------------------------------------------------------------------
   Dónde deja de caber la navegación
   --------------------------------------------------------------------------
   Se escondía a 768px, pero medido no cabe desde mucho antes: a 1024 la barra
   se pasaba y «Entrar» quedaba fuera de la pantalla. En una tableta no se
   podía entrar a la aplicación.

   Se sube el umbral a donde de verdad deja de caber. Es una elección, no un
   descuido: entre 768 y 1100 se pierden siete enlaces secundarios —todos
   alcanzables bajando— y se gana el botón que abre el producto. Si algún día
   hay menú de hamburguesa, este es el tramo que le toca cubrir. */
@media (max-width: 1100px) {
  .nav-links { display: none; }
}
