/* =========================================================
   Cardicasa · Landing de valoración inmobiliaria
   HTML + CSS puro. Mobile-first, responsive.
   Paleta: azul marino (#1a2b4a) + dorado (#c4924a) + crema.
   ========================================================= */

/* ---------- Variables ---------- */
:root {
  --cc-navy:        #950100;
  --cc-navy-700:    #730100;
  --cc-navy-900:    #530100;
  --cc-gold:        #c4924a;
  --cc-gold-soft:   #e7c89a;
  --cc-cream:       #F2F2F2;
  --cc-ink:         #2b3550;
  --cc-muted:       #5b6472;
  --cc-line:        #e6e9ef;
  --cc-bg:          #ffffff;
  --cc-red:         #c0392b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --shadow-md:  0 12px 24px -10px rgba(26, 43, 74, 0.55);
  --shadow-lg:  0 24px 48px -24px rgba(26, 43, 74, 0.35);
  --shadow-xl:  0 30px 60px -20px rgba(26, 43, 74, 0.55);

  --container: 1152px;
  --container-narrow: 980px;

  --font-sans: 'Open Sans', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--cc-ink);
  background: var(--cc-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}
.container--narrow { max-width: var(--container-narrow); }

/* ---------- Tipografía común ---------- */
.section-title {
  margin: 0 0 28px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--cc-navy);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-align: center;
}
.section-title--center { text-align: center; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn--block { width: 100%; }
.btn--primary {
  background: var(--cc-navy);
  color: #fff !important;
  box-shadow: var(--shadow-md);
}
.btn__label, .btn__send path, .benefit__check svg path { color: #fff !important; }
.btn--primary:hover { background: var(--cc-navy-700); transform: translateY(-1px); }
.btn--ghost {
  background: #fff;
  color: var(--cc-navy);
  border-color: rgba(26, 43, 74, 0.15);
}
.btn--ghost:hover { border-color: rgba(26, 43, 74, 0.3); background: var(--cc-cream); }
.btn--gold {
  background: var(--cc-cream);
  color: var(--cc-navy);
  box-shadow: 0 12px 24px -10px rgba(196, 146, 74, 0.6);
}
.btn--gold:hover { background: var(--cc-gold-soft); transform: translateY(-1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(196,146,74,.55); }

/* ---------- 1. Imagen principal ---------- */
.hero-image {
  width: 100%;
  background: var(--cc-navy);
  line-height: 0;
}
.hero-image img {
  width: 100%;
  max-height: 540px;
  object-fit: cover;
  object-position: center;
}

/* ---------- 2. Título principal ---------- */
.title-section {
  padding-block: clamp(40px, 6vw, 64px);
  background: #fff;
  text-align: center;
}
.main-title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--cc-navy);
  letter-spacing: -0.015em;
}

/* ---------- 3. Texto explicativo ---------- */
.explanation {
  padding-block: clamp(32px, 5vw, 56px);
  background: var(--cc-cream);
}
.explanation p {
  margin: 0 0 18px;
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  color: var(--cc-ink);
  line-height: 1.75;
}
.explanation p:last-child { margin-bottom: 0; }

/* ---------- 4. Beneficios ---------- */
.benefits-section {
  padding-block: clamp(48px, 7vw, 80px);
  background: #fff;
}
.benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
.benefit {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--cc-line);
  background: var(--cc-cream);
  font-size: 1.0rem;
  font-weight: 600;
  color: var(--cc-ink);
  transition: border-color .2s ease, transform .2s ease;
}
.benefit:hover {
  border-color: rgba(196, 146, 74, 0.45);
  transform: translateX(2px);
}
.benefit__check {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cc-gold);
  color: #fff;
  flex-shrink: 0;
}
.benefit__check svg { width: 16px; height: 16px; }

/* ---------- 5. Formulario ---------- */
.form-section {
  padding-block: clamp(48px, 7vw, 80px);
  background: var(--cc-cream);
}
.form {
  margin-top: 12px;
  padding: clamp(20px, 3vw, 32px);
  border-radius: var(--radius-md);
  border: 1px solid var(--cc-line);
  background: #fff;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.88rem; font-weight: 600; color: var(--cc-ink); }
.field .req { color: var(--cc-gold); }
.field .opt { color: var(--cc-muted); font-weight: 400; }
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--cc-ink);
  background: #fff;
  border: 1px solid var(--cc-line);
  border-radius: var(--radius-sm);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input::placeholder, .field textarea::placeholder { color: #9aa3b3; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--cc-gold);
  box-shadow: 0 0 0 3px rgba(196, 146, 74, 0.18);
}
.field textarea { resize: vertical; min-height: 96px; }
.field--error input, .field--error textarea { border-color: var(--cc-red); }
.field--error input:focus, .field--error textarea:focus { box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15); }
.field__error { margin: 0; font-size: 0.78rem; color: var(--cc-red); min-height: 0; }
.field__error:not(:empty) { min-height: 1em; margin-top: 2px; }

.btn__spinner { display: none; width: 18px; height: 18px; animation: spin 0.8s linear infinite; }
.btn.is-loading .btn__label { opacity: 0.85; }
.btn.is-loading .btn__send { display: none; }
.btn.is-loading .btn__spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-success {
  margin-top: 12px;
  padding: 40px 28px;
  border-radius: var(--radius-md);
  border: 1px solid var(--cc-line);
  background: #fff;
  box-shadow: var(--shadow-lg);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.form-success__icon {
  display: grid; place-items: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(196,146,74,0.15);
  color: var(--cc-gold);
}
.form-success__icon svg { width: 28px; height: 28px; }
.form-success h3 { margin: 8px 0 4px; font-size: 1.25rem; font-weight: 700; color: var(--cc-navy); }
.form-success p { margin: 0; max-width: 360px; font-size: 0.92rem; color: var(--cc-muted); }
.form-success .btn { margin-top: 12px; }

/* ---------- 6. FAQ ---------- */
.faq-section {
  padding-block: clamp(48px, 7vw, 80px);
  background: #fff;
}
.faq { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.faq__item {
  border: 1px solid var(--cc-line);
  border-radius: var(--radius-md);
  background: var(--cc-cream);
  padding: 4px 20px;
  overflow: hidden;
}
.faq__item summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 0;
  font-size: clamp(0.98rem, 1.4vw, 1.08rem);
  font-weight: 600;
  color: var(--cc-navy);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background-color: unset;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "";
  width: 14px; height: 14px;
  flex-shrink: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a2b4a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>") center/contain no-repeat;
  transition: transform .2s ease;
}
.faq__item[open] summary::after { transform: rotate(180deg); }
.faq__answer { padding-bottom: 18px; }
.faq__answer p { margin: 0; font-size: 0.95rem; color: var(--cc-muted); line-height: 1.7; }

/* ---------- 7. CTA final ---------- */
.final-cta {
  position: relative;
  overflow: hidden;
  background: var(--cc-navy);
  color: #fff;
  padding-block: clamp(56px, 8vw, 96px);
}
.final-cta__pattern {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(196,146,74,0.12) 1px, transparent 0);
  background-size: 22px 22px;
  opacity: 0.6;
  pointer-events: none;
}
.final-cta__inner { position: relative; text-align: center; }
.final-cta__title {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.18;
  color: #fff;
  letter-spacing: -0.015em;
}
.final-cta__sub {
  margin: 18px auto 0;
  max-width: 540px;
  font-size: clamp(1rem, 1.3vw, 1.08rem);
  color: rgba(255,255,255,0.8);
}
.final-cta .btn { margin-top: 28px; }

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* sm: ≥ 640px — beneficios en 2 columnas */
@media (min-width: 640px) {
  .benefits { grid-template-columns: 1fr 1fr; gap: 16px; }
}

/* md: ≥ 768px — beneficios en 3 columnas */
@media (min-width: 768px) {
  .benefits { grid-template-columns: 1fr 1fr 1fr; }
  .explanation p { font-size: 1.1rem; }
}

/* lg: ≥ 1024px */
@media (min-width: 1024px) {
  .main-title { font-size: 3rem; }
}

/* Accesibilidad: movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
