/* ─── IPFF ROI Calculator — style.css v1.0.0 ─── */

.ipff-calc-root *,
.ipff-calc-root *::before,
.ipff-calc-root *::after {
  box-sizing: border-box;
}

.ipff-calc-root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #1a1a2e;
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
  line-height: 1.5;
}

/* ── CABECERA ── */
.ipff-header {
  background: #355BEA;
  border-radius: 12px;
  padding: 2rem 2.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}
.ipff-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #0EDE85;
  margin-bottom: .5rem;
}
.ipff-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 .5rem;
  line-height: 1.3;
}
.ipff-subtitle {
  font-size: 14px;
  color: #8aaad4;
  margin: 0;
  max-width: 560px;
}
.ipff-badge {
  display: inline-block;
  background: #0EDE85;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── INPUTS GRID ── */
.ipff-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 640px) {
  .ipff-inputs-grid { grid-template-columns: 1fr; }
  .ipff-header { flex-direction: column; }
  .ipff-metrics-row { grid-template-columns: 1fr 1fr; }
  .ipff-result-grid { grid-template-columns: 1fr 1fr; }
}

.ipff-input-card {
  background: #fff;
  border: 1px solid #e5eaf2;
  border-radius: 12px;
  padding: 1.5rem;
}
.ipff-card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #6B7CB8;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── CAMPOS ── */
.ipff-field {
  margin-bottom: 1.25rem;
}
.ipff-field:last-child { margin-bottom: 0; }

.ipff-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 8px;
  font-weight: 500;
}
.ipff-field-val {
  font-weight: 700;
  color: #355BEA;
  font-size: 13px;
  white-space: nowrap;
}
.ipff-field-help {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 6px;
  line-height: 1.4;
}
.ipff-range-limits {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #9ca3af;
  margin-top: 3px;
}

/* Range input */
.ipff-range {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: #e5eaf2;
  outline: none;
  cursor: pointer;
}
.ipff-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #355BEA;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(13,31,92,.25);
  transition: transform .1s;
}
.ipff-range::-webkit-slider-thumb:hover { transform: scale(1.15); }
.ipff-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #355BEA;
  cursor: pointer;
  border: 2px solid #fff;
}
.ipff-range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(0,180,126,.35); }

/* Select */
.ipff-select {
  width: 100%;
  font-size: 13px;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #1a1a2e;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.ipff-select:focus { outline: 2px solid #0EDE85; outline-offset: 1px; }

/* Tooltip */
.ipff-tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e5eaf2;
  color: #6B7CB8;
  font-size: 10px;
  cursor: help;
  position: relative;
}
.ipff-tooltip {
  display: none;
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  background: #1a1a2e;
  color: #fff;
  font-size: 11px;
  padding: 8px 12px;
  border-radius: 6px;
  line-height: 1.5;
  z-index: 100;
  pointer-events: none;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.ipff-tooltip-trigger:hover .ipff-tooltip,
.ipff-tooltip-trigger:focus .ipff-tooltip { display: block; }

/* ── MÉTRICAS RESUMEN ── */
.ipff-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.ipff-metric {
  border-radius: 10px;
  padding: .875rem 1rem;
  text-align: center;
}
.ipff-metric--red { background: #fef2f2; border: 1px solid #fecaca; }
.ipff-metric--dark { background: #355BEA; }

.ipff-metric-label {
  font-size: 11px;
  color: #6B7CB8;
  margin-bottom: 4px;
  line-height: 1.3;
}
.ipff-metric--dark .ipff-metric-label { color: #8aaad4; }
.ipff-metric-val {
  font-size: 20px;
  font-weight: 700;
  color: #c0392b;
}
.ipff-metric--dark .ipff-metric-val { color: #fff; }

/* ── BLOQUE RESULTADO ── */
.ipff-result-block {
  background: #355BEA;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.ipff-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.ipff-result-item { text-align: center; }
.ipff-result-label {
  font-size: 11px;
  color: #8aaad4;
  margin-bottom: 4px;
  line-height: 1.3;
}
.ipff-result-val {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.ipff-result-val--accent { color: #0EDE85; }

.ipff-roi-highlight {
  background: #0EDE85;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.ipff-roi-label { font-size: 14px; color: #fff; font-weight: 600; }
.ipff-roi-sub { font-size: 11px; color: rgba(255,255,255,.75); margin-top: 2px; }
.ipff-roi-num { font-size: 32px; font-weight: 700; color: #fff; white-space: nowrap; }

/* ── GRÁFICO ── */
.ipff-chart-block {
  background: #fff;
  border: 1px solid #e5eaf2;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.ipff-chart-legend {
  display: flex;
  gap: 1.25rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}
.ipff-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #6B7CB8;
}
.ipff-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.ipff-chart-wrap {
  position: relative;
  width: 100%;
  height: 280px;
}

/* ── DESGLOSE ── */
.ipff-breakdown-block {
  background: #fff;
  border: 1px solid #e5eaf2;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.ipff-table-wrap { overflow-x: auto; }
.ipff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 420px;
}
.ipff-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6B7CB8;
  padding: 0 0 10px;
  border-bottom: 1px solid #e5eaf2;
}
.ipff-table th:not(:first-child) { text-align: right; }
.ipff-table td {
  padding: 10px 0 8px;
  border-bottom: 1px solid #f3f4f6;
  color: #4b5563;
  vertical-align: middle;
}
.ipff-table td:not(:first-child) { text-align: right; }
.ipff-table .td-red { color: #c0392b; font-weight: 600; }
.ipff-table .td-green { color: #0EDE85; font-weight: 600; }
.ipff-table .total-row td {
  font-weight: 700;
  color: #1a1a2e;
  border-bottom: none;
  padding-top: 12px;
}
.ipff-disclaimer {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 1rem;
  line-height: 1.5;
}

/* ── CTA ── */
.ipff-cta-block {
  background: #f0fdf9;
  border: 1px solid #bbf7e0;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.ipff-cta-text strong {
  display: block;
  font-size: 15px;
  color: #355BEA;
  margin-bottom: 4px;
}
.ipff-cta-text p {
  font-size: 13px;
  color: #374151;
  margin: 0;
}
.ipff-cta-btn {
  display: inline-block;
  background: #355BEA;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  padding: .75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, transform .1s;
}
.ipff-cta-btn:hover {
  background: #0EDE85;
  transform: translateY(-1px);
}
