/* ==========================================================================
   SENTIDO FINANCIERO — Hub Interactivo de Simuladores (Fase 0)
   Estética: Pizarra Blanca Editorial 60 / 25 / 15 (Mobile-First, 0 Cookies)
   ========================================================================== */

:root {
  /* 60% Dominante: Papel / Pizarra Blanca Cálida */
  --bg-page: #F6F5F0;
  --bg-card: #FFFFFF;
  --bg-subtle: #EEF2F6;
  --ink-primary: #0F172A;
  --ink-secondary: #334155;
  --ink-muted: #64748B;
  --border-ink: #0F172A;

  /* 25% Estructura y Escudo: Azul Cobalto (Álex / Liquidez) */
  --cobalt-main: #1D4ED8;
  --cobalt-dark: #1E3A8A;
  --cobalt-light: #DBEAFE;
  --cobalt-border: #2563EB;

  /* 15% Acentos Semánticos (Rojo Pérdida, Verde Compuesto, Ámbar Foco) */
  --coral-main: #DC2626;
  --coral-light: #FEE2E2;
  --emerald-main: #15803D;
  --emerald-bright: #16A34A;
  --emerald-light: #DCFCE7;
  --amber-highlight: #FACC15;
  --amber-light: #FEF9C3;

  /* Sombras estilo Whiteboard / Neo-editorial */
  --shadow-card: 4px 4px 0px #0F172A;
  --shadow-sm: 2px 2px 0px #0F172A;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  --bg-page: #0B1120;
  --bg-card: #131C31;
  --bg-subtle: #1E293B;
  --ink-primary: #F8FAFC;
  --ink-secondary: #CBD5E1;
  --ink-muted: #94A3B8;
  --border-ink: #334155;

  --cobalt-main: #3B82F6;
  --cobalt-dark: #60A5FA;
  --cobalt-light: rgba(59, 130, 246, 0.18);
  --cobalt-border: #60A5FA;

  --coral-main: #F87171;
  --coral-light: rgba(239, 68, 68, 0.18);
  --emerald-main: #4ADE80;
  --emerald-bright: #22C55E;
  --emerald-light: rgba(34, 197, 94, 0.18);
  --amber-highlight: #FACC15;
  --amber-light: rgba(250, 204, 21, 0.16);

  --shadow-card: 4px 4px 0px #020617;
  --shadow-sm: 2px 2px 0px #020617;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-page);
  color: var(--ink-primary);
  line-height: 1.5;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background-image: radial-gradient(rgba(15, 23, 42, 0.06) 1px, transparent 1px);
  background-size: 20px 20px;
  padding-bottom: 48px;
  overflow-x: hidden;
}

[data-theme="dark"] body {
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
}

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ==========================================================================
   CABECERA Y BARRA DE MARCA
   ========================================================================== */
.site-header {
  background: var(--bg-card);
  border-bottom: 2px solid var(--border-ink);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 12px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-primary);
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--cobalt-main);
  color: #FFFFFF;
  border: 2px solid var(--border-ink);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.3px;
  line-height: 1.15;
}

.brand-subtitle {
  font-size: 0.74rem;
  color: var(--ink-muted);
  font-weight: 600;
}

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

.theme-btn {
  background: var(--bg-subtle);
  color: var(--ink-primary);
  border: 2px solid var(--border-ink);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease;
}

.theme-btn:active {
  transform: translate(1px, 1px);
}

.yt-header-pill {
  background: #FF0000;
  color: #FFFFFF;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-ink);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

/* ==========================================================================
   BANNER INTELIGENTE DE ORIGEN (WHATSAPP VS EPISODIO YOUTUBE)
   ========================================================================== */
.context-banner {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-ink);
  box-shadow: var(--shadow-sm);
  background: var(--amber-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.context-banner.shared-mode {
  background: var(--cobalt-light);
  border-color: var(--cobalt-border);
}

.context-banner-text {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ep-pill {
  background: var(--amber-highlight);
  color: #0F172A;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1.5px solid #0F172A;
  font-weight: 900;
  font-size: 0.74rem;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ==========================================================================
   SELECTOR DE SIMULADORES MAESTROS (EL HUB)
   ========================================================================== */
.hub-intro {
  margin: 18px 0 14px;
}

.hub-title {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 6px;
}

.hub-desc {
  font-size: 0.9rem;
  color: var(--ink-secondary);
}

.master-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.tab-btn {
  background: var(--bg-card);
  color: var(--ink-primary);
  border: 2px solid var(--border-ink);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tab-btn:hover {
  border-color: var(--cobalt-main);
}

.tab-btn.active {
  background: var(--cobalt-main);
  color: #FFFFFF;
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-card);
}

.tab-ep-tag {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  opacity: 0.85;
}

.tab-btn.active .tab-ep-tag {
  color: var(--amber-highlight);
  opacity: 1;
}

.tab-name {
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.2;
}

@media (max-width: 580px) {
  .master-tabs {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .tab-btn {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
  }
  .tab-name {
    font-size: 0.9rem;
  }
}

/* ==========================================================================
   TARJETA PRINCIPAL DEL SIMULADOR
   ========================================================================== */
.calc-panel {
  display: none;
  background: var(--bg-card);
  border: 2.5px solid var(--border-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
  margin-bottom: 22px;
}

.calc-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

.panel-header {
  border-bottom: 2px dashed var(--border-ink);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.panel-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.panel-title {
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.25;
}

.panel-subtitle {
  font-size: 0.86rem;
  color: var(--ink-secondary);
  margin-top: 4px;
}

/* Presets rápidos de casos de los vídeos */
.preset-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  background: var(--bg-subtle);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-ink);
}

.preset-label {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.preset-chip {
  background: var(--bg-card);
  color: var(--ink-primary);
  border: 1.5px solid var(--border-ink);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.preset-chip:hover,
.preset-chip.active {
  background: var(--amber-highlight);
  color: #0F172A;
  border-color: #0F172A;
  font-weight: 800;
}

/* ==========================================================================
   CONTROLES TÁCTILES (SLIDERS + CHIPS RÁPIDOS PARA PULGAR)
   ========================================================================== */
.controls-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 22px;
}

.control-box {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-ink);
  border-radius: var(--radius-md);
  padding: 13px 14px;
}

.control-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.control-label {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink-primary);
}

.control-value-badge {
  background: var(--bg-card);
  color: var(--cobalt-main);
  border: 2px solid var(--border-ink);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  font-size: 0.98rem;
  font-weight: 900;
  min-width: 90px;
  text-align: right;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-ink);
  border-radius: 999px;
  outline: none;
  margin: 6px 0 10px;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cobalt-main);
  border: 2.5px solid #0F172A;
  box-shadow: 2px 2px 0px #0F172A;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cobalt-main);
  border: 2.5px solid #0F172A;
  box-shadow: 2px 2px 0px #0F172A;
  cursor: pointer;
}

.quick-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.q-chip {
  background: var(--bg-card);
  color: var(--ink-secondary);
  border: 1px solid var(--border-ink);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.q-chip:hover,
.q-chip.active {
  background: var(--cobalt-main);
  color: #FFFFFF;
}

/* ==========================================================================
   CAJA DE RESULTADO DE ALTO IMPACTO (SEMÁNTICA 60/25/15)
   ========================================================================== */
.result-board {
  background: var(--bg-page);
  border: 2.5px solid var(--border-ink);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 18px;
}

.result-headline-label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.result-big-figure {
  font-size: clamp(1.35rem, 5.2vw, 1.9rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.6px;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.text-danger {
  color: var(--coral-main);
}

.text-success {
  color: var(--emerald-main);
}

.text-cobalt {
  color: var(--cobalt-main);
}

.result-summary-text {
  font-size: 0.92rem;
  color: var(--ink-primary);
  font-weight: 600;
  margin-bottom: 16px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

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

.kpi-card {
  background: var(--bg-card);
  border: 2px solid var(--border-ink);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
}

.kpi-card.danger {
  background: var(--coral-light);
}

.kpi-card.success {
  background: var(--emerald-light);
}

.kpi-card.cobalt {
  background: var(--cobalt-light);
}

.kpi-title {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.kpi-val {
  font-size: 1.2rem;
  font-weight: 900;
  margin-top: 2px;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--ink-secondary);
  margin-top: 2px;
}

/* ==========================================================================
   VISUALIZADOR DE "LA REGLA DE LOS 10 HUEVOS" (VÍDEO 03)
   ========================================================================== */
.eggs-box {
  background: var(--bg-card);
  border: 2px solid var(--border-ink);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 14px;
}

.eggs-title {
  font-size: 0.85rem;
  font-weight: 900;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.eggs-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin: 10px 0;
}

@media (max-width: 480px) {
  .eggs-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.egg-item {
  background: var(--amber-light);
  border: 2px solid var(--border-ink);
  border-radius: 50% 50% 44% 44% / 60% 60% 40% 40%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.82rem;
  color: #0F172A;
  position: relative;
  transition: all 0.2s ease;
}

.egg-item.lost {
  background: var(--coral-light);
  color: var(--coral-main);
  opacity: 0.75;
}

.egg-item.lost::after {
  content: "✕";
  position: absolute;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--coral-main);
}

/* ==========================================================================
   GRÁFICO DE BARRAS COMPARATIVO EN PIZARRA (5, 10, 20 AÑOS)
   ========================================================================== */
.chart-box {
  background: var(--bg-card);
  border: 2px solid var(--border-ink);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 14px;
}

.chart-title {
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.bar-row {
  margin-bottom: 12px;
}

.bar-row:last-child {
  margin-bottom: 0;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.bar-track {
  width: 100%;
  height: 18px;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-ink);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}

.bar-fill {
  height: 100%;
  transition: width 0.25s ease;
}

.bar-fill.cobalt { background: var(--cobalt-main); }
.bar-fill.emerald { background: var(--emerald-bright); }
.bar-fill.coral { background: var(--coral-main); }
.bar-fill.amber { background: var(--amber-highlight); }

/* ==========================================================================
   PELDAÑOS Y 3 HUCHAS (VÍDEO 02 Y VÍDEO 03)
   ========================================================================== */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.step-card {
  background: var(--bg-card);
  border: 2px solid var(--border-ink);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  position: relative;
}

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.step-badge {
  font-size: 0.72rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1.5px solid #0F172A;
  text-transform: uppercase;
}

.step-badge.p1 { background: #FCA5A5; color: #0F172A; }
.step-badge.p2 { background: #93C5FD; color: #0F172A; }
.step-badge.p3 { background: #FDE047; color: #0F172A; }
.step-badge.p4 { background: #86EFAC; color: #0F172A; }

.step-amount {
  font-size: 1.08rem;
  font-weight: 900;
}

.step-desc {
  font-size: 0.84rem;
  color: var(--ink-secondary);
}

/* ==========================================================================
   MOTOR VIRAL WHATSAPP + RETORNO INTELIGENTE A LA APP DE YOUTUBE
   ========================================================================== */
.action-circuit {
  background: var(--bg-card);
  border: 2.5px solid var(--border-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px;
  margin-top: 18px;
}

.share-block {
  padding-bottom: 16px;
  border-bottom: 2px dashed var(--border-ink);
  margin-bottom: 16px;
}

.circuit-label {
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.share-buttons-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}

@media (max-width: 520px) {
  .share-buttons-row {
    grid-template-columns: 1fr;
  }
}

.btn-whatsapp {
  background: #25D366;
  color: #0F172A;
  border: 2px solid #0F172A;
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 0.94rem;
  font-weight: 900;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: center;
}

.btn-secondary-share {
  background: var(--bg-subtle);
  color: var(--ink-primary);
  border: 2px solid var(--border-ink);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.wa-preview-box {
  margin-top: 10px;
  background: var(--bg-subtle);
  border-left: 4px solid #25D366;
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  font-size: 0.78rem;
  color: var(--ink-secondary);
  font-style: italic;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Tarjeta de Retorno a la App Nativa de YouTube (1 único CTA inteligente) */
.yt-return-card {
  background: var(--cobalt-light);
  border: 2px solid var(--border-ink);
  border-radius: var(--radius-md);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.yt-return-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.yt-thumb-mock {
  width: 96px;
  height: 56px;
  border-radius: 8px;
  background: #0F172A;
  border: 2px solid var(--border-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.yt-thumb-badge {
  background: var(--amber-highlight);
  color: #0F172A;
  font-size: 0.6rem;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 3px;
}

.yt-play-icon {
  color: #FF0000;
  font-size: 1.2rem;
  line-height: 1;
  margin-top: 2px;
}

.yt-return-info h4 {
  font-size: 0.96rem;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 3px;
}

.yt-return-info p {
  font-size: 0.8rem;
  color: var(--ink-secondary);
}

.btn-yt-primary {
  background: #FF0000;
  color: #FFFFFF;
  border: 2px solid #0F172A;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 0.95rem;
  font-weight: 900;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform 0.1s ease;
}

.btn-yt-primary:active {
  transform: translate(1px, 1px);
}

/* ==========================================================================
   PIE DE PÁGINA (0 COOKIES, 0 RGPD, AVISO EDUCATIVO)
   ========================================================================== */
.site-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 2px solid var(--border-ink);
  font-size: 0.78rem;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.privacy-pill {
  background: var(--bg-card);
  border: 1.5px solid var(--border-ink);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--ink-secondary);
  font-weight: 600;
}

.toast-msg {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0F172A;
  color: #FFFFFF;
  border: 2px solid var(--amber-highlight);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.22s ease;
  z-index: 100;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
}
