/* ============================================================
   THM — Componente Calculadora ROI ★ Light Theme High Contrast
   ============================================================ */

.roi-calculator {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  margin-top: var(--space-12);
  overflow: hidden;
}

.roi-calculator::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.roi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-10);
  align-items: center;
}

.roi-controls {
  display: flex;
  flex-direction: column;
  /* Los controles reparten el alto de la tarjeta de resultados en vez de
     apelotonarse en el centro dejando un hueco muerto arriba y abajo. */
  justify-content: space-evenly;
  gap: var(--space-8);
}

.roi-slider-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.roi-slider-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
}

.roi-slider-label strong {
  color: var(--color-accent-1);
  font-size: var(--text-base);
  font-weight: 800;
  white-space: nowrap;
  margin-left: var(--space-3);
}

.roi-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.1);
  outline: none;
}

.roi-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-accent-grad);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  transition: transform 0.15s ease;
}

.roi-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.roi-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: var(--color-accent-1);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.roi-slider:focus-visible {
  outline: 3px solid var(--color-accent-1);
  outline-offset: 4px;
}

/* Resultados Card Ultra-Clara de Alto Contraste */
.roi-results-card {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.98) 0%, rgba(238, 242, 255, 0.98) 100%);
  border: 1.5px solid rgba(79, 70, 229, 0.3);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.08);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.roi-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding-bottom: var(--space-4);
}

.roi-metric:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.roi-metric-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.roi-metric-value {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: clamp(var(--text-xl), 2vw, var(--text-3xl));
  font-weight: 800;
  white-space: nowrap;
  /* Color sólido: el gradiente recortado a texto falla AA en el extremo cian */
  color: var(--color-accent-1);
}

.roi-metric-value--highlight {
  color: var(--color-success-strong);
  font-size: clamp(var(--text-3xl), 3vw, var(--text-4xl));
}

/* Etiqueta a dos líneas: nombre de la métrica + de dónde sale */
.roi-metric-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: var(--space-4);
}

.roi-metric-label small {
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

.roi-metric-label small strong {
  color: var(--color-text-primary);
  font-weight: var(--weight-semibold);
}

.roi-results-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-text-muted);
}

/* Fila del total: separada del resto para que sea la que se lee primero */
.roi-metric--total {
  margin-top: var(--space-2);
  padding-top: var(--space-5);
  border-top: 2px solid rgba(79, 70, 229, 0.25);
  border-bottom: none;
  padding-bottom: 0;
}

/* El veredicto: valor generado frente a la cuota */
.roi-verdict {
  margin: 0;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--color-accent-1);
  color: #ffffff;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  text-align: center;
}

.roi-verdict__multiple {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  white-space: nowrap;
  font-weight: 800;
  vertical-align: middle;
  margin: 0 var(--space-1);
}

/* Los supuestos, a la vista: la cifra es una estimación y se dice */
.roi-assumptions {
  max-width: 78ch;
  margin: var(--space-8) auto 0;
  font-size: var(--text-xs);
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
  text-align: center;
}

.roi__cta-row {
  text-align: center;
  margin-top: var(--space-8);
}

@media (max-width: 900px) {
  .roi-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .roi-calculator { padding: var(--space-6); }

  .roi-metric { align-items: flex-start; }
}
