*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --rojo: #8B1A1A;
  --rojo-dark: #6B1010;
  --rojo-light: #f5e8e8;
  --oscuro: #1C1C1C;
  --gris: #4A4A4A;
  --gris-claro: #F4F4F0;
  --borde: #D8D4CC;
  --blanco: #FFFFFF;
  --texto: #2C2C2C;
  --muted: #777;
  --acento: #C5A028;
}

body {
  font-family: 'Barlow', sans-serif;
  font-weight: 400;
  color: var(--texto);
  background: var(--gris-claro);
  line-height: 1.6;
}

/* ── HEADER ── */
header { background: var(--oscuro); }

.header-top {
  background: var(--rojo-dark);
  padding: 0.4rem 2rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.03em;
}

.header-main {
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo { height: 60px; object-fit: contain; }

nav a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  margin-left: 2rem;
  transition: color 0.2s;
}
nav a:hover { color: #fff; }

/* ── HERO ── */
.hero {
  background: var(--oscuro);
  background-image: linear-gradient(135deg, #1C1C1C 60%, #2e1010 100%);
  padding: 4rem 2rem 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('https://ressainmobiliaria.com/images/parallax.jpg') center/cover no-repeat;
  opacity: 0.1;
}
.hero-inner { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }

.hero-badge {
  display: inline-block;
  background: var(--rojo);
  color: #fff;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  font-weight: 600;
  padding: 0.35rem 1rem;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: 'Merriweather', serif;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  color: #fff;
  line-height: 1.15;
  margin-bottom: 1.2rem;
}
.hero h1 em { color: var(--acento); font-style: italic; }

.hero p { color: rgba(255,255,255,0.7); font-size: 1rem; max-width: 440px; margin: 0 auto 1.5rem; }

.hero-features { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.hero-features span { color: rgba(255,255,255,0.6); font-size: 0.82rem; letter-spacing: 0.05em; }

/* ── MAIN ── */
.main-wrap {
  max-width: 720px;
  margin: -2rem auto 4rem;
  padding: 0 1.5rem;
  position: relative;
  z-index: 2;
}

/* Progress */
.progress-wrap { margin-bottom: 0; }
.progress-bar { height: 4px; background: var(--borde); border-radius: 2px; overflow: hidden; margin-bottom: 0; }
.progress-fill { height: 100%; background: var(--rojo); transition: width 0.4s ease; }
.step-dots { display: flex; justify-content: center; gap: 0.5rem; padding: 1rem 0 0; }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--blanco); border: 2px solid var(--borde);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 600; color: var(--muted);
  transition: all 0.3s;
}
.step-dot.active { background: var(--rojo); border-color: var(--rojo); color: #fff; }
.step-dot.done { background: var(--oscuro); border-color: var(--oscuro); color: #fff; }

/* Cards */
.step-card {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-top: 3px solid var(--rojo);
  padding: 2.5rem;
  display: none;
  animation: fadeUp 0.35s ease;
  margin-top: -1px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.step-card.active { display: block; }
@keyframes fadeUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

.step-header { margin-bottom: 2rem; }
.step-tag { font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--rojo); font-weight: 600; margin-bottom: 0.5rem; }
.step-header h2 { font-family: 'Merriweather', serif; font-size: 1.5rem; color: var(--oscuro); margin-bottom: 0.4rem; line-height: 1.3; }
.step-header p { color: var(--muted); font-size: 0.88rem; }

/* Fields */
.field { margin-bottom: 1.4rem; }
.field.mt-lg { margin-top: 2rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { display: block; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gris); font-weight: 600; margin-bottom: 0.5rem; }
.required { color: var(--rojo); }
.optional { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); font-size: 0.7rem; }
.field-hint { font-size: 0.72rem; color: var(--muted); margin-top: 0.4rem; }

input[type="text"], input[type="email"], input[type="number"], select {
  width: 100%; padding: 0.75rem 1rem;
  border: 1px solid var(--borde); border-radius: 2px;
  background: #FAFAF8; color: var(--texto);
  font-family: 'Barlow', sans-serif; font-size: 0.92rem;
  outline: none; -webkit-appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus { border-color: var(--rojo); box-shadow: 0 0 0 3px rgba(139,26,26,0.08); }
select { cursor: pointer; 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 d='M1 1l5 5 5-5' stroke='%238B1A1A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; background-size: 12px; padding-right: 2.5rem; }

/* Slider */
.slider-display { font-family: 'Merriweather', serif; font-size: 2rem; color: var(--oscuro); margin-bottom: 0.75rem; font-weight: 700; }
input[type="range"] {
  -webkit-appearance: none; width: 100%; height: 4px;
  background: linear-gradient(to right, var(--rojo) 0%, var(--rojo) var(--pct,20%), var(--borde) var(--pct,20%));
  border-radius: 2px; outline: none; cursor: pointer; border: none; box-shadow: none; padding: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--rojo); box-shadow: 0 2px 6px rgba(139,26,26,0.35); transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
.slider-ends { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--muted); margin-top: 0.4rem; }

/* Counters */
.counter-group { border: 1px solid var(--borde); border-radius: 2px; overflow: hidden; }
.counter-row { display: flex; align-items: center; padding: 0.9rem 1.2rem; border-bottom: 1px solid var(--borde); }
.counter-row:last-child { border-bottom: none; }
.counter-label { flex: 1; font-size: 0.9rem; color: var(--texto); }
.counter-ctrl { display: flex; align-items: center; gap: 1rem; }
.cnt-btn { width: 30px; height: 30px; border: 1px solid var(--rojo); background: transparent; color: var(--rojo); border-radius: 50%; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s; line-height: 1; }
.cnt-btn:hover { background: var(--rojo); color: #fff; }
.cnt-val { font-family: 'Merriweather', serif; font-size: 1.3rem; color: var(--oscuro); min-width: 1.5rem; text-align: center; font-weight: 700; }

/* Tiles */
.tile-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.6rem; }
.tile { border: 1px solid var(--borde); border-radius: 2px; padding: 1rem 0.75rem; cursor: pointer; text-align: center; background: #FAFAF8; transition: all 0.18s; }
.tile:hover { border-color: var(--rojo); background: var(--rojo-light); }
.tile.selected { border-color: var(--rojo); background: var(--rojo-light); box-shadow: 0 0 0 1px var(--rojo); }
.tile-icon { font-size: 1.4rem; margin-bottom: 0.4rem; }
.tile-label { font-size: 0.78rem; font-weight: 600; color: var(--oscuro); }
.tile-sub { font-size: 0.68rem; color: var(--muted); margin-top: 0.2rem; }

/* Radio */
.radio-group { display: flex; flex-direction: column; gap: 0.5rem; }
.radio-group.radio-inline { flex-direction: row; gap: 1rem; flex-wrap: wrap; }
.radio-opt { display: flex; align-items: center; gap: 0.6rem; font-size: 0.88rem; cursor: pointer; padding: 0.6rem 0.9rem; border: 1px solid var(--borde); border-radius: 2px; background: #FAFAF8; transition: all 0.15s; }
.radio-opt:hover { border-color: var(--rojo); background: var(--rojo-light); }
.radio-opt input { accent-color: var(--rojo); flex-shrink: 0; }
.radio-opt:has(input:checked) { border-color: var(--rojo); background: var(--rojo-light); font-weight: 500; }

/* Consent */
.consent-wrap { margin-top: 1.5rem; }
.consent { display: flex; gap: 0.75rem; align-items: flex-start; font-size: 0.78rem; color: var(--muted); line-height: 1.5; cursor: pointer; }
.consent input { margin-top: 2px; accent-color: var(--rojo); flex-shrink: 0; }
.consent a { color: var(--rojo); text-decoration: none; }

/* Buttons */
.btn-row { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; }
.btn-back { background: none; border: none; color: var(--muted); font-family: 'Barlow', sans-serif; font-size: 0.85rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn-back:hover { color: var(--texto); }
.btn-primary { background: var(--rojo); color: #fff; border: none; padding: 0.85rem 2rem; font-family: 'Barlow', sans-serif; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; cursor: pointer; border-radius: 2px; transition: background 0.2s; }
.btn-primary:hover { background: var(--rojo-dark); }
.btn-primary.btn-lg { padding: 1rem 2.5rem; font-size: 0.88rem; }

/* Error */
.form-error { background: #fdf0f0; border: 1px solid #e8b4b4; color: #8B1A1A; padding: 0.75rem 1rem; font-size: 0.82rem; margin-top: 1rem; border-radius: 2px; }

/* Loading */
.loading-screen { display: none; text-align: center; padding: 4rem 2rem; background: var(--blanco); border: 1px solid var(--borde); border-top: 3px solid var(--rojo); box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
.loading-screen.active { display: block; animation: fadeUp 0.3s ease; }
.spinner { width: 44px; height: 44px; border: 3px solid var(--borde); border-top-color: var(--rojo); border-radius: 50%; margin: 0 auto 1.5rem; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen h3 { font-family: 'Merriweather', serif; font-size: 1.4rem; color: var(--oscuro); margin-bottom: 0.5rem; }
.loading-screen p { color: var(--muted); font-size: 0.88rem; margin-bottom: 2rem; }
.loading-steps { text-align: left; max-width: 380px; margin: 0 auto; }
.loading-step { padding: 0.5rem 0; font-size: 0.82rem; color: var(--muted); opacity: 0.3; border-bottom: 1px solid var(--borde); transition: opacity 0.4s; display: flex; align-items: center; gap: 0.6rem; }
.loading-step::before { content: '○'; color: var(--rojo); flex-shrink: 0; }
.loading-step.done { opacity: 1; color: var(--texto); }
.loading-step.done::before { content: '✓'; }
.loading-step:last-child { border-bottom: none; }

/* ── RESULTADO ── */
#result-screen { display: none; animation: fadeUp 0.5s ease; }
#result-screen.active { display: block; }

.report-header {
  background: var(--oscuro);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  border-top: 4px solid var(--rojo);
}
.report-logo { height: 50px; object-fit: contain; filter: brightness(0) invert(1); opacity: 0.9; }
.report-title-wrap { flex: 1; }
.report-label { font-size: 0.65rem; letter-spacing: 0.2em; color: var(--acento); font-weight: 600; }
.report-subtitle { font-size: 0.82rem; color: rgba(255,255,255,0.7); margin-top: 0.2rem; }
.report-date { font-size: 0.72rem; color: rgba(255,255,255,0.4); text-align: right; }

.lead-score-wrap { padding: 0.75rem 2rem; background: #f9f7f4; border: 1px solid var(--borde); border-top: none; display: flex; align-items: center; gap: 0.5rem; }
.lead-score { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.05em; }

.result-value-card {
  background: var(--blanco); border: 1px solid var(--borde); border-top: none;
  padding: 2.5rem; text-align: center;
}
.result-label { font-size: 0.65rem; letter-spacing: 0.2em; color: var(--muted); text-transform: uppercase; margin-bottom: 0.75rem; }
.result-price { font-family: 'Merriweather', serif; font-size: clamp(2.4rem, 6vw, 4rem); color: var(--oscuro); font-weight: 700; line-height: 1; margin-bottom: 0.5rem; }
.result-range { font-size: 0.85rem; color: var(--muted); margin-bottom: 1.5rem; }
.result-divider { width: 40px; height: 2px; background: var(--rojo); margin: 0 auto 1.5rem; }
.result-summary-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.rs-item { text-align: center; }
.rs-val { display: block; font-family: 'Merriweather', serif; font-size: 1.1rem; color: var(--oscuro); font-weight: 700; }
.rs-key { font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.desglose-card { background: var(--gris-claro); border: 1px solid var(--borde); border-top: none; padding: 1.5rem 2rem; }
.desglose-title { font-size: 0.65rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; font-weight: 600; }
.desglose-row { display: flex; justify-content: space-between; padding: 0.5rem 0; font-size: 0.85rem; border-bottom: 1px solid var(--borde); }
.desglose-row:last-child { border-bottom: none; }
.desglose-row span:last-child { font-weight: 600; }
.desglose-neg span:last-child { color: var(--rojo); }
.desglose-sub { opacity: 0.7; font-size: 0.8rem !important; }
.desglose-total { background: var(--oscuro); margin: 0.5rem -2rem -1.5rem; padding: 1rem 2rem !important; color: #fff !important; border-bottom: none !important; }
.desglose-total span { color: #fff !important; font-size: 0.9rem; letter-spacing: 0.05em; }
.desglose-total span:first-child { font-weight: 600; letter-spacing: 0.1em; font-size: 0.75rem; text-transform: uppercase; }
.desglose-total span:last-child { font-family: 'Merriweather', serif; font-size: 1.3rem !important; }

.disclaimer-card {
  background: #fffbf0; border: 1px solid #e8d89a; border-top: none;
  padding: 1.5rem 2rem; display: flex; gap: 1rem;
}
.disclaimer-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 0.1rem; }
.disclaimer-text { font-size: 0.8rem; color: var(--gris); line-height: 1.7; }
.disclaimer-text strong { color: var(--oscuro); }
.disclaimer-text ul { margin: 0.5rem 0 0 1.2rem; }
.disclaimer-text li { margin-bottom: 0.3rem; }

.result-cta { background: var(--rojo); padding: 2rem; text-align: center; }
.result-cta h3 { font-family: 'Merriweather', serif; font-size: 1.3rem; color: #fff; margin-bottom: 0.5rem; }
.result-cta p { color: rgba(255,255,255,0.75); font-size: 0.88rem; margin-bottom: 1.5rem; }
.cta-btns { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.btn-cta-primary { background: #fff; color: var(--rojo); padding: 0.85rem 1.8rem; font-family: 'Barlow', sans-serif; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; border-radius: 2px; transition: all 0.2s; }
.btn-cta-primary:hover { background: var(--acento); color: #fff; }
.btn-cta-secondary { background: transparent; color: rgba(255,255,255,0.8); border: 1px solid rgba(255,255,255,0.4); padding: 0.85rem 1.8rem; font-family: 'Barlow', sans-serif; font-size: 0.82rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; border-radius: 2px; transition: all 0.2s; }
.btn-cta-secondary:hover { background: rgba(255,255,255,0.15); color: #fff; }

.report-footer { background: var(--oscuro); padding: 1rem 2rem; font-size: 0.72rem; color: rgba(255,255,255,0.4); text-align: center; line-height: 1.8; }

/* ── FOOTER ── */
footer { background: var(--oscuro); margin-top: 4rem; }
.footer-inner { max-width: 960px; margin: 0 auto; padding: 3rem 2rem; display: grid; grid-template-columns: auto 1fr auto; gap: 3rem; align-items: start; }
.footer-logo { height: 50px; filter: brightness(0) invert(1); opacity: 0.7; }
.footer-info p { font-size: 0.82rem; color: rgba(255,255,255,0.5); margin-bottom: 0.3rem; }
.footer-info strong { color: rgba(255,255,255,0.8); }
.footer-links { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-end; }
.footer-links a { color: rgba(255,255,255,0.5); text-decoration: none; font-size: 0.78rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--acento); }
.footer-copy { border-top: 1px solid rgba(255,255,255,0.08); padding: 1rem 2rem; text-align: center; font-size: 0.72rem; color: rgba(255,255,255,0.3); }

/* ── RESPONSIVE ─────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 768px) {
  .hero { padding: 3rem 1.5rem 2.5rem; }
  .hero h1 { font-size: 2.4rem; }
  .main-wrap { padding: 0 1rem 4rem; }
  .step-card { padding: 2rem 1.5rem; }
  .result-summary-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-links { align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: 1rem; }
  .report-header { flex-wrap: wrap; gap: 1rem; }
  .report-date { width: 100%; text-align: left; }
}

/* Mobile */
@media (max-width: 600px) {
  /* Header */
  .header-top { display: none; }
  .header-main { padding: 0.9rem 1rem; }
  .logo { font-size: 1.1rem; }
  nav { display: none; }

  /* Hero */
  .hero { padding: 2.5rem 1rem 2rem; }
  .hero h1 { font-size: 2rem; line-height: 1.2; }
  .hero p { font-size: 0.9rem; }
  .hero-features { gap: 0.75rem; }
  .hero-features span { font-size: 0.75rem; }
  .hero-badge { font-size: 0.62rem; }

  /* Stepper */
  .main-wrap { margin: -1.5rem auto 3rem; padding: 0 0.75rem 3rem; }
  .step-card { padding: 1.5rem 1.25rem; }
  .step-header h2 { font-size: 1.25rem; }
  .step-dots { gap: 0.35rem; }
  .step-dot { width: 24px; height: 24px; font-size: 0.65rem; }

  /* Campos */
  .field-row { grid-template-columns: 1fr; }
  .tile-group { grid-template-columns: 1fr 1fr; }
  .tile { padding: 0.85rem 0.6rem; }
  .tile-icon { font-size: 1.2rem; }
  .tile-label { font-size: 0.72rem; }
  .tile-sub { font-size: 0.62rem; }
  .slider-display { font-size: 1.6rem; }
  .radio-opt { font-size: 0.83rem; padding: 0.5rem 0.75rem; }

  /* Botones */
  .btn-row { flex-wrap: wrap; gap: 0.75rem; }
  .btn-primary { width: 100%; justify-content: center; }
  .btn-back { width: auto; }

  /* Resultado */
  .result-price { font-size: 2.2rem; }
  .result-summary-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .result-value-card { padding: 1.5rem 1rem; }
  .result-cta { padding: 1.5rem 1rem; }
  .cta-btns { flex-direction: column; }
  .btn-cta-primary, .btn-cta-secondary { width: 100%; text-align: center; }
  .report-header { padding: 1rem; gap: 0.75rem; }
  .report-logo { height: 36px; }
  .disclaimer-card { padding: 1rem; flex-direction: column; gap: 0.5rem; }
  .report-footer { padding: 0.75rem 1rem; font-size: 0.68rem; }

  /* Footer */
  .footer-inner { padding: 2rem 1rem; grid-template-columns: 1fr; gap: 1rem; }
  .footer-logo { height: 36px; }
  .footer-info p { font-size: 0.78rem; }
  .footer-links { flex-direction: row; flex-wrap: wrap; gap: 0.75rem; }
  .footer-copy { padding: 0.75rem 1rem; font-size: 0.68rem; }

  /* Contadores */
  .counter-row { padding: 0.75rem 1rem; }
  .counter-label { font-size: 0.82rem; }
  .cnt-val { font-size: 1.1rem; }

  /* Loading */
  .loading-screen { padding: 3rem 1.25rem; }
  .loading-screen h3 { font-size: 1.2rem; }
}

/* Muy pequeño */
@media (max-width: 380px) {
  .hero h1 { font-size: 1.7rem; }
  .step-card { padding: 1.25rem 1rem; }
  .tile-group { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .result-summary-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Botón PDF ── */
.pdf-download-wrap {
  text-align: center;
  padding: 1.5rem 2rem;
  background: var(--gris-claro);
  border: 1px solid var(--borde);
  border-top: none;
}
.btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--blanco);
  color: var(--texto);
  border: 2px solid var(--borde);
  padding: 0.85rem 2rem;
  font-family: 'Barlow', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s;
}
.btn-pdf:hover {
  border-color: var(--rojo);
  color: var(--rojo);
  background: var(--blanco);
}
.btn-pdf.loading {
  opacity: 0.6;
  cursor: wait;
}
.btn-pdf-icon { font-size: 1.1rem; }
.pdf-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.footer-dev {
  background: var(--oscuro);
  padding: 0.4rem 2rem;
  text-align: center;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.2);
}
.footer-dev a {
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-dev a:hover { color: rgba(255,255,255,0.7); }
