/* ============================================================
   Calculadoras de Interés Compuesto y Plazo Fijo (v2)
   Layout de dos columnas: formulario (izquierda) + resultados
   con tarjetas, gráfica y desglose (derecha).
   Paleta de la marca: rojo #b30000, dorado #d4af37, verde #2e7d32.
   ============================================================ */

.calc-page { padding: 8px 0 40px; }

.calc-header { margin: 10px 0 24px; }
.calc-header h1 {
  font-size: 1.9rem;
  color: #222;
  margin: 0 0 8px;
  position: relative;
  padding-top: 14px;
}
.calc-header h1::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 52px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #b30000, #d4b200);
}
.calc-header p {
  color: #555;
  margin: 0;
  max-width: 720px;
  line-height: 1.6;
}

.calc-layout {
  display: grid;
  grid-template-columns: 370px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

/* ── Formulario ── */
.calc-form-card {
  background: #fff;
  border: 1px solid #f0ead8;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 8px 26px rgba(179, 0, 0, 0.05);
}

.calc-form-card .form-group { margin-bottom: 18px; }

.calc-form-card label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 6px;
}

/* Con .form-group en el selector para ganarle a la regla genérica
   .form-group input[type="text"] de style.css, que pisaba este estilo
   (y el padding-left que evita que el $ se encime al número). */
.calc-form-card .form-group input,
.calc-form-card .form-group select {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1.5px solid #e6dcc0;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  background: #fff;
  transition: border-color 0.15s;
}
.calc-form-card .form-group input:focus,
.calc-form-card .form-group select:focus { border-color: #d4b200; }

.calc-form-card input::placeholder {
  color: #bcbcbc;
  font-weight: 400;
}

.input-symbol-wrap { position: relative; }
.input-symbol-wrap .simbolo {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-weight: 700;
  pointer-events: none;
}
.calc-form-card .form-group .input-symbol-wrap input { padding-left: 28px; }

.campo-ayuda {
  display: block;
  font-size: 0.76rem;
  color: #888;
  line-height: 1.45;
  margin-top: 5px;
}
.campo-ayuda a { color: #b30000; font-weight: 600; }

.calc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.calc-chip-plazo {
  border: 1.5px solid #e6dcc0;
  background: #fff;
  color: #555;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.calc-chip-plazo:hover { border-color: #d4b200; }
.calc-chip-plazo.active {
  background: #b30000;
  border-color: #b30000;
  color: #fff;
}

.calc-btn {
  width: 100%;
  padding: 13px;
  background: #b30000;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}
.calc-btn:hover { background: #8a0000; }

.calc-error {
  margin: 12px 0 0;
  padding: 10px 14px;
  background: #fdecea;
  border: 1px solid #f5c6cb;
  border-radius: 10px;
  color: #b30000;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ── Resultados ── */
.calc-resultados { min-width: 0; }

.calc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.calc-card {
  background: #fff;
  border: 1px solid #f0ead8;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.calc-card--principal {
  background: linear-gradient(145deg, #fffdf6, #fff8e1);
  border-color: #e0dba5;
}

.calc-card-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #888;
  margin-bottom: 6px;
}
.calc-card-valor {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: #222;
  line-height: 1.15;
}
.calc-card-sub {
  display: block;
  font-size: 0.74rem;
  color: #666;
  margin-top: 4px;
}

.calc-verde { color: #2e7d32; }
.calc-rojo { color: #b30000; }

.calc-nota-inflacion {
  grid-column: 1 / -1;
  padding: 12px 16px;
  background: #fffdf6;
  border: 1px solid #e0dba5;
  border-radius: 12px;
  font-size: 0.88rem;
  color: #444;
  line-height: 1.55;
}
.calc-nota-inflacion i { color: #b8962e; margin-right: 8px; }

.chart-container {
  background: #fff;
  border: 1px solid #f0ead8;
  border-radius: 14px;
  padding: 16px;
  height: 360px;
  margin-bottom: 18px;
}

/* ── Desglose y explicación ── */
.calc-desglose,
.calc-como {
  background: #fff;
  border: 1px solid #f0ead8;
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 14px;
}
.calc-desglose summary,
.calc-como summary {
  cursor: pointer;
  font-weight: 700;
  color: #b30000;
  font-size: 0.92rem;
}

.calc-desglose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 12px;
}
.calc-desglose th {
  text-align: right;
  padding: 8px 10px;
  background: #f8f7eb;
  color: #555;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.calc-desglose th:first-child { text-align: left; }
.calc-desglose td {
  text-align: right;
  padding: 8px 10px;
  border-bottom: 1px solid #f4eed8;
  color: #444;
  white-space: nowrap;
}
.calc-desglose td:first-child { text-align: left; font-weight: 700; color: #222; }
.calc-desglose .tabla-scroll { overflow-x: auto; }

.calc-como p, .calc-como ul {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.65;
  margin: 10px 0 0;
}
.calc-como code {
  background: #f8f7eb;
  border: 1px solid #eee3c8;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.82rem;
}

@media (max-width: 900px) {
  .calc-layout { grid-template-columns: 1fr; }
  .chart-container { height: 300px; }
}
