@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

:root {
  /* Paleta de Colores & Superficies */
  --bg-color: #f8fafc;
  --bg-secondary: #f1f5f9;
  --surface-color: #ffffff;
  --surface-muted: #f8fafc;
  
  /* Azul Marino Pizarra & Header */
  --header-bg: #0f172a;
  --header-border: #1e293b;
  --header-text: #f8fafc;
  
  /* Tipografía */
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  
  /* Bordes */
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-focus: #f59e0b;
  
  /* Acentos y Llamadas a la Acción (Ámbar / Dorado) */
  --accent: #d97706;
  --accent-hover: #b45309;
  --accent-btn-bg: #f59e0b;
  --accent-btn-hover: #d97706;
  --accent-btn-text: #0f172a;
  --accent-light: #fef3c7;
  --accent-border: #fde68a;
  
  /* Semánticos */
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;
  
  --success: #10b981;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;
  
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;
  
  --info: #3b82f6;
  --info-light: #eff6ff;
  --info-border: #bfdbfe;
  --info-text: #1d4ed8;

  /* Sombras Suaves (Soft Shadows) */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.07), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.07), 0 8px 10px -6px rgba(15, 23, 42, 0.03);

  /* Radios de Borde */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* Transiciones */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Header & Barra de Navegación — Tres Zonas (Izquierda | Centro | Derecha)
   ========================================================================== */
header.site-header {
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.nav-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 58px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0;
}

/* ── Zona Izquierda: Brand + separador + accesos primarios ── */
.nav-left {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.brand {
  font-size: 1.08rem;
  font-weight: 800;
  color: #ffffff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.brand:hover { opacity: 0.88; }

.brand i {
  color: #fbbf24;
  font-size: 1.2rem;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.45));
}

/* Separador vertical entre brand y links primarios */
.nav-divider {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 0.75rem;
  flex-shrink: 0;
}

.nav-primary {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  list-style: none;
}

/* ── Zona Centro: Links secundarios ── */
.nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
}

.nav-secondary {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  list-style: none;
}

/* ── Zona Derecha: Contacto / Selector ── */
.nav-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Estilos compartidos para todos los links de navegación */
.nav-primary a,
.nav-secondary a,
.nav-right a {
  text-decoration: none;
  color: #94a3b8;
  font-size: 0.865rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: color 0.18s ease, background 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.nav-primary a:hover,
.nav-secondary a:hover,
.nav-right a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-primary a.active,
.nav-secondary a.active,
.nav-right a.active {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  font-weight: 700;
}

/* Botón especial para Contacto (derecha) */
.nav-contact-btn {
  color: #94a3b8 !important;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: var(--radius-sm) !important;
  padding: 0.38rem 0.8rem !important;
  font-size: 0.82rem !important;
}

.nav-contact-btn:hover {
  border-color: rgba(251, 191, 36, 0.4) !important;
  color: #fbbf24 !important;
  background: rgba(251, 191, 36, 0.08) !important;
}

/* ── Menú Mobile (oculto por defecto en desktop) ── */
.nav-mobile-menu {
  display: none;
}

/* ── Hamburger (solo mobile) ── */
.nav-toggle {
  display: none;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
  margin-left: auto;
}

.nav-hamburger:hover {
  background: rgba(255, 255, 255, 0.07);
}

.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #94a3b8;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ── Responsive: colapso en mobile ── */
@media (max-width: 900px) {
  .nav-container {
    grid-template-columns: 1fr auto;
    height: auto;
    padding: 0.75rem 1rem;
    gap: 0;
  }

  .nav-left {
    grid-column: 1;
    grid-row: 1;
  }

  .nav-hamburger {
    display: flex;
    grid-column: 2;
    grid-row: 1;
  }

  /* El checkbox hidden controla el colapso sin JS */
  .nav-toggle:checked ~ .nav-mobile-menu {
    display: flex;
  }

  .nav-toggle:checked ~ label .nav-hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle:checked ~ label .nav-hamburger span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle:checked ~ label .nav-hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-mobile-menu {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.6rem 0 0.2rem;
    grid-column: 1 / -1;
    grid-row: 2;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    margin-top: 0.5rem;
  }

  .nav-center,
  .nav-right {
    display: none;
  }

  .nav-primary {
    display: none;
  }

  .nav-divider {
    display: none;
  }

  .nav-mobile-menu a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-sm);
    display: block;
    transition: color 0.18s ease, background 0.18s ease;
  }

  .nav-mobile-menu a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
  }

  .nav-mobile-menu a.active {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    font-weight: 700;
  }
}

/* ── Compatibilidad: .nav-links legacy (otras páginas) ── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: #94a3b8;
  font-size: 0.865rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
}

.nav-links a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-links a.active {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  font-weight: 700;
}

@media (max-width: 900px) {
  .nav-container:not(.nav-3col) {
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    height: auto;
    display: flex;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
  }
  .nav-links a {
    font-size: 0.82rem;
    padding: 0.32rem 0.5rem;
  }
}

/* ==========================================================================
   Estructura Principal (Main Layout)
   ========================================================================== */
main.main-content {
  flex: 1;
  max-width: 1140px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.page-title-section {
  margin-bottom: 2rem;
}

.page-title-section h1 {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.page-title-section p {
  color: var(--text-muted);
  font-size: 1.02rem;
  margin-top: 0.45rem;
  line-height: 1.65;
  max-width: 850px;
}

/* ==========================================================================
   Tarjetas & Superficies Base
   ========================================================================== */
.card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ==========================================================================
   Sección Hero
   ========================================================================== */
.hero-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 3.5rem 2.5rem;
  margin-bottom: 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(226, 232, 240, 0.6);
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent-btn-bg), transparent);
  border-radius: 9999px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--accent-light);
  color: var(--warning-text);
  border: 1px solid var(--accent-border);
  padding: 0.4rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: 0.01em;
}

.hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero-description {
  max-width: 860px;
  margin: 0 auto 1.75rem auto;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.75;
  text-wrap: balance;
}

.hero-description strong {
  color: var(--danger);
  font-weight: 700;
}

.hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.hero-btn-primary {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  color: #0f172a;
  padding: 0.75rem 1.85rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.hero-btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.32);
}

.hero-btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.85rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}

.hero-btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--text-main);
  transform: translateY(-1px);
}

.hero-footer-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 650px) {
  .hero-card {
    padding: 2.2rem 1.25rem;
  }
  .hero-title {
    font-size: 1.75rem;
  }
  .hero-description {
    font-size: 0.95rem;
  }
}

/* ==========================================================================
   Layout del Simulador & Calculadora
   ========================================================================== */
.simulator-layout,
.calc-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 960px) {
  .simulator-layout,
  .calc-layout {
    grid-template-columns: 1fr;
  }
}

.controls-card {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  height: fit-content;
  position: sticky;
  top: 5rem;
}

/* Selector de Modos (Segmented Control) */
.game-mode-nav,
.segmented-control {
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 0.4rem;
}

.mode-btn,
.seg-btn {
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.3rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  user-select: none;
  text-align: center;
}

.mode-btn i,
.seg-btn i {
  font-size: 1.15rem;
  transition: transform 0.2s ease;
}

.mode-btn:hover,
.seg-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.6);
}

.mode-btn:hover i,
.seg-btn:hover i {
  transform: translateY(-1px);
}

.mode-btn.active,
.seg-btn.active {
  background: var(--header-bg);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.2);
}

.mode-btn.active i,
.seg-btn.active i {
  color: #fbbf24;
}

@media (max-width: 650px) {
  .game-mode-nav {
    grid-template-columns: 1fr 1fr;
  }
}

.mode-panel {
  display: none;
  flex-direction: column;
  gap: 0.95rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  margin-top: 0.25rem;
}

.mode-panel.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

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

/* Presets de Rendimiento / Inversión */
.preset-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.preset-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.4rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.preset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #fffbeb;
}

.preset-btn.active {
  background: #0f172a;
  color: #fbbf24;
  border-color: #0f172a;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Formularios, Inputs y Controles
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

input[type="number"],
input[type="text"],
input[type="email"],
select,
textarea {
  border: 1px solid #cbd5e1;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  background: #ffffff;
  color: var(--text-main);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

input[type="number"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

/* Sliders (Range Input) */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  outline: none;
  margin: 0.5rem 0 0.3rem 0;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-btn-bg);
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, background 0.15s ease;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--accent);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-btn-bg);
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

/* Botones */
.btn-primary {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  color: #0f172a;
  border: 1px solid rgba(217, 119, 6, 0.3);
  font-weight: 700;
  font-family: inherit;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(245, 158, 11, 0.2);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Boleta de Parlay / Combinadas */
.parlay-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 180px;
  overflow-y: auto;
  margin: 0.5rem 0;
  padding-right: 0.25rem;
}

.parlay-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.parlay-summary-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ==========================================================================
   Grillas de Estadísticas y Métricas
   ========================================================================== */
.stats-grid,
.stats-grid-custom {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 992px) {
  .stats-grid,
  .stats-grid-custom {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .stats-grid,
  .stats-grid-custom {
    grid-template-columns: 1fr;
  }
}

.stat-item {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.stat-item:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.stat-item span {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  display: block;
}

.stat-item strong {
  display: block;
  font-size: 1.45rem;
  color: var(--text-main);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Tarjeta Destacada de Patrimonio */
.stat-item.highlight-patrimonio {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-color: rgba(245, 158, 11, 0.4);
  color: #ffffff;
}

.stat-item.highlight-patrimonio span {
  color: #fbbf24;
}

.stat-item.highlight-patrimonio strong {
  color: #ffffff;
  font-size: 1.65rem;
}

/* ==========================================================================
   Contenedor del Gráfico (Chart.js)
   ========================================================================== */
.chart-wrapper {
  height: 440px;
  position: relative;
  padding: 1.25rem;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Hitos & Equivalencias Tangibles en la Vida Real
   ========================================================================== */
.milestones-section {
  margin-top: 2rem;
}

.milestones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.milestone-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  transition: var(--transition);
}

.milestone-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.milestone-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.milestone-info h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.milestone-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.milestone-val {
  font-weight: 800;
  color: var(--success);
}

/* ==========================================================================
   Tabla de Autoevaluación & Formularios de Diagnóstico
   ========================================================================== */
.table-responsive {
  overflow-x: auto;
  margin-top: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.survey-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.survey-table th, .survey-table td {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border-color);
}

.survey-table th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.survey-table td.col-center, .survey-table th.col-center {
  text-align: center;
  width: 120px;
}

.survey-table tbody tr {
  transition: background-color 0.15s ease;
}

.survey-table tbody tr:hover {
  background-color: #f8fafc;
}

.survey-table tbody tr:last-child td {
  border-bottom: none;
}

.survey-table input[type="radio"] {
  cursor: pointer;
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

.result-box {
  margin-top: 2rem;
  padding: 1.75rem;
  border-radius: var(--radius-md);
  display: none;
  animation: fadeIn 0.3s ease-out;
}

/* ==========================================================================
   Ayuda, Contactos & Autoexclusión
   ========================================================================== */
.info-section {
  margin-bottom: 2.5rem;
}

.info-section h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  color: var(--text-main);
  border-bottom: 2px solid var(--accent-btn-bg);
  padding-bottom: 0.4rem;
  font-weight: 800;
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.contact-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  background: var(--surface-color);
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}

.contact-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.contact-card h3 {
  font-size: 1.08rem;
  color: var(--text-main);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.phone-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-light);
  color: var(--warning-text);
  border: 1px solid var(--accent-border);
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  margin: 0.5rem 0;
  font-size: 1rem;
  text-decoration: none;
  transition: var(--transition);
}

.phone-badge:hover {
  filter: brightness(0.97);
}

.step-list {
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* ==========================================================================
   Literatura Científica & Papers
   ========================================================================== */
.paper-link {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
  display: inline-block;
  margin-bottom: 0.35rem;
}

.paper-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.paper-card {
  padding: 1.6rem;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s ease;
}

.paper-card:hover {
  background-color: #fafbfc;
}

.paper-card:last-child {
  border-bottom: none;
}

.paper-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.badge {
  display: inline-block;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid #dbeafe;
}

.section-header {
  background: #f8fafc;
  padding: 1.1rem 1.6rem;
  border-bottom: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
}

.section-header:first-child {
  border-top: none;
}

.section-header h2 {
  font-size: 1.05rem;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
}

/* ==========================================================================
   Footer Institucional
   ========================================================================== */
footer.site-footer {
  background-color: var(--header-bg);
  color: #ffffff;
  border-top: 1px solid rgba(245, 158, 11, 0.3);
  padding: 3.5rem 1.5rem 2rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
}

@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.footer-col h4 {
  font-size: 0.88rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-col h4 i {
  color: #fbbf24;
  font-size: 1.1rem;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.45));
}

.footer-col p {
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.65;
  max-width: 320px;
}

/* Animación de carga para botones */
.spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}

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

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-col ul a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-col ul a:hover {
  color: #ffffff;
}

.footer-bottom {
  max-width: 1140px;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: #64748b;
  font-size: 0.82rem;
}

#autoexclusion {
  scroll-margin-top: 5rem;
}

/* ==========================================================================
   Calculadora de Costo de Oportunidad
   ========================================================================== */

/* Layout principal: sidebar de controles + área de resultados */
.calc-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  .calc-layout {
    grid-template-columns: 1fr;
  }
}

/* Panel lateral de controles */
.controls-card {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  position: sticky;
  top: 74px;
}

/* Contenedor del gráfico — altura fija CRÍTICA para Chart.js */
.chart-wrapper {
  position: relative;
  height: 360px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.chart-wrapper canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* Stats grid de 3 columnas */
.stats-grid-custom {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 700px) {
  .stats-grid-custom {
    grid-template-columns: 1fr;
  }
}

/* Tarjeta de stat individual */
.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
}

.stat-item > span {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-item > strong {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* Tarjeta de patrimonio destacada */
.highlight-patrimonio {
  background: linear-gradient(135deg, #0f4c2a 0%, #1a6b3c 50%, #064e3b 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #ffffff;
}

.highlight-patrimonio span {
  color: rgba(255,255,255,0.7) !important;
}

.highlight-patrimonio strong {
  color: #ffffff;
  font-size: 1.65rem;
}

/* Segmented control para horizonte temporal */
.segmented-control {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 0.35rem;
}

.seg-btn {
  background: transparent;
  border: none;
  border-right: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  padding: 0.45rem 0.25rem;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  text-align: center;
}

.seg-btn:last-child {
  border-right: none;
}

.seg-btn:hover {
  background: rgba(245, 158, 11, 0.08);
  color: var(--text-main);
}

.seg-btn.active {
  background: var(--accent);
  color: #0f1a0a;
  font-weight: 700;
}

/* Presets de tasa */
.preset-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.45rem;
}

.preset-btn {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.preset-btn:hover {
  border-color: var(--accent);
  color: var(--text-main);
  background: rgba(245, 158, 11, 0.06);
}

.preset-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

/* Sección de milestones */
.milestones-section {
  margin: 1.75rem 0 1rem;
}

.milestones-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

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

.milestone-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
}

.milestone-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.milestone-info h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.milestone-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.milestone-val {
  color: var(--accent);
}