/* ═══════════════════════════════════════════════════════════════════════════
   Calculadora de Tiempo y Fuga Operativa — NikkoDev OS
   Diseño: Modo Claro Menta (NikkoDev) + Efectos Vivos de Fondo (FX Engine)
   Enfoque: Ahorro tangible de tiempo, jornadas laborales y retorno operativo
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Tokens de Color y Paleta Menta ── */
@property --fx-a     { syntax: "<color>"; inherits: true; initial-value: #10B981; }
@property --fx-b     { syntax: "<color>"; inherits: true; initial-value: #38BDF8; }
@property --fx-c     { syntax: "<color>"; inherits: true; initial-value: #8B5CF6; }
@property --fx-solid { syntax: "<color>"; inherits: true; initial-value: #10B981; }
@property --fx-ink   { syntax: "<color>"; inherits: true; initial-value: #047857; }

:root {
  color-scheme: light;

  /* Paleta Menta NikkoDev */
  --fx-a: #10B981;
  --fx-b: #38BDF8;
  --fx-c: #8B5CF6;
  --fx-solid: #10B981;
  --fx-ink: #047857;

  /* Canvas y Superficies */
  --bg: #F8FAFC;
  --bg-secondary: #F1F5F9;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-card: rgba(255, 255, 255, 0.90);
  --surface-hover: rgba(255, 255, 255, 0.98);
  --surface-active: #FFFFFF;

  /* Colores Funcionales */
  --mint: #10B981;
  --mint-dark: #047857;
  --mint-light: #ECFDF5;
  --mint-glow: rgba(16, 185, 129, 0.28);
  --cyan: #0284C7;
  --cyan-bright: #38BDF8;
  --amber: #D97706;
  --amber-light: #FFFBEB;
  --rose: #E11D48;
  --rose-light: #FFF1F2;

  /* Tipografía y Contraste (WCAG AAA) */
  --text-main: #0F172A;     /* Slate 900 */
  --text-muted: #334155;    /* Slate 700 */
  --text-dim: #64748B;      /* Slate 500 */

  /* Bordes y Reflejos de Vidrio Quantum */
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.16);
  --line-mint: rgba(16, 185, 129, 0.35);

  --glass-card: color-mix(in oklab, var(--fx-a) 4%, rgba(255, 255, 255, 0.76));
  --glass-blur: blur(24px) saturate(190%);
  --glass-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 0 0 1px rgba(255, 255, 255, 0.5) inset,
    0 18px 44px -10px rgba(15, 23, 42, 0.07),
    0 4px 12px rgba(15, 23, 42, 0.03);
  --glass-shadow-hover:
    0 1px 0 #ffffff inset,
    0 0 0 1px rgba(255, 255, 255, 0.8) inset,
    0 24px 56px -12px rgba(16, 185, 129, 0.18),
    0 6px 16px rgba(15, 23, 42, 0.05);

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Modo Oscuro Obsidian */
html.dark {
  color-scheme: dark;
  --bg: #0b0d10;
  --bg-secondary: #10141d;
  --surface: rgba(18, 24, 38, 0.78);
  --surface-card: rgba(22, 29, 46, 0.72);
  --surface-hover: rgba(29, 39, 62, 0.82);
  --surface-active: rgba(35, 48, 77, 0.92);

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);

  --glass-card: color-mix(in oklab, var(--fx-a) 7%, rgba(15, 22, 35, 0.65));
  --glass-blur: blur(24px) saturate(190%);
  --glass-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 24px 56px -14px rgba(0, 0, 0, 0.6);
  --glass-shadow-hover:
    0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 28px 64px -12px rgba(16, 185, 129, 0.25);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg);
}

html::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

html.dark::before {
  opacity: 0.045;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 2.8rem;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

/* ── 2. Fondo Vivo FX ── */
.fx-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

.fx-blob {
  position: absolute;
  width: 62vmax;
  height: 62vmax;
  border-radius: 50%;
  opacity: 0.24;
  will-change: transform;
  background: radial-gradient(closest-side, var(--c), transparent);
}

html.dark .fx-blob {
  opacity: 0.28;
}

.fx-blob.b1 {
  --c: var(--fx-a);
  top: -18vmax;
  left: -12vmax;
  animation: fx-drift-1 32s ease-in-out infinite alternate;
}

.fx-blob.b2 {
  --c: var(--fx-b);
  top: 12vmax;
  right: -20vmax;
  opacity: 0.18;
  animation: fx-drift-2 38s ease-in-out infinite alternate;
}

.fx-blob.b3 {
  --c: var(--fx-c);
  bottom: -24vmax;
  left: 15vw;
  opacity: 0.14;
  animation: fx-drift-3 44s ease-in-out infinite alternate;
}

@keyframes fx-drift-1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(10vmax, 7vmax, 0) scale(1.15); }
}

@keyframes fx-drift-2 {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to { transform: translate3d(-10vmax, 6vmax, 0) scale(0.94); }
}

@keyframes fx-drift-3 {
  from { transform: translate3d(0, 0, 0) scale(0.96); }
  to { transform: translate3d(8vmax, -8vmax, 0) scale(1.1); }
}

.fx-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--fx-ink) 12%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--fx-ink) 12%, transparent) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.65;
  -webkit-mask-image: radial-gradient(380px circle at var(--px, 50%) var(--py, 28%), #000, transparent 75%);
  mask-image: radial-gradient(380px circle at var(--px, 50%) var(--py, 28%), #000, transparent 75%);
}

.fx-net {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
}

.fx-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 35%, transparent 55%, color-mix(in srgb, var(--bg) 75%, transparent));
}

/* ── 3. Layout Principal ── */
.app-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 1.15rem 1.15rem 2.5rem;
  position: relative;
  z-index: 1;
}

/* ── 4. Navegación ── */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.95rem;
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  margin-bottom: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(56, 189, 248, 0.28));
  border: 1.5px solid rgba(16, 185, 129, 0.45);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--mint-dark);
}

html.dark .brand-icon {
  color: #34d399;
}

.brand-title {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.theme-toggle:hover {
  background: var(--surface-hover);
  color: var(--text-main);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

/* ── 5. Hero Humanizado ── */
.hero {
  margin-bottom: 1.75rem;
  text-align: left;
}

.hero-title {
  font-size: 1.65rem;
  font-weight: 850;
  line-height: 1.25;
  letter-spacing: -0.035em;
  margin-bottom: 0.65rem;
  color: var(--text-main);
}

.hero-title .highlight {
  background: linear-gradient(135deg, #059669 0%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.dark .hero-title .highlight {
  background: linear-gradient(135deg, #34d399 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* ── 6. Paneles Vidrio Quantum ── */
.glass-panel {
  position: relative;
  isolation: isolate;
  background: var(--glass-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--glass-shadow);
  margin-bottom: 1.5rem;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

.glass-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(260px circle at var(--mx, 50%) var(--my, -30%), color-mix(in srgb, var(--fx-a) 80%, white), transparent 70%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0) 70%, color-mix(in srgb, var(--fx-b) 50%, white));
  opacity: 0.45;
  transition: opacity 0.35s var(--ease);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.glass-panel:hover::after {
  opacity: 0.85;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.015em;
}

.panel-title svg {
  color: var(--mint-dark);
}

html.dark .panel-title svg {
  color: var(--cyan-bright);
}

.panel-hint {
  font-size: 0.74rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-weight: 600;
}

/* ── 7. Sectores ── */
.sector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

@media (min-width: 480px) {
  .sector-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .sector-grid .sector-btn:last-child {
    grid-column: span 2;
  }
}

@media (min-width: 580px) {
  .sector-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  .sector-grid .sector-btn:last-child {
    grid-column: span 1;
  }
}

.sector-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.75rem 0.85rem;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-align: left;
  user-select: none;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
}

.sector-btn .sec-icon {
  font-size: 1.3rem;
  margin-bottom: 0.35rem;
}

.sector-btn .sec-name {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.sector-btn .sec-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 0.18rem;
}

.sector-btn:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.sector-btn.active {
  background: var(--mint-light);
  border-color: var(--mint);
  box-shadow: 0 4px 16px -2px rgba(16, 185, 129, 0.35);
}

html.dark .sector-btn.active {
  background: rgba(16, 185, 129, 0.15);
}

.sector-btn.active .sec-name {
  color: var(--mint-dark);
}

html.dark .sector-btn.active .sec-name {
  color: #34d399;
}

.sector-context-box {
  background: rgba(16, 185, 129, 0.07);
  border-left: 3.5px solid var(--mint);
  padding: 0.75rem 0.95rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 1.35rem;
}

.sector-context-box strong {
  color: var(--text-main);
}

/* ── 8. Controles y Sliders Táctiles Progresivos ── */
.control-group {
  margin-bottom: 1.45rem;
}

.control-group:last-child {
  margin-bottom: 0;
}

.control-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.6rem;
}

.control-label {
  font-size: 0.9rem;
  font-weight: 750;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.control-val-badge {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--mint-dark);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.32);
  padding: 0.22rem 0.7rem;
  border-radius: var(--radius-sm);
  transition: transform 0.15s ease;
}

html.dark .control-val-badge {
  color: #34d399;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-step {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  border: 1px solid var(--line);
  color: var(--text-main);
  font-size: 1.25rem;
  font-weight: bold;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.btn-step:active {
  background: var(--surface-active);
  transform: scale(0.92);
}

/* Slider Track Relleno Dinámico */
.custom-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.1);
  outline: none;
  cursor: pointer;
  transition: background 0.1s ease;
}

html.dark .custom-range {
  background: rgba(255, 255, 255, 0.12);
}

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #0284C7);
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.45), 0 1px 3px rgba(0, 0, 0, 0.2);
  border: 3px solid #ffffff;
  cursor: grab;
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}

.custom-range:active::-webkit-slider-thumb {
  cursor: grabbing;
  transform: scale(1.18);
  box-shadow: 0 5px 16px rgba(16, 185, 129, 0.65);
}

.custom-range::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #0284C7);
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.45);
  border: 3px solid #ffffff;
  cursor: grab;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ── 9. Costo Hora en COP ── */
.cost-input-wrapper {
  position: relative;
  margin-bottom: 0.6rem;
}

.cost-input-symbol {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--text-dim);
  font-size: 1.05rem;
}

.cost-input {
  width: 100%;
  background: var(--surface-card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem 0.8rem 2.3rem;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.cost-input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3.5px rgba(16, 185, 129, 0.2);
}

.preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.preset-pill {
  background: var(--surface-card);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 0.32rem 0.7rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.preset-pill:hover, .preset-pill.active {
  background: var(--mint-light);
  border-color: var(--mint);
  color: var(--mint-dark);
}

html.dark .preset-pill.active {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

.cost-footnote {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.45rem;
  line-height: 1.45;
}

/* ═══════════════════════════════════════════════════════════════════════════
   10. RESULTADOS: PROTAGONISMO EN EL AHORRO DE TIEMPO
   ═══════════════════════════════════════════════════════════════════════════ */
.results-panel {
  position: relative;
  isolation: isolate;
  background: var(--glass-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--glass-shadow-hover), 0 0 30px -5px var(--mint-glow);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.results-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4.5px;
  background: linear-gradient(90deg, #10B981 0%, #38BDF8 60%, #8B5CF6 100%);
}

/* ── Tarjeta Protagonista: Horas y Jornadas Recuperables ── */
.time-hero-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(56, 189, 248, 0.08) 100%);
  border: 1.5px solid rgba(16, 185, 129, 0.38);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.25rem;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}

html.dark .time-hero-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(56, 189, 248, 0.12) 100%);
}

.time-badge-top {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--mint);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--mint-dark);
  margin-bottom: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

html.dark .time-badge-top {
  color: #34d399;
}

.time-hero-number-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.time-hero-val {
  font-family: var(--font-mono);
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #059669 0%, #0284C7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.dark .time-hero-val {
  background: linear-gradient(135deg, #34d399 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.time-hero-unit {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-muted);
}

.time-hero-subtitle {
  font-size: 0.95rem;
  font-weight: 750;
  color: var(--text-main);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Comparativa Visual de Barras (Antes vs Después) ── */
.time-bar-compare {
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
}

html.dark .time-bar-compare {
  background: rgba(0, 0, 0, 0.25);
}

.bar-row {
  margin-bottom: 0.7rem;
}

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

.bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.bar-header .label-before {
  color: var(--rose);
}

.bar-header .label-after {
  color: var(--mint-dark);
}

html.dark .bar-header .label-after {
  color: #34d399;
}

.bar-track {
  width: 100%;
  height: 10px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
  position: relative;
}

html.dark .bar-track {
  background: rgba(255, 255, 255, 0.08);
}

.bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s var(--ease);
}

.bar-fill.danger {
  background: linear-gradient(90deg, #F43F5E, #E11D48);
  width: 100%;
}

.bar-fill.success {
  background: linear-gradient(90deg, #10B981, #0284C7);
  width: 70%;
}

/* ── Grid de Métricas de Tiempo y Dinero ── */
.metrics-pill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}

.metric-pill-box {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.5rem;
  text-align: center;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.02);
}

.metric-pill-num {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 850;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 0.15rem;
}

.metric-pill-lbl {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 600;
  line-height: 1.25;
}

/* ── Resultados Financieros Secundarios ── */
.financial-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.fin-card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem;
}

.fin-tag {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.fin-val {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 850;
  line-height: 1.15;
}

.fin-val.warning {
  color: var(--amber);
}

.fin-val.danger {
  color: var(--rose);
}

.fin-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
  line-height: 1.3;
}

/* ── Tarjeta Comparativa ROI ── */
.roi-card {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: var(--radius);
  padding: 1.15rem;
  margin-bottom: 0.65rem;
}

.roi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.roi-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--mint-dark);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

html.dark .roi-title {
  color: #34d399;
}

.payback-badge {
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid var(--mint);
  color: var(--mint-dark);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 850;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

html.dark .payback-badge {
  color: #a7f3d0;
}

.roi-comparison-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(16, 185, 129, 0.2);
}

.roi-col {
  display: flex;
  flex-direction: column;
}

.roi-col-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.roi-col-num {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 850;
}

.roi-col-num.strike {
  color: #ef4444;
  text-decoration: line-through;
  opacity: 0.85;
}

.roi-col-num.inv {
  color: var(--mint-dark);
}

html.dark .roi-col-num.inv {
  color: #34d399;
}

.roi-note {
  margin-top: 0.8rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── 11. CTA Principal ── */
.cta-section {
  margin-top: 1.35rem;
}

.btn-cta-main {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #ffffff;
  font-size: 1.04rem;
  font-weight: 850;
  border: 1px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  box-shadow: 0 10px 25px -4px rgba(16, 185, 129, 0.45);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
  user-select: none;
}

.btn-cta-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -4px rgba(16, 185, 129, 0.6);
}

.btn-cta-main:active {
  transform: translateY(1px);
}

.cta-subtext {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.6rem;
}

/* ── 12. Formulario Lead Desplegable ── */
.lead-form-box {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  margin-top: 1.25rem;
  animation: slideInDown 0.25s var(--ease) forwards;
  box-shadow: var(--glass-shadow);
}

.lead-form-box.open {
  display: block;
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.lead-form-header {
  margin-bottom: 1.1rem;
}

.lead-form-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.3rem;
}

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

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

@media (min-width: 480px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.form-input {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  color: var(--text-main);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-whatsapp {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: #25D366;
  color: #063c19;
  font-size: 0.98rem;
  font-weight: 850;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.btn-whatsapp:hover {
  opacity: 0.94;
  transform: translateY(-1px);
}

.btn-whatsapp:active {
  transform: scale(0.98);
}

.alt-actions {
  display: flex;
  gap: 0.6rem;
}

.btn-secondary {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 0.9rem;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--text-main);
  border-color: var(--line-strong);
}

/* ── 13. Toast ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
  padding: 0.75rem 1.35rem;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 750;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s var(--ease);
  z-index: 1000;
}

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

/* ── 14. Footer ── */
.app-footer {
  text-align: center;
  margin-top: 2.5rem;
  padding-top: 1.45rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.app-footer a {
  color: var(--mint-dark);
  font-weight: 750;
  text-decoration: none;
}

html.dark .app-footer a {
  color: var(--cyan-bright);
}

.app-footer a:hover {
  text-decoration: underline;
}
