/* ==========================================================================
   MUNIX - SISTEMA DE DISEÑO Y ESTILOS MODERNOS
   Inspirado en interfaces de inteligencia de datos, SaaS institucional y GovTech
   ========================================================================== */

:root {
  /* Paleta Base Light */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-surface-glass: rgba(255, 255, 255, 0.85);
  --bg-subtle: #f1f5f9;
  --bg-soft-brand: #eff6ff;

  --ink-primary: #0f172a;
  --ink-secondary: #334155;
  --ink-muted: #64748b;
  --ink-inverse: #ffffff;

  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-focus: #3b82f6;

  /* Brand Colors */
  --brand-primary: #2563eb;
  --brand-primary-hover: #1d4ed8;
  --brand-accent: #0284c7;
  --brand-gradient: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #0284c7 100%);
  --brand-glow: rgba(37, 99, 235, 0.25);

  /* Semáforos de Obras */
  --status-red: #ef4444;
  --status-red-bg: rgba(239, 68, 68, 0.1);
  --status-red-border: rgba(239, 68, 68, 0.3);
  
  --status-amber: #f59e0b;
  --status-amber-bg: rgba(245, 158, 11, 0.12);
  --status-amber-border: rgba(245, 158, 11, 0.35);
  
  --status-green: #10b981;
  --status-green-bg: rgba(16, 185, 129, 0.12);
  --status-green-border: rgba(16, 185, 129, 0.35);

  /* Sombras y Luces */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 28px -6px rgba(15, 23, 42, 0.12), 0 6px 12px -4px rgba(15, 23, 42, 0.06);
  --shadow-xl: 0 24px 48px -12px rgba(15, 23, 42, 0.18);
  --shadow-glow: 0 0 35px -5px rgba(37, 99, 235, 0.3);

  /* Tipografías */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-full: 9999px;

  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modo Oscuro Inteligente */
[data-theme="dark"] {
  --bg-page: #0b1120;
  --bg-surface: #111a2e;
  --bg-surface-elevated: #16223b;
  --bg-surface-glass: rgba(17, 26, 46, 0.85);
  --bg-subtle: #192742;
  --bg-soft-brand: rgba(37, 99, 235, 0.15);

  --ink-primary: #f8fafc;
  --ink-secondary: #cbd5e1;
  --ink-muted: #94a3b8;
  --ink-inverse: #0b1120;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-focus: #60a5fa;

  --brand-primary: #3b82f6;
  --brand-primary-hover: #60a5fa;
  --brand-accent: #38bdf8;
  --brand-gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #38bdf8 100%);
  --brand-glow: rgba(59, 130, 246, 0.35);

  --status-red: #f87171;
  --status-red-bg: rgba(239, 68, 68, 0.2);
  --status-red-border: rgba(239, 68, 68, 0.4);

  --status-amber: #fbbf24;
  --status-amber-bg: rgba(245, 158, 11, 0.2);
  --status-amber-border: rgba(245, 158, 11, 0.4);

  --status-green: #34d399;
  --status-green-bg: rgba(16, 185, 129, 0.2);
  --status-green-border: rgba(16, 185, 129, 0.4);

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px 0 rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 32px 0 rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 24px 50px 0 rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 45px -5px rgba(59, 130, 246, 0.35);
}

/* ==========================================================================
   RESET Y BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--ink-primary);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

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

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   TIPOGRAFÍA
   ========================================================================== */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--ink-primary);
  line-height: 1.18;
  letter-spacing: -0.025em;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.35rem, 5.2vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.85rem, 3.6vw, 2.7rem);
}

h3 {
  font-size: 1.28rem;
}

p {
  color: var(--ink-secondary);
}

.lead {
  font-size: clamp(1.08rem, 1.8vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink-secondary);
  max-width: 62ch;
}

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

/* ==========================================================================
   COMPONENTES: BOTONES, BADGES Y CONTROLES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.98rem;
  transition: all var(--transition-normal);
  cursor: pointer;
  border: 1px solid transparent;
  text-align: center;
  white-space: nowrap;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
  color: #ffffff;
}

.btn-ghost {
  background: var(--bg-surface);
  color: var(--ink-primary);
  border-color: var(--border-subtle);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-soft-brand);
  color: var(--brand-primary);
  border-color: rgba(37, 99, 235, 0.2);
}

.btn-secondary:hover {
  background: var(--brand-primary);
  color: #ffffff;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.08rem;
  border-radius: var(--radius-md);
}

.btn-full {
  width: 100%;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-soft-brand);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--brand-primary);
  margin-bottom: 18px;
  backdrop-filter: blur(8px);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-primary);
  position: relative;
}

.badge-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--brand-primary);
  opacity: 0.4;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

/* ==========================================================================
   HEADER Y NAVEGACIÓN
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  gap: 20px;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink-primary);
}

.logo-brand .logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand-gradient);
  display: grid;
  place-items: center;
  color: white;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.logo-brand span.highlight {
  color: var(--brand-primary);
}

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

.nav-links a {
  color: var(--ink-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-links a:hover {
  color: var(--brand-primary);
}

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

/* Toggle Dark/Light Mode */
.theme-toggle-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-primary);
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  border-color: var(--border-medium);
  background: var(--bg-surface-elevated);
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--ink-primary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 6px;
}

/* ==========================================================================
   HERO SECTION & TABLERO INTERACTIVO
   ========================================================================== */
.hero-section {
  position: relative;
  padding: 64px 0 84px;
  overflow: hidden;
}

.hero-glow-bg {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 850px;
  height: 420px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.16) 0%, rgba(2, 132, 199, 0.08) 40%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  gap: 52px;
  align-items: center;
}

.hero-content h1 {
  margin-bottom: 20px;
}

.hero-content .lead {
  margin-bottom: 30px;
}

.cta-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.hero-trust-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  font-size: 0.86rem;
  color: var(--ink-muted);
}

.hero-trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-trust-item svg {
  color: var(--status-green);
}

/* ==========================================================================
   TABLERO / MOCKUP INTERACTIVO EN EL HERO
   ========================================================================== */
.board-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  padding: 24px;
  position: relative;
  transition: all var(--transition-normal);
}

.board-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--brand-gradient);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

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

.board-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--status-green);
  letter-spacing: 0.05em;
  background: var(--status-green-bg);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-green);
  animation: pulseDot 1.8s infinite;
}

.board-filter-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  overflow-x: auto;
}

.filter-tab {
  background: transparent;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-tab.active {
  background: var(--bg-surface);
  color: var(--brand-primary);
  box-shadow: var(--shadow-sm);
}

/* Tarjetas KPI Superiores */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  position: relative;
  transition: transform var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-2px);
}

.kpi-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink-primary);
}

.kpi-label {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-weight: 500;
  margin-top: 4px;
}

.kpi-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 6px;
  display: inline-block;
}

.kpi-badge.danger { background: var(--status-red-bg); color: var(--status-red); }
.kpi-badge.warning { background: var(--status-amber-bg); color: var(--status-amber); }
.kpi-badge.success { background: var(--status-green-bg); color: var(--status-green); }

/* Lista de Proyectos / Obras */
.board-project-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.board-project-list::-webkit-scrollbar {
  width: 5px;
}

.board-project-list::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 10px;
}

.project-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  transition: all var(--transition-fast);
}

.project-item:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
  transform: translateX(3px);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-pill.red {
  background: var(--status-red-bg);
  color: var(--status-red);
  border-color: var(--status-red-border);
}

.status-pill.amber {
  background: var(--status-amber-bg);
  color: var(--status-amber);
  border-color: var(--status-amber-border);
}

.status-pill.green {
  background: var(--status-green-bg);
  color: var(--status-green);
  border-color: var(--status-green-border);
}

.project-details strong {
  display: block;
  font-size: 0.94rem;
  color: var(--ink-primary);
  margin-bottom: 3px;
}

.project-meta {
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.4;
}

.project-meta .responsible {
  color: var(--brand-primary);
  font-weight: 600;
}

.project-action-btn {
  background: var(--bg-soft-brand);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: var(--brand-primary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.project-action-btn:hover {
  background: var(--brand-primary);
  color: white;
}

/* ==========================================================================
   SECCIONES GENERALES
   ========================================================================== */
section {
  padding: 88px 0;
  position: relative;
}

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

.section-head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 52px;
}

.section-head h2 {
  margin-bottom: 16px;
}

.section-head .lead {
  margin: 0 auto;
}

/* Grid de Tarjetas (Problema / Solución) */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.section-alt .feature-card {
  background: var(--bg-page);
}

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

.feature-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--brand-gradient);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.feature-card:hover::after {
  opacity: 1;
}

.feature-icon-wrapper {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: var(--bg-soft-brand);
  color: var(--brand-primary);
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  font-size: 1.4rem;
}

.feature-card h3 {
  margin-bottom: 12px;
}

.feature-card p {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Caja de Principio */
.principle-banner {
  margin-top: 48px;
  padding: 28px 34px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(2, 132, 199, 0.04) 100%);
  border-left: 6px solid var(--brand-primary);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  display: flex;
  align-items: center;
  gap: 20px;
}

.principle-icon {
  font-size: 2.2rem;
  color: var(--brand-primary);
  flex-shrink: 0;
}

.principle-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink-primary);
  line-height: 1.45;
}

/* ==========================================================================
   CÓMO FUNCIONA (PASOS)
   ========================================================================== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 36px;
  counter-reset: step-counter;
}

.step-card {
  counter-increment: step-counter;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  position: relative;
  transition: all var(--transition-normal);
}

.step-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
}

.step-card::before {
  content: counter(step-counter, decimal-leading-zero);
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--brand-primary);
  opacity: 0.9;
  display: block;
  margin-bottom: 14px;
  line-height: 1;
}

.step-card h3 {
  margin-bottom: 10px;
  font-size: 1.15rem;
}

.step-card p {
  font-size: 0.92rem;
  color: var(--ink-muted);
}

/* ==========================================================================
   SIMULADOR DE IMPACTO DESTRABE (INTERACTIVO)
   ========================================================================== */
.simulator-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  margin-top: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.simulator-controls h3 {
  margin-bottom: 14px;
}

.simulator-slider-group {
  margin: 24px 0;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.slider-value-display {
  color: var(--brand-primary);
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
}

.range-input {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: var(--border-subtle);
  outline: none;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

.simulator-results {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px dashed var(--border-medium);
  padding-bottom: 10px;
}

.result-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.result-label {
  font-size: 0.92rem;
  color: var(--ink-secondary);
}

.result-stat {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--ink-primary);
}

.result-stat.highlight {
  color: var(--brand-primary);
}

/* ==========================================================================
   FORMULARIO DE REGISTRO GOOGLE SHEETS (SECTION)
   ========================================================================== */
.form-section {
  position: relative;
}

.form-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

.form-body {
  padding: 44px 40px;
}

.form-body h3 {
  font-size: 1.7rem;
  margin-bottom: 8px;
}

.form-body .form-desc {
  font-size: 0.98rem;
  color: var(--ink-muted);
  margin-bottom: 28px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

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

.form-group.col-span-2 {
  grid-column: span 2;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-label .req {
  color: var(--status-red);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--ink-primary);
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

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

.form-info-panel {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #0369a1 100%);
  color: white;
  padding: 44px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.form-info-panel h4 {
  color: white;
  font-size: 1.45rem;
  margin-bottom: 14px;
}

.form-info-panel p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.94rem;
  line-height: 1.6;
}

.info-points {
  list-style: none;
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-point-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.9);
}

.info-point-icon {
  background: rgba(255, 255, 255, 0.2);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.trust-badge-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
}

.trust-badge-card strong {
  display: block;
  font-size: 0.92rem;
  color: #ffffff;
  margin-bottom: 4px;
}

.trust-badge-card span {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.78);
}

/* Estados del Formulario (Cargando / Éxito) */
.form-status-alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-top: 18px;
  display: none;
  font-size: 0.92rem;
  align-items: center;
  gap: 10px;
}

.form-status-alert.loading {
  display: flex;
  background: var(--bg-soft-brand);
  color: var(--brand-primary);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.form-status-alert.success {
  display: flex;
  background: var(--status-green-bg);
  color: var(--status-green);
  border: 1px solid var(--status-green-border);
}

.form-status-alert.error {
  display: flex;
  background: var(--status-red-bg);
  color: var(--status-red);
  border: 1px solid var(--status-red-border);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   ACORDEÓN FAQ
   ========================================================================== */
.faq-container {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.faq-item:hover {
  border-color: var(--border-medium);
}

.faq-question {
  width: 100%;
  padding: 20px 24px;
  background: transparent;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--ink-primary);
  cursor: pointer;
  gap: 16px;
}

.faq-icon {
  font-size: 1.2rem;
  color: var(--brand-primary);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out, padding 0.35s ease-out;
  padding: 0 24px;
}

.faq-item.active .faq-answer {
  padding: 0 24px 22px;
}

.faq-answer p {
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--ink-secondary);
}

/* ==========================================================================
   BANNER FINAL CTA
   ========================================================================== */
.final-banner {
  background: var(--brand-gradient);
  border-radius: var(--radius-xl);
  padding: 64px 36px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.final-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.final-banner h2 {
  color: white;
  margin-bottom: 16px;
}

.final-banner p {
  color: rgba(255, 255, 255, 0.9);
  max-width: 56ch;
  margin: 0 auto 30px;
  font-size: 1.15rem;
}

.final-banner-cta-group {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.final-banner .btn-primary {
  background: white;
  color: var(--brand-primary);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.final-banner .btn-primary:hover {
  background: #f8fafc;
  transform: translateY(-2px);
}

.final-banner .btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.final-banner .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 48px 0 36px;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.footer-consultancy {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.84rem;
}

/* ==========================================================================
   MODAL DE ORDEN DE DESTRABE (DEMOSTRACIÓN INTERACTIVA)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-normal);
  padding: 32px;
  position: relative;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-primary);
  font-size: 1.1rem;
}

.resolution-sheet {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 28px;
  font-family: 'Public Sans', serif;
  box-shadow: var(--shadow-sm);
  margin-top: 18px;
}

[data-theme="dark"] .resolution-sheet {
  background: #f8fafc;
  color: #0f172a;
}

.resolution-header {
  border-bottom: 2px solid #0f172a;
  padding-bottom: 12px;
  margin-bottom: 18px;
  text-align: center;
}

.resolution-header h4 {
  color: #0f172a;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.resolution-body {
  font-size: 0.9rem;
  line-height: 1.6;
}

.resolution-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.resolution-row b {
  min-width: 130px;
  color: #334155;
}

.resolution-box {
  background: #f1f5f9;
  border-left: 4px solid #2563eb;
  padding: 12px 14px;
  margin: 14px 0;
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem;
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLETS Y MÓVILES)
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .form-wrapper {
    grid-template-columns: 1fr;
  }

  .simulator-box {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 820px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .steps-grid {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-row {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.col-span-2 {
    grid-column: span 1;
  }

  .form-body {
    padding: 30px 20px;
  }

  .form-info-panel {
    padding: 30px 20px;
  }
}

@media (max-width: 640px) {
  .header-nav {
    height: 68px;
    gap: 8px;
  }
  .nav-actions {
    gap: 8px;
  }
  .nav-actions .btn-sm {
    padding: 7px 12px;
    font-size: 0.82rem;
    gap: 5px;
  }
  .theme-toggle-btn {
    width: 36px;
    height: 36px;
  }
}

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

  .project-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .project-action-btn {
    justify-content: center;
  }

  .principle-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 440px) {
  .logo-brand span {
    display: none;
  }
}
