/* =========================================================
   PrecioDeMercado — Landing de captación
   Mobile-first. Sin framework. Sin fuentes externas.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --navy-900: #071a33;
  --navy-800: #0b2545;
  --navy-700: #13355f;
  --navy-100: #e7edf6;

  --teal-600: #0f8a8d;
  --teal-500: #13a5a8;

  --amber-500: #f0a202;
  --amber-600: #d98c00;

  --ink: #16202e;
  --ink-soft: #4a5a6e;
  --ink-faint: #7b8a9c;

  --bg: #ffffff;
  --bg-alt: #f5f8fc;
  --line: #dfe6f0;

  --danger: #c0392b;
  --success: #1a7f4b;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(7, 26, 51, .06), 0 2px 8px rgba(7, 26, 51, .05);
  --shadow-md: 0 4px 12px rgba(7, 26, 51, .08), 0 12px 32px rgba(7, 26, 51, .08);
  --shadow-lg: 0 10px 24px rgba(7, 26, 51, .10), 0 28px 60px rgba(7, 26, 51, .14);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --pad-x: 20px;
  --maxw: 1140px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
svg { display: block; }

h1, h2, h3 {
  margin: 0 0 .5em;
  line-height: 1.18;
  letter-spacing: -.02em;
  color: var(--navy-800);
  text-wrap: balance;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--teal-600); }

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

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

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
.container-narrow { max-width: 760px; }

.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }

.section-head { margin-bottom: 32px; max-width: 640px; }
.section-head h2 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); margin: 0; }

.kicker {
  margin: 0 0 .5rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--teal-600);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--navy-800);
  color: #fff;
  padding: 12px 18px;
  border-radius: 0 0 var(--radius-sm) 0;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background-color .2s ease;
  min-height: 48px;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--amber-500);
  color: var(--navy-900);
  box-shadow: 0 2px 0 var(--amber-600), var(--shadow-sm);
}
.btn-primary:hover { background: #ffb01f; }
.btn-primary:disabled { opacity: .65; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, .35);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }

.btn-sm { padding: 9px 16px; font-size: .875rem; min-height: 40px; }
.btn-lg { padding: 17px 32px; font-size: 1.0625rem; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy-800);
  padding-top: env(safe-area-inset-top);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--teal-500);
  color: #04222a;
  flex: none;
}
.brand-text { font-size: 1.05rem; font-weight: 400; letter-spacing: -.01em; }
.brand-text strong { font-weight: 800; }

.header-cta { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(120% 90% at 15% 0%, #14406f 0%, transparent 60%),
    linear-gradient(160deg, var(--navy-800) 0%, var(--navy-900) 100%);
  color: #fff;
  padding: 40px 0 48px;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -60% 40%;
  height: 340px;
  background: radial-gradient(closest-side, rgba(19, 165, 168, .30), transparent);
  pointer-events: none;
}

.hero-grid { position: relative; z-index: 1; display: grid; gap: 32px; }

.hero-copy h1 {
  color: #fff;
  font-size: clamp(1.75rem, 6.4vw, 3rem);
  margin-bottom: .55em;
}
.hero-copy h1 em {
  font-style: normal;
  color: var(--amber-500);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 6px 14px 6px 10px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  font-size: .8rem;
  font-weight: 600;
  color: #d7e4f5;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 0 4px rgba(61, 220, 132, .22);
  flex: none;
}

.lead {
  font-size: clamp(1rem, 2.6vw, 1.125rem);
  color: #cfdcec;
  max-width: 34em;
}
.lead strong { color: #fff; }

.ticks {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.ticks li {
  position: relative;
  padding-left: 30px;
  color: #e4ecf7;
  font-size: .96rem;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: rgba(61, 220, 132, .16) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233ddc84' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.hero-proof {
  display: flex;
  align-items: stretch;
  gap: 14px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, .14);
}
.proof-item { display: grid; gap: 2px; }
.proof-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
}
.proof-lbl { font-size: .74rem; line-height: 1.35; color: #9fb3cd; max-width: 12em; }
.proof-sep { width: 1px; background: rgba(255, 255, 255, .14); }

/* ---------- Formulario ---------- */
.form-card {
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-lg);
}

.form-head { margin-bottom: 20px; }
.form-head h2 { font-size: 1.3rem; margin-bottom: .3em; }
.form-head p { font-size: .9rem; color: var(--ink-soft); }

.field { margin-bottom: 16px; }

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--navy-800);
}
.hint-inline { font-weight: 400; color: var(--ink-faint); }

.field input[type="text"],
.field input[type="tel"] {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 16px; /* evita el zoom automático en iOS */
  color: var(--ink);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder { color: #a9b6c6; }
.field input:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(19, 165, 168, .18);
}
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(192, 57, 43, .16); }

.phone-input { display: flex; align-items: stretch; }
.phone-input .prefix {
  display: grid;
  place-items: center;
  padding-inline: 13px;
  border: 1.5px solid var(--line);
  border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: var(--bg-alt);
  color: var(--ink-soft);
  font-size: .9rem;
  font-weight: 600;
  flex: none;
}
.phone-input input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.field-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 8px;
}
.field-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--teal-600);
  flex: none;
}
.field-check label {
  margin: 0;
  font-size: .78rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-soft);
}
.field-check label strong { color: var(--ink); font-weight: 700; }

.error {
  margin: 6px 0 0;
  font-size: .8rem;
  font-weight: 600;
  color: var(--danger);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

#submit-btn { margin-top: 12px; }

.form-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 14px 0 0;
  font-size: .76rem;
  color: var(--ink-faint);
  text-align: center;
}
.form-foot svg { flex: none; }

.form-alert {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 600;
}
.form-alert.is-error { background: #fdecea; color: var(--danger); }
.form-alert.is-success { background: #e8f6ee; color: var(--success); }

.spinner {
  width: 17px;
  height: 17px;
  border: 2.5px solid rgba(7, 26, 51, .25);
  border-top-color: var(--navy-900);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tarjetas ---------- */
.cards { display: grid; gap: 16px; }

.card {
  padding: 24px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card h3 { font-size: 1.1rem; margin-bottom: .4em; }
.card p { font-size: .93rem; color: var(--ink-soft); }

.card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--navy-100);
  color: var(--navy-700);
}

/* ---------- Pasos ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 22px;
  counter-reset: step;
}
.step-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
}
.step-num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy-800);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  flex: none;
}
.step-item h3 { font-size: 1.06rem; margin-bottom: .25em; }
.step-item p { font-size: .93rem; color: var(--ink-soft); }

/* ---------- Zonas ---------- */
.zones {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.zones li {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-alt);
  font-size: .875rem;
  font-weight: 600;
  color: var(--navy-700);
}
.zones-note { font-size: .9rem; color: var(--ink-soft); max-width: 46em; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; }

.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}
.faq details[open] { box-shadow: var(--shadow-sm); }

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  font-weight: 700;
  font-size: .97rem;
  color: var(--navy-800);
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  width: 11px;
  height: 11px;
  border-right: 2.5px solid var(--teal-600);
  border-bottom: 2.5px solid var(--teal-600);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .2s ease;
  flex: none;
}
.faq details[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }

.faq details p {
  margin: 0;
  padding: 0 18px 18px;
  font-size: .93rem;
  color: var(--ink-soft);
}

/* ---------- CTA final ---------- */
.cta-final {
  padding: 56px 0;
  background: linear-gradient(160deg, var(--navy-800), var(--navy-900));
  color: #fff;
  text-align: center;
}
.cta-inner h2 {
  color: #fff;
  font-size: clamp(1.4rem, 4.6vw, 2.05rem);
}
.cta-inner > p { color: #c3d3e6; margin-bottom: 26px; }
.cta-note { margin-top: 16px; font-size: .8rem; color: #8fa5c0; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 36px 0 calc(28px + env(safe-area-inset-bottom));
  background: var(--navy-900);
  color: #9fb3cd;
  font-size: .85rem;
}
.footer-inner {
  display: grid;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  margin-bottom: 18px;
}
.footer-brand .brand-text { color: #fff; }
.footer-brand p { margin: 8px 0 0; max-width: 32em; }

.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { color: #cfdcec; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

.footer-legal { font-size: .78rem; color: #7089a8; max-width: 60em; }

/* ---------- CTA fija en móvil ---------- */
.mobile-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 10px var(--pad-x) calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(7, 26, 51, .10);
}
.mobile-cta[hidden] { display: none; }

/* =========================================================
   Embudo multi-paso
   ========================================================= */

/* ---------- Cabecera y progreso ---------- */
.wizard-head { margin-bottom: 20px; }

.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--navy-100);
  overflow: hidden;
}
.progress-bar { height: 100%; }
.progress-bar > span {
  display: block;
  height: 100%;
  width: 16.6667%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal-600), var(--teal-500));
  transition: width .32s cubic-bezier(.4, 0, .2, 1);
}
.progress-label {
  margin: 8px 0 0;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- Pasos ---------- */
.step {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0; /* deja que el fieldset encoja en flex/grid */
}
.step.is-active {
  display: block;
  animation: step-in .26s ease both;
}
@keyframes step-in {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: none; }
}

.step-title {
  display: block;
  float: none;
  width: 100%;
  padding: 0;
  margin: 0 0 6px;
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.02em;
  color: var(--navy-800);
}
.step-title:focus { outline: none; }
.step-title:focus-visible { outline: 3px solid var(--amber-500); outline-offset: 3px; }

.step-sub {
  margin: 0 0 18px;
  font-size: .88rem;
  color: var(--ink-soft);
}

.field-legend {
  margin: 20px 0 10px;
  font-size: .875rem;
  font-weight: 700;
  color: var(--navy-800);
}
.field-legend:first-of-type { margin-top: 0; }

/* ---------- Opciones seleccionables ---------- */
.options { display: grid; gap: 10px; }
.options-grid { grid-template-columns: repeat(2, 1fr); }
.options-list { grid-template-columns: 1fr; }
.options-row {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}

.option { display: block; cursor: pointer; }

/* El input real queda accesible pero invisible: el foco se pinta en .option-body */
.option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.option-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  min-height: 88px;
  padding: 16px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.option:hover .option-body { border-color: var(--teal-500); background: #f7fdfd; }

.option-ico { color: var(--navy-700); transition: color .15s ease; }
.option-text {
  font-size: .9rem;
  font-weight: 600;
  color: var(--navy-800);
  line-height: 1.3;
}

.option input:checked + .option-body {
  border-color: var(--teal-600);
  background: #edfafa;
  box-shadow: 0 0 0 3px rgba(19, 165, 168, .18);
}
.option input:checked + .option-body .option-ico { color: var(--teal-600); }

.option input:focus-visible + .option-body {
  outline: 3px solid var(--amber-500);
  outline-offset: 2px;
}

/* Variante compacta: una línea, sin icono */
.option-sm .option-body {
  min-height: 46px;
  padding: 11px 10px;
}
.option-sm .option-text { font-size: .84rem; }

/* Variante en lista: alineada a la izquierda con marca de selección */
.option-line .option-body {
  flex-direction: row;
  justify-content: flex-start;
  min-height: 50px;
  padding: 12px 16px;
  text-align: left;
}
.option-line .option-text { font-size: .92rem; font-weight: 600; }
.option-line .option-body::after {
  content: "";
  width: 20px;
  height: 20px;
  margin-left: auto;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  flex: none;
  transition: border-color .15s ease, background .15s ease;
}
.option-line input:checked + .option-body::after {
  border-color: var(--teal-600);
  background: var(--teal-600) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* ---------- Campos numéricos y selects ---------- */
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.field input[type="number"],
.field input[type="email"],
.field select {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5a6e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 15px;
}
.field input[type="number"]:focus,
.field input[type="email"]:focus,
.field select:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(19, 165, 168, .18);
}
.field input[aria-invalid="true"],
.field select[aria-invalid="true"] { border-color: var(--danger); }

/* Oculta las flechas del input number: molestan más de lo que ayudan */
.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field input[type="number"] { -moz-appearance: textfield; }

.suffix-input { position: relative; }
.suffix-input input { padding-right: 44px; }
.suffix-input .suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-faint);
  pointer-events: none;
}

/* ---------- Mapa ---------- */
.map-block { margin-top: 6px; }

.map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.map-hint { font-size: .78rem; color: var(--ink-faint); }

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 2px;
  border: 0;
  background: none;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  color: var(--teal-600);
  cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }

.map-canvas {
  position: relative;
  height: 210px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-alt);
  overflow: hidden;
  z-index: 0; /* mantiene los controles de Leaflet por debajo del header */
}

.map-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  font-size: .85rem;
  color: var(--ink-faint);
}

/* Pin fijo en el centro: se mueve el mapa, no el marcador */
.map-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100%);
  z-index: 500;
  pointer-events: none;
  filter: drop-shadow(0 3px 5px rgba(7, 26, 51, .35));
}
.map-block.is-unavailable .map-canvas { height: auto; min-height: 84px; }

.map-note { margin: 8px 0 0; font-size: .75rem; color: var(--ink-faint); }

/* Leaflet: baja el tamaño de la atribución para que no rompa el diseño */
.map-canvas .leaflet-control-attribution { font-size: .62rem; }

/* ---------- Resumen del último paso ---------- */
.summary {
  margin-bottom: 18px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal-500);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-alt);
}
.summary:empty { display: none; }
.summary-line {
  margin: 0;
  font-size: .92rem;
  font-weight: 700;
  color: var(--navy-800);
}
.summary-zone {
  margin: 2px 0 0;
  font-size: .82rem;
  color: var(--ink-soft);
}

/* ---------- Navegación ---------- */
.wizard-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}
.wizard-nav .btn-next { flex: 1; }

.btn-back {
  padding: 14px 16px;
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
  font-weight: 600;
  flex: none;
}
.btn-back:hover { background: var(--bg-alt); color: var(--navy-800); }
.btn-back[hidden] { display: none; }
.btn-next[hidden] { display: none; }

/* ========== Breakpoints ========== */

/* Móvil grande */
@media (min-width: 480px) {
  .form-card { padding: 28px 26px; }
  .map-canvas { height: 240px; }
  .step-title { font-size: 1.32rem; }
  .proof-lbl { font-size: .78rem; }
}

/* Tablet */
@media (min-width: 720px) {
  :root { --pad-x: 32px; }

  .section { padding: 76px 0; }
  .hero { padding: 60px 0 72px; }
  .cta-final { padding: 76px 0; }

  .cards { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .step-item { grid-template-columns: 1fr; }
  .step-num { margin-bottom: 4px; }

  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
  .footer-links { justify-content: flex-end; }
}

/* Escritorio: hero a dos columnas, el formulario sube junto al titular */
@media (min-width: 1000px) {
  .hero { padding: 72px 0 88px; }

  .hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(400px, 440px);
    gap: 56px;
    align-items: start;
  }

  .form-wrap { position: sticky; top: 88px; }
  .form-card { padding: 30px 28px; }
  .map-canvas { height: 250px; }

  .header-cta { display: inline-flex; }

  /* En escritorio el formulario ya está a la vista */
  .mobile-cta { display: none !important; }

  .section-head { margin-bottom: 40px; }
}

@media (min-width: 1200px) {
  .hero-grid { gap: 72px; }
}

/* ---------- Impresión ---------- */
@media print {
  .site-header, .mobile-cta, .form-wrap, .cta-final { display: none !important; }
  .hero { background: none; color: #000; }
  .hero-copy h1, .cta-inner h2 { color: #000; }
}

/* ---------- Páginas legales ---------- */
.legal-doc { padding: 40px 0 64px; }
.legal-doc h1 { font-size: clamp(1.5rem, 5vw, 2.1rem); margin-bottom: .3em; }
.legal-doc h2 {
  font-size: 1.15rem;
  margin: 2em 0 .6em;
  padding-top: 1.2em;
  border-top: 1px solid var(--line);
}
.legal-doc h2:first-of-type { border-top: 0; padding-top: 0; }
.legal-doc p, .legal-doc li { font-size: .95rem; color: var(--ink-soft); }
.legal-doc ul, .legal-doc ol { padding-left: 1.3em; margin: 0 0 1em; }
.legal-doc li { margin-bottom: .45em; }
.legal-doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5em;
  font-size: .9rem;
}
.legal-doc th, .legal-doc td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.legal-doc th { background: var(--bg-alt); color: var(--navy-800); font-weight: 700; }
.legal-doc td { color: var(--ink-soft); }
.legal-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.legal-date { font-size: .85rem; color: var(--ink-faint); margin-bottom: 2em; }

.legal-todo {
  margin: 0 0 2em;
  padding: 14px 16px;
  border-left: 4px solid var(--amber-500);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: #fff8e8;
  font-size: .88rem;
  color: #6b4c00;
}
.legal-todo strong { color: #4a3400; }

/* =========================================================
   Portal de ciudades y elementos multi-ciudad
   ========================================================= */

/* Etiqueta de ciudad en la cabecera de cada landing */
.header-city {
  margin-right: auto;
  margin-left: 12px;
  padding: 4px 11px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: #cfdcec;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

/* Hero del portal: sin formulario al lado, texto centrado */
.hero-portal { padding-bottom: 56px; }
.portal-intro { position: relative; z-index: 1; }
.portal-intro h1 {
  color: #fff;
  font-size: clamp(1.75rem, 6vw, 2.8rem);
  margin-bottom: .5em;
}
.portal-intro h1 em { font-style: normal; color: var(--amber-500); }
.portal-intro .ticks { margin-top: 24px; }

/* Rejilla de ciudades */
.city-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.city-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
  min-height: 74px;
}
.city-card:hover {
  border-color: var(--teal-500);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.city-card-name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--navy-800);
  line-height: 1.25;
}
.city-card-meta {
  margin-left: auto;
  font-size: .78rem;
  color: var(--ink-faint);
  text-align: right;
  white-space: nowrap;
}
.city-card-go {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--navy-100);
  color: var(--navy-700);
  flex: none;
  transition: background-color .15s ease, color .15s ease;
}
.city-card:hover .city-card-go { background: var(--teal-600); color: #fff; }

/* Enlaces a otras ciudades al pie de cada landing */
.city-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.city-links a {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-alt);
  font-size: .875rem;
  font-weight: 600;
  color: var(--navy-700);
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.city-links a:hover { border-color: var(--teal-500); background: #f7fdfd; }

@media (min-width: 560px) {
  .city-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .city-grid { grid-template-columns: repeat(3, 1fr); }
  .city-card-meta { display: none; } /* en 3 columnas el nombre manda */
}
@media (min-width: 1000px) {
  .header-city { font-size: .8rem; max-width: none; }
}

/* =========================================================
   Pantalla de preparación de la estimación (entre el paso 5 y el 6)
   ========================================================= */

.analysis {
  animation: step-in .26s ease both;
  padding: 4px 0 2px;
}
.analysis[hidden] { display: none; }

.analysis-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.analysis-headings { min-width: 0; }

.analysis-title {
  margin: 0 0 3px;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--navy-800);
  line-height: 1.25;
}
.analysis-sub {
  margin: 0;
  font-size: .85rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Indicador principal: gira mientras prepara, se convierte en check al terminar */
.analysis-spin {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid var(--navy-100);
  border-top-color: var(--teal-600);
  animation: spin .9s linear infinite;
  flex: none;
  transition: border-color .3s ease, background-color .3s ease;
}
.analysis-spin.is-done {
  animation: none;
  border-color: var(--teal-600);
  background: var(--teal-600) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 18px no-repeat;
}

/* Lista de lo que incluye la estimación */
.analysis-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 13px;
}

.analysis-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  opacity: .42;
  transform: translateY(3px);
  transition: opacity .35s ease, transform .35s ease;
}
.analysis-item.is-done { opacity: 1; transform: none; }

.analysis-mark {
  position: relative;
  width: 21px;
  height: 21px;
  margin-top: 1px;
  border: 2px solid var(--line);
  border-radius: 50%;
  flex: none;
  transition: border-color .3s ease, background-color .3s ease;
}
/* Punto latiendo mientras está pendiente */
.analysis-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
  transition: opacity .2s ease;
}
.analysis-item.is-done .analysis-mark {
  border-color: var(--teal-600);
  background: var(--teal-600) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
  animation: mark-pop .32s cubic-bezier(.34, 1.56, .64, 1);
}
.analysis-item.is-done .analysis-mark::after { opacity: 0; }

@keyframes mark-pop {
  0%   { transform: scale(.6); }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.analysis-text {
  font-size: .9rem;
  line-height: 1.45;
  color: var(--ink-soft);
  transition: color .3s ease;
}
.analysis-item.is-done .analysis-text { color: var(--navy-800); font-weight: 600; }

/* Cierre: la revisión humana es el argumento real de profesionalidad */
.analysis-foot {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 20px 0 0;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border-left: 3px solid var(--teal-500);
  font-size: .82rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.analysis-foot svg { flex: none; margin-top: 2px; color: var(--teal-600); }

/* Distintivo que hereda el resumen del paso 6 */
.summary.is-ready { border-left-color: var(--teal-600); }

.summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 5px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--teal-600);
}
.summary-badge::before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--teal-600) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 9px no-repeat;
  flex: none;
}

/* Sin animaciones: la pantalla se muestra ya completa */
@media (prefers-reduced-motion: reduce) {
  .analysis-spin { animation: none; border-top-color: var(--teal-600); }
  .analysis-item { opacity: 1; transform: none; }
  .analysis-item.is-done .analysis-mark { animation: none; }
}

@media (min-width: 480px) {
  .analysis-title { font-size: 1.2rem; }
  .analysis-text { font-size: .93rem; }
}

/* Nota de ayuda bajo un campo opcional */
.field-hint {
  margin: 6px 0 0;
  font-size: .76rem;
  line-height: 1.4;
  color: var(--ink-faint);
}
