/* ==========================================================================
   MP360 · Jacarandá — proyección de cuota

   Estructura y jerarquía portadas del cotizador aprobado de Tipuana
   (`mp360-lot__proj-*` de su `mp360.css`). Lo que cambia son los tokens: acá
   manda el design system de Jacarandá.

   El componente no declara posición ni ancho: los pone su anfitrión. Hoy el
   único anfitrión es el grupo Financiación de la ficha de lote.
   ========================================================================== */

.mp360-proj {
  --pr-borde: rgba(21, 21, 21, 0.12);
  --pr-tinta-suave: rgba(21, 21, 21, 0.62);
  --pr-error: #950101;

  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pr-borde);
}

.mp360-proj *,
.mp360-proj *::before,
.mp360-proj *::after { box-sizing: border-box; }

.mp360-proj p,
.mp360-proj h4,
.mp360-proj h5,
.mp360-proj dl,
.mp360-proj dd,
.mp360-proj dt { margin: 0; }

/* Vista previa técnica: tiene que verse como una advertencia de desarrollo,
   no como parte de la interfaz. */
.mp360-proj__preview {
  padding: 0.5rem 0.625rem;
  border: 1px dashed var(--pr-error);
  border-radius: var(--radius-compact, 6px);
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--pr-error);
}

/* "Proyectá tu cuota" es un titular de herramienta, distinto del rótulo de
   sección: esa diferencia tipográfica es lo que evita que la cuota proyectada
   compita con la cuota real. */
.mp360-proj__heading {
  font-size: 1rem;             /* 16px */
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--neutral-950, #151515);
}

.mp360-proj__sub {
  margin-top: -0.25rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--pr-tinta-suave);
}

/* --------------------------------------------------------------------------
   Formulario
   -------------------------------------------------------------------------- */
.mp360-proj__form { display: flex; flex-direction: column; gap: 0.5rem; }

.mp360-proj__label {
  font-size: 0.8125rem;
  color: var(--pr-tinta-suave);
}

.mp360-proj__row { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.mp360-proj__input {
  flex: 1 1 8.75rem;
  min-width: 0;
  min-height: 2.75rem;         /* 44px */
  padding: 0.625rem 0.75rem;
  border: 1px solid rgba(21, 21, 21, 0.2);
  border-radius: var(--radius-control, 8px);
  background: var(--white, #FFFFFF);
  color: inherit;
  font: inherit;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.mp360-proj__input::placeholder { color: rgba(21, 21, 21, 0.38); }

.mp360-proj__input:focus-visible {
  outline: 2px solid var(--primary-700, #4742A1);
  outline-offset: 1px;
}

.mp360-proj__input[aria-invalid="true"] { border-color: var(--pr-error); }

/* Acción secundaria: compacta, contorneada y NUNCA otro botón violeta de
   ancho completo. El CTA principal de la ficha sigue siendo WhatsApp. */
.mp360-proj__cta {
  flex: 0 0 auto;
  min-height: 2.75rem;
  padding: 0.625rem 1rem;
  border: 1px solid var(--primary-700, #4742A1);
  border-radius: var(--radius-control, 8px);
  background: transparent;
  color: var(--primary-700, #4742A1);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .mp360-proj__cta:hover {
    background: var(--primary-700, #4742A1);
    color: var(--white, #FFFFFF);
  }
}

.mp360-proj__cta:focus-visible {
  outline: 2px solid var(--primary-700, #4742A1);
  outline-offset: 2px;
}

.mp360-proj__hint {
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgba(21, 21, 21, 0.55);
}

.mp360-proj__error {
  font-size: 0.75rem;
  line-height: 1.4;
  font-weight: 600;
  color: var(--pr-error);
}

.mp360-proj__error[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Resultado
   -------------------------------------------------------------------------- */
.mp360-proj__result {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pr-borde);
}

.mp360-proj__result-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(21, 21, 21, 0.55);
}

.mp360-proj__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.mp360-proj__col { display: flex; flex-direction: column; gap: 2px; }

.mp360-proj__col + .mp360-proj__col {
  padding-left: 1rem;
  border-left: 1px solid var(--pr-borde);
}

.mp360-proj__when {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(21, 21, 21, 0.5);
}

.mp360-proj__amount {
  margin-top: 1px;
  font-size: 1.3125rem;        /* 21px · por debajo de la cuota real (34px) */
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.mp360-proj__ratio {
  margin-top: 2px;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--pr-tinta-suave);
}

.mp360-proj__delta { display: flex; flex-direction: column; gap: 2px; }

.mp360-proj__delta-amount {
  font-size: 1.1875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.mp360-proj__read {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
}

.mp360-proj__note {
  font-size: 0.6875rem;
  line-height: 1.4;
  color: rgba(21, 21, 21, 0.5);
}

/* --------------------------------------------------------------------------
   Disclosures — dos niveles independientes
   -------------------------------------------------------------------------- */
.mp360-proj__disclosures {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.mp360-proj__disclosure { display: flex; flex-direction: column; }

.mp360-proj__link {
  align-self: flex-start;
  min-height: 2.75rem;         /* target táctil, aunque se lea como enlace */
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary-700, #4742A1);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.mp360-proj__link:focus-visible {
  outline: 2px solid var(--primary-700, #4742A1);
  outline-offset: 2px;
  border-radius: var(--radius-compact, 6px);
}

.mp360-proj__disclosure-box {
  overflow: hidden;
  height: 0;
  transition: height 0.26s var(--mp360-ease-ui);
}

.mp360-proj__disclosure-box[hidden] { display: none; }

.mp360-proj__disclosure-body {
  padding-top: 0.75rem;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.26s var(--mp360-ease-ui),
              transform 0.26s var(--mp360-ease-ui);
}

.mp360-proj__disclosure-box.is-open .mp360-proj__disclosure-body {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   Tabla mes a mes
   -------------------------------------------------------------------------- */
.mp360-proj__months {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.mp360-proj__months-cap {
  caption-side: top;
  text-align: left;
  padding-bottom: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(21, 21, 21, 0.55);
}

.mp360-proj__months th,
.mp360-proj__months td { padding: 6px 0; text-align: left; font-weight: 400; }

.mp360-proj__months thead th {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(21, 21, 21, 0.45);
  border-bottom: 1px solid var(--pr-borde);
  padding-bottom: 0.5rem;
}

.mp360-proj__months tbody tr + tr th,
.mp360-proj__months tbody tr + tr td { border-top: 1px solid rgba(21, 21, 21, 0.06); }

.mp360-proj__num { text-align: right; font-variant-numeric: tabular-nums; }
.mp360-proj__months tbody .mp360-proj__num { font-weight: 600; }
.mp360-proj__num--soft { color: var(--pr-tinta-suave); font-weight: 400 !important; }

/* --------------------------------------------------------------------------
   Supuestos
   -------------------------------------------------------------------------- */
.mp360-proj__assumptions-box { display: flex; flex-direction: column; gap: 0.5rem; }

.mp360-proj__assumptions-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(21, 21, 21, 0.55);
}

.mp360-proj__assumptions { display: flex; flex-direction: column; gap: 0.25rem; }

.mp360-proj__assumption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.75rem;
}

.mp360-proj__assumption dt { color: rgba(21, 21, 21, 0.6); }
.mp360-proj__assumption dd { font-variant-numeric: tabular-nums; font-weight: 600; }

/* La referencia y de qué lado quedó la proyección. El punto acompaña al texto;
   nunca lo reemplaza. */
.mp360-proj__refnote {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--pr-tinta-suave);
}

.mp360-proj__refnote::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

.mp360-proj__refnote[data-dentro="true"]::before {
  background: var(--primary-700, #4742A1);
  opacity: 1;
}

.mp360-proj__privacy {
  font-size: 0.6875rem;
  line-height: 1.45;
  color: rgba(21, 21, 21, 0.5);
}

/* --------------------------------------------------------------------------
   Angosto: el formulario pasa a una columna antes que comprimir el input o
   el botón por debajo de su target.
   -------------------------------------------------------------------------- */
@media (max-width: 420px) {
  .mp360-proj__row { flex-direction: column; }
  .mp360-proj__cta { width: 100%; }
  .mp360-proj__grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .mp360-proj__col + .mp360-proj__col {
    padding-left: 0;
    padding-top: 0.75rem;
    border-left: 0;
    border-top: 1px solid var(--pr-borde);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mp360-proj__disclosure-box,
  .mp360-proj__disclosure-body,
  .mp360-proj__cta,
  .mp360-proj__input { transition: none !important; }
  .mp360-proj__disclosure-body { transform: none !important; }
}
