/* recompratucasa.com — hoja única.
   Paleta: blanco + verde puerta + latón de llave. Tipografía: Lexend (diseñada para
   facilitar la lectura; cifras sin cero tachado, que en precios despistan). */

@font-face { font-family: "Lexend"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/lexend-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/lexend-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("../fonts/lexend-latin-800-normal.woff2") format("woff2"); }

:root {
  --ink: #1d2b36;
  --ink-soft: #4e5d69;
  --paper: #ffffff;
  --wash: #edf3f0;
  --line: #d3ddd8;
  --door: #1e6a4f;
  --door-dark: #164f3b;
  --brass: #c99a3e;
  --brass-deep: #6f5114;
  --brass-light: #f6edd8;
  --warn: #933823;
  --warn-bg: #f9ece7;
  --focus: #2b62c9;

  --t-sm: 0.875rem;
  --t-base: 1.125rem;
  --t-md: 1.375rem;
  --t-lg: 1.75rem;
  --t-xl: clamp(2.05rem, 5.6vw, 3.25rem);

  --gutter: 20px;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--t-base);
  line-height: 1.6;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--door); text-underline-offset: 3px; }
a:hover { color: var(--door-dark); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.contenedor { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.texto > * { max-width: 44rem; }
.columnas { display: grid; gap: 40px; }
.columnas > div { max-width: 40rem; }
@media (min-width: 860px) { .columnas { grid-template-columns: 1fr 1fr; gap: 72px; } }

.saltar { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 10px 14px; z-index: 10; }
.saltar:focus { left: 8px; top: 8px; }

/* ── Cabecera ─────────────────────────────────────────── */
.cabecera { background: var(--wash); }
.cabecera .contenedor { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.marca { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; }
.marca .nombre span { font-weight: 400; color: var(--ink-soft); }
.marca svg { width: 30px; height: 30px; flex: none; }
.cabecera nav { display: flex; gap: 22px; font-size: var(--t-sm); }
.cabecera nav a { color: var(--ink); text-decoration: none; font-weight: 700; }
.cabecera nav a:hover { text-decoration: underline; }
@media (max-width: 560px) { .cabecera nav .opcional { display: none; } }

/* ── Portada ──────────────────────────────────────────── */
.portada { background: var(--wash); padding: 28px 0 56px; }
.portada .contenedor { display: grid; gap: 32px; }
@media (min-width: 920px) {
  .portada { padding: 48px 0 88px; }
  .portada .contenedor { grid-template-columns: 1fr 460px; gap: 64px; align-items: start; }
}
.portada h1 {
  font-size: var(--t-xl); line-height: 1.07; font-weight: 800; letter-spacing: -0.02em;
  margin: 0 0 20px; max-width: 15ch;
}
.portada .entradilla { font-size: var(--t-md); line-height: 1.45; margin: 0 0 20px; max-width: 34ch; }
.portada .garantia { color: var(--ink-soft); margin: 0; max-width: 36ch; }

/* ── Simulador ────────────────────────────────────────── */
.tarjeta {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px 26px;
}
@media (min-width: 920px) { .tarjeta { padding: 28px 30px 30px; } }
.tarjeta h2 { font-size: var(--t-lg); line-height: 1.15; margin: 0 0 6px; letter-spacing: -0.01em; }
.tarjeta .sub { margin: 0 0 18px; color: var(--ink-soft); font-size: 1rem; }

.campo { margin: 0 0 16px; }
.campo label, .campo .etiqueta { display: block; font-weight: 700; margin: 0 0 4px; }
.campo .ayuda { display: block; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.4; margin: 0 0 8px; }
.importe { position: relative; }
.importe input { padding-right: 44px; }
.importe::after { content: "€"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); font-weight: 700; pointer-events: none; }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; font: inherit; font-size: 1.125rem; color: var(--ink);
  background: var(--paper); border: 1.5px solid #b9c6c0; border-radius: 10px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--door); outline: 3px solid rgba(30,106,79,.25); outline-offset: 0; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--warn); }
.dos { display: grid; gap: 0 14px; }
@media (min-width: 480px) { .dos { grid-template-columns: 1fr 1fr; } }

.marcar { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; margin: 0 0 10px; line-height: 1.4; }
.marcar input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--door); }
.marcar:has(input:checked) { border-color: var(--door); background: #f4f9f6; }

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 14px 26px; border: 0; border-radius: 12px;
  background: var(--door); color: #fff; font: inherit; font-weight: 800; font-size: 1.15rem;
  cursor: pointer; text-decoration: none;
}
.boton:hover { background: var(--door-dark); color: #fff; }
.boton[disabled] { opacity: .6; cursor: progress; }
.boton.ancho { width: 100%; }
.boton.secundario { background: transparent; color: var(--door); border: 2px solid var(--door); }
.boton.secundario:hover { background: #f4f9f6; color: var(--door-dark); }

/* ── Resultado: la llave ──────────────────────────────── */
.resultado { margin-top: 22px; }
.resultado[hidden] { display: none; }
.llavero { padding: 10px 0 8px 22px; }
.llave {
  position: relative; display: inline-block;
  background: var(--brass); color: #2b1f06;
  border-radius: 12px 34px 34px 12px;
  padding: 14px 30px 16px 62px;
  transform: rotate(-3deg); transform-origin: 26px 50%;
}
.llave::before { /* agujero */
  content: ""; position: absolute; left: 18px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px var(--brass-deep);
}
.llave::after { /* aro */
  content: ""; position: absolute; left: -16px; top: 50%; width: 48px; height: 48px; margin-top: -24px;
  border-radius: 50%; border: 4px solid #8d9499; border-right-color: transparent; transform: rotate(-30deg);
}
.llave .hasta { display: block; font-size: 0.95rem; font-weight: 700; }
.llave .cifra { display: block; font-size: 2.35rem; line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.llave .que { display: block; font-size: 0.95rem; }
.resultado.entra .llave { animation: columpio 900ms cubic-bezier(.3,1.4,.5,1) both; }
@keyframes columpio { from { transform: rotate(-16deg); } 55% { transform: rotate(2deg); } to { transform: rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { .resultado.entra .llave { animation: none; } }

.resultado p { margin: 12px 0 0; line-height: 1.45; }
.resultado .letra { color: var(--ink-soft); font-size: 0.95rem; }
.resultado .boton { margin-top: 18px; }
.aviso { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 14px 16px; }
.aviso strong { display: block; color: var(--warn); margin-bottom: 4px; }
.nota-ahorro { background: var(--brass-light); color: #4a3608; border-radius: 10px; padding: 12px 14px; }

/* ── Secciones ────────────────────────────────────────── */
.seccion { padding: 56px 0; }
.seccion + .seccion { border-top: 1px solid var(--line); }
@media (min-width: 920px) { .seccion { padding: 80px 0; } }
.seccion h2 { font-size: var(--t-lg); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 14px; }
.seccion p { margin: 0 0 14px; }

/* Solicitud */
.solicitud { background: var(--paper); }
.solicitud[hidden] { display: none; }
.solicitud .contenedor { max-width: 760px; }
fieldset { border: 0; padding: 0; margin: 0 0 30px; min-width: 0; }
legend { font-size: var(--t-md); font-weight: 800; padding: 0; margin: 0 0 14px; }
.resumen-numeros { background: var(--wash); border-radius: 10px; padding: 14px 16px; margin: 0 0 28px; }
.resumen-numeros a { font-weight: 700; }
input[type="file"] { width: 100%; padding: 12px; border: 1.5px dashed #9fb0a8; border-radius: 10px; background: #fafcfb; font: inherit; font-size: 1rem; }
details.como { margin: 10px 0 0; }
details.como summary { cursor: pointer; color: var(--door); font-weight: 700; }
details.como div { padding: 8px 0 0; color: var(--ink-soft); }
.oculto { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.error-form { margin: 0 0 18px; }
.progreso { margin-top: 12px; color: var(--ink-soft); }

.hecho { background: var(--wash); border-radius: var(--radius); padding: 26px 24px; }
.hecho h2 { margin-top: 0; }
.hecho .codigo { font-weight: 800; font-variant-numeric: tabular-nums; }

/* Cómo funciona: es una secuencia real, de ahí los números */
.pasos { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 22px; counter-reset: paso; }
@media (min-width: 820px) { .pasos { grid-template-columns: repeat(4, 1fr); gap: 28px; } }
.pasos li { counter-increment: paso; position: relative; padding-top: 52px; }
.pasos li::before {
  content: counter(paso); position: absolute; top: 0; left: 0; width: 40px; height: 40px; border-radius: 50%;
  background: var(--door); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 1.1rem;
}
.pasos strong { display: block; font-size: 1.15rem; margin-bottom: 4px; }
.pasos p { margin: 0; color: var(--ink-soft); }

.lista-necesitas { padding-left: 1.2em; margin: 0 0 14px; }
.lista-necesitas li { margin: 0 0 6px; }

/* Preguntas */
.preguntas details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.preguntas details:first-of-type { border-top: 1px solid var(--line); }
.preguntas summary { cursor: pointer; font-weight: 700; font-size: 1.15rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.preguntas summary::-webkit-details-marker { display: none; }
.preguntas summary::after { content: "+"; font-weight: 400; font-size: 1.5rem; line-height: 1; color: var(--door); }
.preguntas details[open] summary::after { content: "−"; }
.preguntas details p { margin: 10px 0 0; color: var(--ink); }

/* ── Pie ──────────────────────────────────────────────── */
.pie { background: var(--ink); color: #d9e2e7; padding: 40px 0 48px; font-size: var(--t-sm); }
.pie a { color: #ffffff; }
.pie p { margin: 0 0 8px; max-width: 60ch; }
.pie nav { display: flex; flex-wrap: wrap; gap: 18px; margin: 16px 0 0; font-weight: 700; }

/* ── Páginas legales ──────────────────────────────────── */
.legal { padding: 40px 0 72px; }
.legal .contenedor { max-width: 760px; }
.legal h1 { font-size: 2rem; line-height: 1.15; margin: 0 0 8px; }
.legal h2 { font-size: 1.3rem; margin: 32px 0 8px; }
.legal p, .legal li { line-height: 1.6; }
.legal .fecha { color: var(--ink-soft); }
.pendiente { background: var(--brass-light); padding: 0 4px; border-radius: 3px; }
