/* ==========================================================================
   Lead Engine — página «What's your home worth?» (bilingüe EN/ES)
   Mobile-first. Los añadidos de esta versión están al final del archivo.
   ========================================================================== */

:root {
  --color-navy: #1F3A5F;   /* primary / headings */
  --color-blue: #2E6F95;   /* secondary */
  --color-accent: #E08A3C; /* warm CTA accent — USE ONLY on buttons */
  --color-accent-dark: #c9762d;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F4F7FA; /* alternating section backgrounds */
  --color-text: #222222;
  --color-text-muted: #555555;
  --color-border: #dfe6ee;
  --color-error: #c0392b;
  --color-success: #1e7e4f;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 10px 30px rgba(31, 58, 95, 0.10);
  --shadow-soft: 0 4px 14px rgba(31, 58, 95, 0.07);
  --maxw: 1120px;
  --maxw-narrow: 760px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --tap: 48px; /* min tap target, brief asks ≥44px */
}

/* ----- reset ----- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-blue); }
h1, h2, h3 { color: var(--color-navy); line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: var(--maxw-narrow); }
.center { text-align: center; }
.mt { margin-top: 28px; }

/* visually hidden but accessible */
.hp-field {
  position: absolute !important;
  left: -5000px;
  width: 1px; height: 1px; overflow: hidden;
}

/* ----- buttons (the ONLY accent-colored elements) ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 14px 26px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, transform .05s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-accent {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(224, 138, 60, 0.35);
}
.btn-accent:hover { background: var(--color-accent-dark); }
.btn-outline {
  background: transparent;
  color: var(--color-navy);
  border-color: var(--color-navy);
}
.btn-outline:hover { background: var(--color-navy); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { font-size: 1.15rem; padding: 18px 34px; }

/* keyboard focus visibility (WCAG) */
:focus-visible {
  outline: 3px solid var(--color-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ----- header ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,0.95);
  backdrop-filter: saturate(180%) blur(6px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.brand-logo { height: 36px; width: auto; }
/* text-based brand lockup: name + role/brokerage (no logo file needed) */
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-name { font-weight: 800; color: var(--color-navy); font-size: 1.05rem; }
.brand-sub { font-weight: 500; color: var(--color-text-muted); font-size: .78rem; }
.header-call {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--color-navy);
  text-decoration: none;
  min-height: var(--tap);
  padding: 4px 8px;
}
.header-call-text { font-size: .98rem; }

/* ----- hero ----- */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, rgba(46,111,149,0.08), transparent),
    var(--color-bg);
  padding: 34px 0 40px;
}
.hero-grid { display: grid; gap: 28px; }
.hero-headline { font-size: clamp(1.9rem, 6vw, 3rem); letter-spacing: -0.01em; }
.hero-sub {
  font-size: clamp(1.05rem, 3.4vw, 1.25rem);
  color: var(--color-text-muted);
  max-width: 36ch;
}
.hero-bullets { margin-top: 18px; display: grid; gap: 8px; }
.hero-bullets li {
  position: relative;
  padding-left: 28px;
  color: var(--color-text-muted);
  font-size: .98rem;
}
.hero-bullets li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  color: var(--color-success);
  font-weight: 800;
}
.hero-cta-mobile { margin-top: 22px; }

/* ----- form card ----- */
.form-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 24px 20px;
}
.form-title { font-size: 1.4rem; margin-bottom: 4px; }
.form-subtitle { color: var(--color-text-muted); font-size: .98rem; margin-bottom: 18px; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: 6px;
  color: var(--color-navy);
}
.field input,
.field select {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  font-size: 16px; /* ≥16px prevents iOS zoom */
  font-family: inherit;
  color: var(--color-text);
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(46,111,149,0.18);
}
.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.12);
}
.field-error {
  display: none;
  color: var(--color-error);
  font-size: .85rem;
  margin-top: 6px;
}
.field-error.show { display: block; }

/* TCPA consent checkbox (compliance requirement — see README) */
.consent-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.consent-field input[type="checkbox"] {
  width: 20px; height: 20px;
  min-height: 0;
  flex: none;
  margin-top: 2px;
  accent-color: var(--color-blue);
}
.consent-field label {
  font-size: .82rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

.btn-submit { margin-top: 6px; position: relative; }
.btn-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: spin .7s linear infinite;
}
.is-loading .btn-label { opacity: .6; }
.is-loading .btn-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-reassure {
  text-align: center;
  font-size: .85rem;
  color: var(--color-text-muted);
  margin: 12px 0 0;
}
.form-reassure.light { color: rgba(255,255,255,0.85); }
.form-feedback { margin: 10px 0 0; font-size: .92rem; }
.form-feedback.error { color: var(--color-error); }

/* success state */
.form-success { text-align: center; padding: 14px 6px; }
.form-success-check {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--color-success);
  color: #fff;
  font-size: 2rem;
  display: grid; place-items: center;
}
.form-success h3 { font-size: 1.35rem; }
.form-success p { color: var(--color-text-muted); }

/* ----- trust bar ----- */
.trust-bar { background: var(--color-navy); color: #fff; }
.trust-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  padding: 18px 20px;
}
.trust-item {
  display: flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: .95rem;
}
.trust-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-accent);
  flex: none;
}

/* ----- generic section ----- */
.section { padding: 52px 0; }
.section-alt { background: var(--color-bg-alt); }
.section-title { font-size: clamp(1.5rem, 4.5vw, 2.1rem); }
.section-title.center { text-align: center; margin-bottom: 28px; }

/* problem */
.pain-list { display: grid; gap: 14px; margin-top: 10px; }
.pain-list li {
  display: flex; gap: 12px;
  background: var(--color-bg-alt);
  border-left: 4px solid var(--color-blue);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--color-text);
}
.pain-icon { color: var(--color-blue); font-weight: 800; line-height: 1.5; }

/* cards */
.cards-3 { display: grid; gap: 18px; }
.value-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow-soft);
}
.value-num {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-navy);
  color: #fff; font-weight: 800;
  display: grid; place-items: center;
  margin-bottom: 14px;
}
.value-card h3 { font-size: 1.15rem; }
.value-card p { color: var(--color-text-muted); margin: 0; }

/* steps */
.steps { display: grid; gap: 20px; max-width: 620px; margin: 0 auto; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step-num {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff; font-weight: 800; font-size: 1.1rem;
  display: grid; place-items: center;
}
.step p { margin: 8px 0 0; font-size: 1.05rem; }

/* why the agent */
.why-grid { display: grid; gap: 28px; align-items: center; }
.why-photo img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  width: 100%;
  object-fit: cover;
}
.why-quote {
  margin: 18px 0;
  padding: 16px 18px;
  background: #fff;
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-sm);
  font-size: 1.08rem;
  font-style: italic;
  color: var(--color-navy);
}

/* testimonials */
.testi-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow-soft);
}
.testi-card.is-placeholder { border-style: dashed; background: var(--color-bg-alt); }
.testi-quote { font-size: 1.05rem; color: var(--color-text); }
.testi-author { font-weight: 700; color: var(--color-navy); margin: 0; }
.testi-note {
  text-align: center;
  color: var(--color-text-muted);
  font-size: .9rem;
  margin-top: 18px;
}

/* faq accordion */
.accordion { display: grid; gap: 12px; }
.acc-item {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.acc-trigger {
  width: 100%;
  min-height: var(--tap);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px;
  background: none; border: none;
  font: inherit; font-weight: 700;
  color: var(--color-navy);
  text-align: left;
  cursor: pointer;
}
.acc-icon {
  flex: none; width: 16px; height: 16px;
  position: relative;
}
.acc-icon::before, .acc-icon::after {
  content: ""; position: absolute; background: var(--color-blue);
  transition: transform .2s ease;
}
.acc-icon::before { top: 7px; left: 0; width: 16px; height: 2px; }
.acc-icon::after { top: 0; left: 7px; width: 2px; height: 16px; }
.acc-trigger[aria-expanded="true"] .acc-icon::after { transform: scaleY(0); }
.acc-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.acc-panel p { padding: 0 18px 16px; margin: 0; color: var(--color-text-muted); }

/* final cta */
.final-cta { background: var(--color-navy); color: #fff; }
.final-cta-title { color: #fff; font-size: clamp(1.6rem, 5vw, 2.3rem); }
.final-cta-sub { color: rgba(255,255,255,0.85); font-size: 1.1rem; margin-bottom: 24px; }

/* footer */
.site-footer {
  background: #15263d;
  color: rgba(255,255,255,0.85);
  padding: 36px 0 90px; /* extra bottom for sticky bar on mobile */
  font-size: .92rem;
}
.footer-inner { display: grid; gap: 20px; }
.site-footer strong { color: #fff; }
.footer-muted { color: rgba(255,255,255,0.6); }
.footer-contact { display: grid; gap: 8px; }
.footer-contact a { color: #fff; text-decoration: none; }
.footer-contact a:hover { text-decoration: underline; }
.footer-legal { color: rgba(255,255,255,0.6); }
.footer-legal a { color: rgba(255,255,255,0.8); }
.footer-copy { margin-top: 12px; font-size: .82rem; }
.footer-disclosure { margin-top: 10px; font-size: .8rem; color: rgba(255,255,255,0.5); }

/* sticky mobile cta */
.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  transform: translateY(120%);
  transition: transform .25s ease;
}
.sticky-cta.visible { transform: translateY(0); }

/* hide sticky bar when the form/success is on screen (set via JS) */
.sticky-cta.hidden-by-form { transform: translateY(120%); }

/* =========================================================
   RESPONSIVE — scale up from mobile
   ========================================================= */
@media (min-width: 600px) {
  .trust-row { grid-template-columns: repeat(4, 1fr); }
  .cards-3 { grid-template-columns: repeat(3, 1fr); }
  .form-card { padding: 28px 26px; }
}

@media (min-width: 900px) {
  .hero { padding: 56px 0 64px; }
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: start;
    gap: 48px;
  }
  /* on desktop the form is visible beside the headline; hide the
     "scroll to form" mobile button */
  .hero-cta-mobile { display: none; }
  .why-grid { grid-template-columns: 0.8fr 1.2fr; }
  /* sticky bottom bar is a mobile pattern — hide on desktop */
  .sticky-cta { display: none; }
  .site-footer { padding-bottom: 40px; }
  .footer-inner {
    grid-template-columns: 1.2fr 1fr 1.2fr;
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* =========================================================
   LEAD ENGINE ADDITIONS — bilingual toggle, demo banner,
   config-driven sections (8-oct-2026)
   ========================================================= */

/* Elements toggled from config.js use the `hidden` attribute; make sure
   no component rule (display:flex, inline-flex…) overrides it. */
[hidden] { display: none !important; }

/* Demo strip: only on the sample page (config.demo = true) */
.demo-banner {
  background: #fff4e5;
  color: #7a4b12;
  border-bottom: 1px solid #f1d9b5;
  text-align: center;
  font-size: .85rem;
  font-weight: 600;
  padding: 8px 16px;
}

.brand-text { min-width: 0; }
.brand-sub { overflow-wrap: anywhere; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.lang-toggle {
  min-height: 44px;
  padding: 6px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  background: #fff;
  color: var(--color-navy);
  font: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.lang-toggle:hover { border-color: var(--color-blue); background: var(--color-bg-alt); }

/* Phones: keep the call icon, drop the number text so the header fits */
@media (max-width: 479px) {
  .header-call-text { display: none; }
  .header-call { padding: 4px 6px; }
  .brand-name { font-size: .98rem; }
}

.photo-note {
  text-align: center;
  font-size: .85rem;
  color: var(--color-text-muted);
  margin: 10px 0 0;
}

/* Shown in the success box when the form has no destination configured */
.success-testmode {
  margin: 14px 0 0;
  padding: 8px 12px;
  background: #fff4e5;
  color: #7a4b12;
  border-radius: var(--radius-sm);
  font-size: .85rem;
}

.footer-credit { margin-top: 10px; font-size: .78rem; color: rgba(255,255,255,0.45); }

/* Header polish: the brand is a link but shouldn't look like one; the call
   icon is an inline SVG in the brand navy (an emoji renders pink on Windows) */
.brand { text-decoration: none; }
.header-inner { gap: 12px; }
.header-call-icon { flex: none; }

/* The phone number never breaks across lines (script.js wraps it in this span) */
.nowrap { white-space: nowrap; }
