/*
 * «Calculadora de hipoteca» (src/site/calculadora-page.ts, 2026-11-27): Jose's calculator
 * (docs/design/package/calculadora-hipoteca-2026-11-27) in the type and colours of the site: the font of the site
 * (no Google Fonts), #1B3D14 text, #4A5D43 secondary text, #3A7A26 and #4C9D33 greens, #F6F4EE cream, #EEF6EA soft
 * green, #E6E2D6 and #D3E5CB lines. His layout (form and result side by side, the result sticky; one column below
 * 860 px) and his verdict colours (green, amber, red) stay. The page sections (.hc-*) follow /inmobiliaria.
 */
.hc-main {
  background: #ffffff;
  color: #1b3d14;
}

.hc-dentro {
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px clamp(20px, 4vw, 48px);
}

.hc-dentro--estrecho {
  max-width: 860px;
}

.hc-cabecera {
  background: #f6f4ee;
  border-bottom: 1px solid #e6e2d6;
}

.hc-cabecera .hc-dentro {
  padding-top: 36px;
  padding-bottom: 48px;
}

.hc-migas {
  font-size: 15px;
  color: #4a5d43;
}

.hc-migas a {
  color: #3a7a26;
}

.hc-kicker {
  margin: 28px 0 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #3a7a26;
}

.hc-titulo {
  max-width: 900px;
  margin: 12px 0 0;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hc-entradilla {
  max-width: 760px;
  margin: 18px 0 0;
  font-size: clamp(18px, 1.6vw, 20px);
  line-height: 1.55;
  color: #4a5d43;
}

/* The calculator (Jose's classes, his layout; the site's colours). */
.imc-calc {
  --imc-dark: #1b3d14;
  --imc-green: #3a7a26;
  --imc-accent: #4c9d33;
  --imc-green-soft: #eef6ea;
  --imc-gray: #4a5d43;
  --imc-line: #e6e2d6;
  --imc-bg: #f6f4ee;
  --imc-red: #c2412d;
  --imc-red-soft: #fbece8;
  --imc-amber: #b7791f;
  --imc-amber-soft: #fdf5e6;
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px clamp(20px, 4vw, 48px) 56px;
  color: var(--imc-gray);
  line-height: 1.5;
}

.imc-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: start;
}

.imc-card {
  background: #fff;
  border: 1px solid var(--imc-line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 10px 30px -18px rgba(27, 61, 20, 0.25);
}

.imc-ejemplo {
  margin: 0 0 22px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--imc-bg);
  font-size: 15px;
  color: var(--imc-gray);
}

.imc-block {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.imc-block + .imc-block {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px dashed var(--imc-line);
}

/* A floated legend is laid out like any heading, so the step's dashed line runs above it, as in Jose's design. */
.imc-block::after {
  content: '';
  display: table;
  clear: both;
}

.imc-step {
  float: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--imc-dark);
}

.imc-step b {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--imc-dark);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex: none;
}

.imc-field {
  clear: both;
  margin-bottom: 20px;
}

.imc-field:last-child {
  margin-bottom: 0;
}

.imc-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 8px;
}

.imc-label label {
  font-weight: 700;
  font-size: 16px;
  color: var(--imc-dark);
}

.imc-label small {
  font-size: 14px;
  color: var(--imc-gray);
}

.imc-input {
  position: relative;
}

.imc-input input[type='text'] {
  width: 100%;
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  color: var(--imc-dark);
  padding: 12px 64px 12px 16px;
  border: 1.5px solid #d3e5cb;
  border-radius: 12px;
  background: var(--imc-bg);
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.imc-input input[type='text']:focus {
  border-color: var(--imc-accent);
  box-shadow: 0 0 0 4px rgba(76, 157, 51, 0.2);
  background: #fff;
}

/* Jose's example values: lighter than a typed value, but readable (#4A5D43 on cream, not his #A7B0A4). */
.imc-input input.is-default,
.imc-input input.is-default:focus {
  color: var(--imc-gray);
  font-weight: 500;
}

.imc-input span {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  color: var(--imc-gray);
  pointer-events: none;
}

.imc-hint {
  margin-top: 8px;
  font-size: 14px;
  background: var(--imc-green-soft);
  color: var(--imc-dark);
  padding: 8px 12px;
  border-radius: 10px;
}

.imc-hint strong {
  font-weight: 800;
}

.imc-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.imc-chips button {
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  min-height: 40px;
  padding: 7px 18px;
  border-radius: 999px;
  border: 1.5px solid #d3e5cb;
  background: #fff;
  color: var(--imc-dark);
  cursor: pointer;
  transition: all 0.15s;
}

.imc-chips button:hover {
  border-color: var(--imc-accent);
}

.imc-chips button.on {
  background: var(--imc-dark);
  border-color: var(--imc-dark);
  color: #fff;
}

/* On a phone the result is below the form: a link to it. */
.imc-ver {
  display: none;
}

/* Result */
.imc-result {
  position: sticky;
  top: 24px;
}

.imc-verdict {
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  transition: background 0.25s;
}

.imc-verdict .imc-ico {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  font-size: 26px;
  color: #fff;
  font-weight: 800;
}

.imc-vtitle {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 800;
}

.imc-vtext {
  margin: 0;
  font-size: 15px;
  color: var(--imc-dark);
}

.imc-ok {
  background: var(--imc-green-soft);
}

.imc-ok .imc-ico {
  background: var(--imc-green);
}

.imc-ok .imc-vtitle {
  color: var(--imc-dark);
}

.imc-mid {
  background: var(--imc-amber-soft);
}

.imc-mid .imc-ico {
  background: var(--imc-amber);
}

.imc-mid .imc-vtitle {
  color: #7a4f0e;
}

.imc-ko {
  background: var(--imc-red-soft);
}

.imc-ko .imc-ico {
  background: var(--imc-red);
}

.imc-ko .imc-vtitle {
  color: #8f2b1c;
}

.imc-big {
  text-align: center;
  margin: 22px 0 6px;
}

.imc-big small {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--imc-gray);
}

.imc-big strong {
  display: block;
  font-size: 44px;
  line-height: 1.1;
  font-weight: 800;
  color: var(--imc-dark);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.imc-big strong em {
  font-style: normal;
  font-size: 18px;
  color: var(--imc-gray);
  font-weight: 600;
}

.imc-meter {
  margin: 16px 0 4px;
}

.imc-bar {
  height: 12px;
  border-radius: 12px;
  background: var(--imc-line);
  overflow: hidden;
  position: relative;
}

.imc-bar i {
  display: block;
  height: 100%;
  border-radius: 12px;
  transition:
    width 0.35s ease,
    background 0.25s;
}

.imc-meter-legend {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px 12px;
  font-size: 14px;
  margin-top: 6px;
}

.imc-sc {
  border: 1.5px solid var(--imc-line);
  border-radius: 14px;
  padding: 14px;
  font-size: 14px;
}

.imc-sc.is-best {
  border-color: #d3e5cb;
  background: #fbfdf9;
}

.imc-break {
  margin-top: 20px;
  font-size: 15px;
  padding: 16px;
}

.imc-break-titulo {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--imc-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.imc-tag {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
}

.imc-tag.ok {
  background: var(--imc-green-soft);
  color: var(--imc-dark);
}

.imc-tag.ko {
  background: var(--imc-red-soft);
  color: #8f2b1c;
}

.imc-sc dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 0;
}

.imc-sc dt {
  color: var(--imc-gray);
}

.imc-sc dd {
  margin: 0;
  padding-left: 10px;
  font-weight: 700;
  color: var(--imc-dark);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.imc-sc .bad {
  color: var(--imc-red);
}

.imc-break .imc-tot {
  border-top: 1px solid var(--imc-line);
  padding-top: 8px;
  color: var(--imc-dark);
  font-weight: 800;
}

.imc-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--imc-bg);
  border: 1px solid var(--imc-line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--imc-gray);
}

.imc-note p {
  margin: 0;
}

.imc-note strong {
  color: var(--imc-dark);
}

.imc-note-ico {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--imc-gray);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
  margin-top: 1px;
}

.imc-cta {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.imc-btn {
  flex: 1 1 180px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 18px;
  border-radius: 999px;
  transition:
    transform 0.12s,
    background 0.15s;
}

.imc-btn:active {
  transform: scale(0.98);
}

.imc-btn-ws {
  background: var(--imc-accent);
  color: #10260c;
}

.imc-btn-ws:hover {
  background: #5aad3f;
}

.imc-vender {
  margin: 14px 0 0;
  font-size: 15px;
  text-align: center;
  color: var(--imc-gray);
}

.imc-vender a {
  color: var(--imc-green);
  font-weight: 700;
}

.imc-chips button:focus-visible,
.imc-btn:focus-visible,
.imc-ver:focus-visible,
.imc-vender a:focus-visible {
  outline: 3px solid var(--imc-accent);
  outline-offset: 3px;
}

@media (max-width: 860px) {
  .imc-grid {
    grid-template-columns: 1fr;
  }

  .imc-result {
    position: static;
    scroll-margin-top: 16px;
  }

  .imc-card {
    padding: 22px;
  }

  .imc-ver {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    margin-top: 24px;
    border-radius: 999px;
    background: var(--imc-dark);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
  }
}

@media (max-width: 420px) {
  .imc-big strong {
    font-size: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .imc-calc * {
    transition: none !important;
  }
}

/* Texts below the calculator */
.hc-texto .hc-dentro {
  padding-top: 24px;
}

.hc-corto {
  margin: 0 0 8px;
  padding: 18px 20px;
  border-left: 4px solid #4c9d33;
  border-radius: 0 12px 12px 0;
  background: #eef6ea;
  font-size: 18px;
  line-height: 1.6;
}

.hc-texto h2 {
  margin: 44px 0 14px;
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.hc-texto h3 {
  margin: 26px 0 8px;
  font-size: 20px;
  line-height: 1.3;
}

.hc-texto p,
.hc-texto li {
  font-size: 18px;
  line-height: 1.65;
}

.hc-texto p {
  margin: 0 0 16px;
}

.hc-texto ul {
  margin: 0 0 16px;
  padding-left: 22px;
}

.hc-texto li {
  margin-bottom: 8px;
}

.hc-texto a {
  color: #3a7a26;
}

.hc-tabla-marco {
  overflow-x: auto;
  margin: 8px 0 18px;
  border: 1px solid #e6e2d6;
  border-radius: 16px;
}

.hc-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.hc-tabla th,
.hc-tabla td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #ece9df;
  vertical-align: baseline;
}

.hc-tabla thead th {
  background: #f6f4ee;
  font-size: 14px;
  color: #4a5d43;
}

.hc-tabla td:last-child {
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hc-tabla tbody th {
  font-weight: 700;
}

.hc-tabla .hc-total th,
.hc-tabla .hc-total td {
  border-bottom: 0;
  background: #eef6ea;
  font-weight: 800;
}

.hc-tabla sup {
  margin-left: 0.2em;
}

.hc-fuentes {
  margin: 0;
  padding-left: 22px;
  font-size: 15px;
  line-height: 1.55;
  color: #4a5d43;
}

.hc-fuentes li {
  margin-bottom: 8px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.hc-llamada {
  background: #1b3d14;
  color: #eef6ea;
}

.hc-llamada h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
}

.hc-llamada p {
  margin: 12px 0 24px;
  max-width: 640px;
  font-size: 18px;
  line-height: 1.5;
  color: #c6ddbc;
}

.hc-boton {
  display: inline-flex;
  align-items: center;
  min-height: 54px;
  padding: 0 24px;
  border-radius: 999px;
  background: #4c9d33;
  color: #10260c;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

.hc-boton:focus-visible,
.hc-migas a:focus-visible,
.hc-texto a:focus-visible {
  outline: 3px solid #4c9d33;
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .hc-tabla {
    font-size: 15px;
  }

  .hc-tabla th,
  .hc-tabla td {
    padding: 10px;
  }
}
