/* ============================================================
   Einblick KI — Sección "Effizienz & ROI"  ·  estilos
   Todo namespaced bajo .ek para no chocar con el resto del sitio.
   Variables al inicio para rebranding rápido.
   ============================================================ */

.ek {
  /* --- Paleta (editable) --- */
  --ek-bg:        #FAF8F4;   /* off-white cálido      */
  --ek-surface:   #FFFFFF;   /* tarjetas              */
  --ek-ink:       #1A1A17;   /* texto principal       */
  --ek-muted:     #6B6A63;   /* texto secundario      */
  --ek-faint:     #9C9B92;   /* texto terciario/notas */
  --ek-line:      #E6E2D8;   /* hairlines             */
  --ek-line-2:    #D6D1C4;
  --ek-red:       #D8232A;   /* acento suizo          */
  --ek-red-soft:  #FBEDED;
  --ek-loss:      #C0392B;   /* coste/pérdida         */
  --ek-gain:      #1D7A5A;   /* ahorro/ganancia       */
  --ek-gain-soft: #E7F2EC;

  /* --- Tipografía --- */
  --ek-display: "Bricolage Grotesque", ui-sans-serif, sans-serif;
  --ek-body:    "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;

  --ek-radius:  14px;
  --ek-radius-s: 9px;

  background: var(--ek-bg);
  color: var(--ek-ink);
  font-family: var(--ek-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding: clamp(2.5rem, 6vw, 6rem) 1.25rem;
}

@media (prefers-color-scheme: dark) {
  .ek {
    --ek-bg:#14140F; --ek-surface:#1D1D17; --ek-ink:#F2EFE7; --ek-muted:#A8A69B;
    --ek-faint:#7C7A70; --ek-line:#2E2D25; --ek-line-2:#3A382F; --ek-red:#F0635A;
    --ek-red-soft:#2A1614; --ek-loss:#E8736A; --ek-gain:#5FC79E; --ek-gain-soft:#16261E;
  }
}

.ek *, .ek *::before, .ek *::after { box-sizing: border-box; }
.ek__wrap { max-width: 980px; margin: 0 auto; }

/* ---------- Cabecera ---------- */
.ek__head { max-width: 760px; }
.ek__eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ek-red); margin: 0 0 1.25rem;
}
.ek__tick { width: 22px; height: 2px; background: var(--ek-red); display: inline-block; }
.ek__title {
  font-family: var(--ek-display);
  font-weight: 700; font-size: clamp(2rem, 5.2vw, 3.4rem);
  line-height: 1.04; letter-spacing: -0.02em; margin: 0 0 1.5rem;
}
.ek__lede { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--ek-muted); margin: 0; }
.ek__lede em { font-style: italic; color: var(--ek-ink); }
.ek__lede strong { color: var(--ek-ink); font-weight: 600; }

.ek__intro { max-width: 720px; margin: 2.75rem 0 3.5rem; }
.ek__intro p { margin: 0 0 1.5rem; }
.ek__intro strong { font-weight: 600; }
.ek__quote {
  font-family: var(--ek-display); font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  line-height: 1.25; font-weight: 400; letter-spacing: -0.01em;
  margin: 0; padding: 0 0 0 1.5rem; border-left: 3px solid var(--ek-red);
}
.ek__quote cite { display: block; margin-top: .9rem; font-size: .8rem; font-style: normal;
  letter-spacing: .04em; color: var(--ek-faint); font-family: var(--ek-body); }

/* ---------- Tarjeta genérica ---------- */
.ek-card {
  background: var(--ek-surface);
  border: 1px solid var(--ek-line);
  border-radius: var(--ek-radius);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  margin-bottom: 1.5rem;
}
.ek-card__label {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ek-muted); margin-bottom: 1rem;
}
.ek-num {
  font-family: var(--ek-display); font-weight: 700; color: var(--ek-red);
  border: 1px solid var(--ek-line-2); border-radius: 6px; padding: 1px 7px; font-size: 12px;
  letter-spacing: 0;
}
.ek-card__title {
  font-family: var(--ek-display); font-weight: 500;
  font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.1; letter-spacing: -0.015em;
  margin: 0 0 .5rem;
}
.ek-card__sub { color: var(--ek-muted); margin: 0 0 2rem; font-size: 1rem; }

/* ---------- Calculadora: controles ---------- */
.ek-calc__controls {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem 2rem; margin-bottom: 2.25rem;
}
.ek-field label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 14px; color: var(--ek-muted); margin-bottom: 8px; font-weight: 500;
}
.ek-field output {
  font-family: var(--ek-display); font-weight: 700; font-size: 1.05rem;
  color: var(--ek-ink); font-variant-numeric: tabular-nums;
}
.ek-field input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 24px;
  background: transparent; outline: none; cursor: pointer;
  display: block; margin: 0;
}
.ek-field input[type="range"]::-webkit-slider-runnable-track {
  width: 100%; height: 3px; background: var(--ek-line-2); border-radius: 99px;
}
.ek-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ek-red); border: 3px solid var(--ek-surface);
  box-shadow: 0 0 0 1px var(--ek-red); margin-top: -8.5px;
  transition: transform .12s ease;
}
.ek-field input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.18); }
.ek-field input[type="range"]::-moz-range-track {
  width: 100%; height: 3px; background: var(--ek-line-2); border-radius: 99px;
}
.ek-field input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--ek-red);
  border: 3px solid var(--ek-surface); box-shadow: 0 0 0 1px var(--ek-red); cursor: pointer;
}
.ek-field input[type="range"]:focus-visible { box-shadow: 0 0 0 3px var(--ek-red-soft); }

/* ---------- Calculadora: stats principales ---------- */
.ek-calc__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px; background: var(--ek-line); border: 1px solid var(--ek-line);
  border-radius: var(--ek-radius-s); overflow: hidden; margin-bottom: 1.25rem;
}
.ek-stat { background: var(--ek-surface); padding: 1.4rem 1.5rem; }
.ek-stat--loss { background: var(--ek-red-soft); }
.ek-stat--gain { background: var(--ek-gain-soft); }
.ek-stat__k { display: block; font-size: 13px; color: var(--ek-muted); font-weight: 500; margin-bottom: 10px; }
.ek-stat__v {
  display: block; font-family: var(--ek-display); font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.ek-stat--loss .ek-stat__v { color: var(--ek-loss); }
.ek-stat--gain .ek-stat__v { color: var(--ek-gain); }
.ek-stat__u { display: block; font-size: 12.5px; color: var(--ek-faint); margin-top: 9px; }
.ek-stat--gain .ek-stat__u #ek-m-roi { color: var(--ek-gain); font-weight: 600; }

/* ---------- Calculadora: pills secundarias ---------- */
.ek-calc__secondary { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 2rem; }
.ek-pill {
  font-size: 13.5px; color: var(--ek-muted); background: var(--ek-bg);
  border: 1px solid var(--ek-line); border-radius: 99px; padding: 7px 15px;
}
.ek-pill span {
  font-family: var(--ek-display); font-weight: 700; color: var(--ek-ink);
  font-variant-numeric: tabular-nums;
}

.ek-chart {
  display: block;
  position: relative;
  width: 100%;
  margin: 2.25rem 0 1.75rem;
  box-sizing: border-box;
}
.ek-chart__bars {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 200px;
  border-bottom: 2px solid var(--ek-line);
  padding-bottom: 10px;
  position: relative;
  box-sizing: border-box;
  gap: 15px;
}
.ek-chart__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}
.ek-chart__bar {
  width: 100%;
  max-width: 68px;
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  justify-content: center;
  min-height: 4px;
}
.ek-chart__bar--gain {
  background: var(--ek-gain);
}
.ek-chart__bar--loss {
  background: var(--ek-red);
}
.ek-chart__bar--net {
  background: var(--ek-ink);
}
.ek-chart__val {
  position: absolute;
  top: -24px;
  font-family: var(--ek-display);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ek-ink);
  white-space: nowrap;
}
.ek-chart__label {
  font-size: 12.5px;
  color: var(--ek-muted);
  text-align: center;
  margin-top: 10px;
  line-height: 1.3;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .ek-chart__bar {
    max-width: 48px;
  }
  .ek-chart__val {
    font-size: 11.5px;
    top: -22px;
  }
  .ek-chart__label {
    font-size: 11.5px;
    white-space: normal;
  }
}

.ek-note { font-size: 12.5px; line-height: 1.55; color: var(--ek-faint); margin: 0; }

/* ---------- Bloque 2: Wer profitiert ---------- */
.ek-who { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1.5rem; }
.ek-who__tab {
  font-family: var(--ek-body); font-size: 14px; font-weight: 500; color: var(--ek-muted);
  background: var(--ek-bg); border: 1px solid var(--ek-line); border-radius: 99px;
  padding: 9px 16px; cursor: pointer; transition: all .15s ease; display: inline-flex; align-items: center; gap: 8px;
}
.ek-who__icon { color: var(--ek-line-2); font-size: 9px; transition: color .15s ease; }
.ek-who__tab:hover { border-color: var(--ek-line-2); color: var(--ek-ink); }
.ek-who__tab.is-active { background: var(--ek-ink); color: var(--ek-bg); border-color: var(--ek-ink); }
.ek-who__tab.is-active .ek-who__icon { color: var(--ek-red); }
.ek-who__panel {
  border: 1px solid var(--ek-line); border-radius: var(--ek-radius-s);
  padding: 1.75rem; background: var(--ek-bg); min-height: 150px;
}
.ek-who__panel h4 {
  font-family: var(--ek-display); font-weight: 500; font-size: 1.25rem; margin: 0 0 .25rem;
}
.ek-who__pain { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ek-red); margin: 0 0 1rem; }
.ek-who__panel p { margin: 0; color: var(--ek-muted); }
.ek-who__panel.is-fade { opacity: 0; transform: translateY(6px); }
.ek-who__panel { transition: opacity .25s ease, transform .25s ease; }

/* ---------- Bloque 3: Zufriedenheit ---------- */
.ek-sat__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.75rem 2rem; margin-bottom: 2.25rem;
}
.ek-sat__item { border-top: 2px solid var(--ek-red); padding-top: 1rem; }
.ek-sat__v {
  font-family: var(--ek-display); font-weight: 700; font-size: clamp(2.6rem, 7vw, 3.8rem);
  line-height: 1; letter-spacing: -0.03em; color: var(--ek-ink); font-variant-numeric: tabular-nums;
  margin-bottom: .75rem;
}
.ek-sat__item p { margin: 0; font-size: 15px; color: var(--ek-muted); line-height: 1.55; }
.ek-sat__lead { font-size: 1.1rem; line-height: 1.55; margin: 0 0 1.5rem; max-width: 680px; }
.ek-sat__lead strong { font-weight: 600; }

/* ---------- CTA ---------- */
.ek-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1.25rem; margin-top: 2.5rem; padding: 2rem clamp(1.5rem, 3.5vw, 2.5rem);
  background: var(--ek-ink); border-radius: var(--ek-radius); color: var(--ek-bg);
}
.ek-cta p { margin: 0; font-family: var(--ek-display); font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  font-weight: 500; line-height: 1.2; max-width: 480px; }
.ek-cta__btn {
  flex-shrink: 0; background: var(--ek-red); color: #fff; text-decoration: none;
  font-weight: 600; font-size: 15px; padding: 14px 26px; border-radius: 99px;
  transition: transform .12s ease, background .15s ease; white-space: nowrap;
}
.ek-cta__btn:hover { transform: translateY(-2px); background: #c01e24; }

@media (max-width: 560px) {
  .ek-calc__grid { grid-template-columns: 1fr; }
  .ek-cta { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .ek *, .ek *::before, .ek *::after { transition: none !important; animation: none !important; }
}

/* ============================================================
   Onboarding Hints (Micro-interactions)
   ============================================================ */
.ek-field {
  position: relative;
}

.slider-hint {
  position: absolute;
  bottom: 2px;
  left: 20px;
  right: 20px;
  height: 20px;
  pointer-events: none;
  z-index: 10;
  display: flex;
  align-items: center;
  overflow: visible;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.slider-hint__dot {
  width: 20px;
  height: 20px;
  background: rgba(216, 35, 42, 0.25);
  border: 2px solid var(--ek-red);
  border-radius: 50%;
  position: absolute;
  left: 0;
  transform: translateY(-50%);
  top: 50%;
  animation: slider-slide 2.8s ease-in-out infinite;
}

@keyframes slider-slide {
  0% {
    left: 8%;
    opacity: 0;
    transform: translateY(-50%) scale(0.85);
    box-shadow: none;
  }
  12% {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
  50% {
    left: 88%;
    opacity: 1;
    transform: translateY(-50%) scale(1);
    box-shadow: -5px 0 0 -2px rgba(216, 35, 42, 0.2), -10px 0 0 -4px rgba(216, 35, 42, 0.1);
  }
  62% {
    opacity: 0;
    transform: translateY(-50%) scale(0.85);
  }
  100% {
    left: 88%;
    opacity: 0;
    transform: translateY(-50%) scale(0.85);
  }
}

.ek-field:hover .slider-hint,
.ek-field:focus-within .slider-hint,
.ek-field input[type="range"]:active ~ .slider-hint {
  opacity: 0 !important;
}

/* Button Pulse Hint */
.table-selector-btn {
  position: relative;
}

.btn-pulse-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(216, 35, 42, 0.15);
  border: 1.5px solid var(--ek-red);
  pointer-events: none;
  z-index: 5;
  animation: btn-pulse 1.6s cubic-bezier(0.25, 0, 0, 1) infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

@keyframes btn-pulse {
  0% {
    width: 14px;
    height: 14px;
    opacity: 0.85;
  }
  100% {
    width: 46px;
    height: 46px;
    opacity: 0;
  }
}
