/* =========================================================
   MI REFERENCIA · Rediseño azul y blanco, minimalista
   - Sección de búsqueda, resultado, modales y notificación
   - No toca el header (.capas-*)
   - Cargar DESPUÉS de "style con header correcto.css"
   ========================================================= */

:root {
  --ref-azul: #1976d2;
  --ref-azul-osc: #1565c0;
  --ref-azul-claro: #eaf3fc;
  --ref-azul-borde: #d3e4f5;
  --ref-tinta: #0b2540;
  --ref-gris: #5b6b7c;
  --ref-gris-claro: #8a99a8;
  --ref-linea: #e3ebf3;
  --ref-fondo: #f6f9fd;
  --ref-blanco: #ffffff;
  --ref-sombra: 0 20px 50px -24px rgba(11, 37, 64, .28);
  --ref-sombra-sm: 0 8px 20px -12px rgba(11, 37, 64, .22);
}

/* ---------- Fondo de página ---------- */
html { background: var(--ref-fondo); }

body {
  background-color: var(--ref-fondo);
  background-image:
    radial-gradient(620px 420px at 0% 80%, rgba(25, 118, 210, .09), transparent 70%),
    radial-gradient(560px 380px at 100% 62%, rgba(25, 118, 210, .08), transparent 70%),
    radial-gradient(rgba(25, 118, 210, .13) 1px, transparent 1.4px);
  background-size: auto, auto, 22px 22px;
}

/* =========================================================
   HERO (banda azul a todo lo ancho)
   ========================================================= */
.ref-hero {
  --banda-extra: 150px;            /* cuánto baja la banda detrás de la tarjeta */
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 26px 20px 4px;
  text-align: center;
  color: var(--ref-blanco);
}

/* Banda azul de orilla a orilla.
   border-image con "outset" pinta más allá de la caja sin crear scroll
   horizontal, y no depende de 100vw (que falla con el zoom del 90%). */
.ref-hero::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  bottom: calc(var(--banda-extra) * -1);
  z-index: -2;
  border-image: linear-gradient(180deg, #1976d2 0%, #1565c0 55%, #0f4fa8 100%) 0 fill / 0 / 0 100vmax;
}

/* Ola en la parte baja de la banda, también de orilla a orilla */
.ref-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 70px;
  bottom: calc(var(--banda-extra) * -1 - 1px);
  z-index: -1;
  border-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'><path fill='%23f6f9fd' d='M0,64 C240,120 480,8 720,40 C960,72 1200,120 1440,56 L1440,120 L0,120 Z'/><path fill='%23f6f9fd' fill-opacity='.45' d='M0,40 C260,96 520,0 760,28 C1000,56 1220,100 1440,30 L1440,120 L0,120 Z'/></svg>") 0 fill / 0 / 0 100vmax;
}

/* Burbujas decorativas */
.ref-orbes {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.ref-orbes span {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .22);
  animation: refBurbuja 9s ease-in-out infinite;
}
.ref-orbes span:nth-child(1) { width: 90px;  height: 90px;  left: -2%;  top: 34px;  }
.ref-orbes span:nth-child(2) { width: 46px;  height: 46px;  right: 4%;  top: 60px;  animation-delay: -3s; }
.ref-orbes span:nth-child(3) { width: 140px; height: 140px; right: -6%; bottom: -40px; animation-delay: -6s; background: rgba(255, 255, 255, .04); }

@keyframes refBurbuja {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

.ref-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .28);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--ref-blanco);
}
.ref-pill i { font-size: 14px; color: #bfe3ff; }

.ref-titulo {
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 700;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.12;
  letter-spacing: -.6px;
  margin: 0 auto 12px;
  max-width: 17ch;
  color: var(--ref-blanco);
  text-shadow: 0 2px 18px rgba(5, 30, 70, .25);
}
.ref-titulo span { color: #bfe3ff; }

.ref-bajada {
  max-width: 50ch;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .86);
}

/* =========================================================
   TARJETA DE BÚSQUEDA
   ========================================================= */
.ref-main {
  width: 100%;
  max-width: 620px;
  margin: 28px auto 0;
  padding: 0 16px;
  flex: 1 0 auto;
  text-align: left;
}

.ref-card {
  position: relative;
  background: var(--ref-blanco);
  border: 1px solid var(--ref-linea);
  border-radius: 24px;
  padding: 26px 24px 22px;
  box-shadow:
    0 30px 60px -28px rgba(5, 30, 70, .55),
    0 2px 6px rgba(11, 37, 64, .05);
}

.ref-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ref-label {
  margin: 0;
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--ref-tinta);
}
.ref-label small {
  display: block;
  margin-top: 2px;
  font-family: 'Open Sans', sans-serif;
  font-weight: 400;
  font-size: 13px;
  color: var(--ref-gris);
}

/* Botón "¿Dónde lo encuentro?" */
.ref-card .ref-ayuda {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--ref-azul-claro);
  color: var(--ref-azul);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.ref-card .ref-ayuda:hover {
  background: var(--ref-azul);
  color: var(--ref-blanco);
}
.ref-card .ref-ayuda .info-icon {
  width: auto;
  height: auto;
  margin: 0;
  background: none;
  box-shadow: none;
  animation: none;
  transform: none;
  font-size: 15px;
  color: inherit;
}

/* Campo */
.ref-card .ref-buscador.marco-input {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0;
  background: var(--ref-fondo);
  border: 1.5px solid #dbe6f1;
  border-radius: 14px;
  box-shadow: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  overflow: visible;
}
.ref-card .ref-buscador.marco-input:hover {
  border-color: #c3d6ea;
  box-shadow: none;
}
.ref-card .ref-buscador.marco-input:focus-within,
.ref-card .ref-buscador.marco-input.input-focused {
  background: var(--ref-blanco);
  border-color: var(--ref-azul);
  box-shadow: 0 0 0 4px rgba(25, 118, 210, .12);
}

.ref-card .ref-buscador .icono-busqueda {
  position: absolute;
  left: 18px;
  font-size: 18px;
  color: var(--ref-gris-claro);
  opacity: 1;
}
.ref-card .ref-buscador.marco-input:focus-within .icono-busqueda { color: var(--ref-azul); }

.ref-card #predio {
  display: block;
  width: 100%;
  height: 58px;
  margin: 0;
  padding: 0 50px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ref-tinta);
  text-align: left;
  box-shadow: none;
  outline: none;
}
.ref-card #predio::placeholder {
  color: #a9b6c3;
  font-weight: 400;
  font-size: 18px;
  letter-spacing: .5px;
  opacity: 1;
}

.ref-card .ref-buscador .icono-limpiar {
  position: absolute;
  right: 16px;
  font-size: 18px;
  color: #c0cbd6;
  opacity: 1;
  cursor: pointer;
  transition: color .2s ease;
}
.ref-card .ref-buscador .icono-limpiar:hover { color: var(--ref-gris); }

/* Botones */
.ref-acciones {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.ref-card .ref-btn-buscar {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  height: 54px;
  margin: 0;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  background: var(--ref-azul);
  color: var(--ref-blanco);
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: .2px;
  text-transform: none;
  text-shadow: none;
  box-shadow: 0 10px 22px -10px rgba(25, 118, 210, .65);
  animation: none;
  cursor: pointer;
  transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
}
.ref-card .ref-btn-buscar i { font-size: 17px; }
.ref-card .ref-btn-buscar::before,
.ref-card .ref-btn-buscar::after { display: none; }
.ref-card .ref-btn-buscar:hover {
  background: var(--ref-azul-osc);
  color: var(--ref-blanco);
  text-shadow: none;
  transform: translateY(-1px);
  box-shadow: 0 14px 26px -10px rgba(25, 118, 210, .7);
}
.ref-card .ref-btn-buscar:active { transform: translateY(0); }

.ref-card .ref-btn-limpiar {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--ref-blanco);
  border: 1.5px solid #dbe6f1;
  color: var(--ref-azul);
  font-size: 19px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.ref-card .ref-btn-limpiar i { transition: transform .45s ease; }
.ref-card .ref-btn-limpiar:hover {
  background: var(--ref-azul-claro);
  border-color: var(--ref-azul-borde);
}
.ref-card .ref-btn-limpiar:hover i { transform: rotate(-180deg); }

/* Datos de confianza */
.ref-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--ref-gris);
}
.ref-meta span { display: inline-flex; align-items: center; gap: 6px; }
.ref-meta i { color: var(--ref-azul); }

.ref-card #loading {
  margin: 14px 0 0;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--ref-gris);
}

/* =========================================================
   RESULTADO (lo genera script copia.js)
   ========================================================= */
.ref-card .seccion-resultados { display: block; width: 100%; }

.ref-card #resultado {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  margin: 20px 0 0;
  padding: 20px 18px 18px;
  background: var(--ref-fondo);
  color: var(--ref-tinta);
  border: 1px solid var(--ref-linea);
  border-radius: 18px;
  box-shadow: none;
  font-size: 15px;
  font-weight: 400;
  text-align: left;
  animation: refEntrada .35s ease both;
}
.ref-card #resultado::before { display: none; }

@keyframes refEntrada {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.ref-card #resultado > div { animation: none; }

.ref-card #resultado .resultado-icono {
  width: 22px;
  margin-right: 6px;
  color: var(--ref-azul);
  animation: none;
}
.ref-card #resultado > div:hover .resultado-icono { transform: none; }

.ref-card #resultado .etiqueta {
  margin-right: 6px;
  color: var(--ref-gris);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
}
.ref-card #resultado .etiqueta::after { display: none; }
.ref-card #resultado > div:hover .etiqueta { color: var(--ref-gris); transform: none; }

.ref-card #resultado .valor {
  color: var(--ref-tinta);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: .2px;
}
.ref-card #resultado > div:hover .valor { color: var(--ref-tinta); }

/* Nombre parcialmente oculto: tono azul grisáceo en lugar de negro */
.ref-card #resultado .valor span[style*="blur"] {
  background-color: #c9d6e4 !important;
}

.ref-card #resultado .separador {
  height: 1px;
  margin: 12px 0;
  background: var(--ref-linea);
}
.ref-card #resultado .separador::after { display: none; }

/* Número de referencia */
.ref-card #resultado #referencia-valor {
  display: inline-block;
  margin: 6px 0 0;
  padding: 7px 14px;
  border-radius: 10px;
  background: var(--ref-blanco);
  border: 1.5px dashed #9ec5ec;
  font-family: 'Consolas', 'SF Mono', 'Roboto Mono', monospace;
  font-size: clamp(19px, 5.2vw, 24px);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ref-azul-osc);
  -webkit-user-select: all;
  user-select: all;
  word-break: break-all;
}
.ref-card #resultado #referencia-valor::after { display: none; }

/* Botón copiar */
.ref-card #resultado .btn-copy {
  width: 38px;
  height: 38px;
  margin: 0 0 0 8px;
  padding: 0;
  border-radius: 10px;
  background: var(--ref-blanco);
  border: 1px solid var(--ref-azul-borde);
  color: var(--ref-azul);
  font-size: 16px;
  vertical-align: middle;
  transition: background .2s ease, color .2s ease;
}
.ref-card #resultado .btn-copy:hover {
  background: var(--ref-azul);
  border-color: var(--ref-azul);
  color: var(--ref-blanco);
  transform: none;
}
.ref-card #resultado .btn-copy.copied {
  background: var(--ref-azul);
  border-color: var(--ref-azul);
  color: var(--ref-blanco);
}

/* "Tiene medidor: …" (viene con color blanco en línea) */
.ref-card #resultado > div[style*="margin-left: 25px"] {
  color: var(--ref-gris) !important;
  font-size: 13px !important;
  margin-left: 28px !important;
}
.ref-card #resultado > div[style*="margin-left: 25px"] i { color: var(--ref-azul); }

/* Mensaje de "Predio no encontrado" */
.ref-card #resultado > div[style*="rgb(187, 2, 2)"] {
  color: #c62828 !important;
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 700;
  font-size: 17px !important;
}
.ref-card #resultado > div[style*="#f8f8f8"] {
  color: var(--ref-gris) !important;
}

/* Nota */
.ref-card #resultado .nota {
  margin-top: 16px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--ref-azul-claro);
  border: 1px solid var(--ref-azul-borde);
  color: #0d4f8b;
  font-style: normal;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  animation: none;
  box-shadow: none;
}
.ref-card #resultado .nota i { animation: none; margin-right: 4px; }

/* Botón pagar */
.ref-card #resultado .botones-resultado {
  margin-top: 14px;
  padding-top: 0;
  border-top: 0;
}
.ref-card #resultado .btn-pagar {
  width: 100%;
  justify-content: center;
  margin: 0;
  padding: 14px 20px;
  border-radius: 14px;
  background: var(--ref-azul);
  color: var(--ref-blanco);
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 15.5px;
  font-weight: 700;
  box-shadow: 0 10px 22px -10px rgba(25, 118, 210, .65);
}
.ref-card #resultado .btn-pagar:hover {
  background: var(--ref-azul-osc);
  color: var(--ref-blanco);
  transform: translateY(-1px);
  box-shadow: 0 14px 26px -10px rgba(25, 118, 210, .7);
}

/* Botón "Ver historial" */
.ref-card .seccion-historial {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 14px;
}
.ref-card #btnVerHistorial {
  width: auto;
  margin: 0;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--ref-blanco);
  border: 1px solid var(--ref-azul-borde);
  color: var(--ref-azul);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .1px;
  text-transform: none;
  box-shadow: none;
  opacity: 1;
  animation: refEntrada .35s ease both;
}
.ref-card #btnVerHistorial::after { display: none; }
.ref-card #btnVerHistorial:hover {
  background: var(--ref-azul-claro);
  color: var(--ref-azul);
  transform: none;
  box-shadow: none;
}

/* =========================================================
   PASOS
   ========================================================= */
.ref-pasos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.ref-paso {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 18px;
  background: var(--ref-blanco);
  border: 1px solid var(--ref-linea);
  box-shadow: var(--ref-sombra-sm);
  text-align: left;
}
.ref-num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--ref-azul-claro);
  color: var(--ref-azul);
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 700;
  font-size: 14px;
}
.ref-paso strong {
  display: block;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 14px;
  color: var(--ref-tinta);
  line-height: 1.3;
}
.ref-paso p {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ref-gris);
}

.ref-ayuda-extra {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--ref-gris);
}
.ref-ayuda-extra a {
  color: var(--ref-azul);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.ref-ayuda-extra a:hover { text-decoration: underline; }

/* =========================================================
   NOTIFICACIÓN "Referencia copiada"
   ========================================================= */
body .notificacion {
  background: var(--ref-azul) !important;
  border: 0 !important;
  border-radius: 12px !important;
  box-shadow: 0 14px 30px -12px rgba(11, 37, 64, .5) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* =========================================================
   MODALES (Historial e Información)
   ========================================================= */

/* Fondo oscuro */
body .modal-backdrop {
  background-color: #0b2540 !important;
  background-image: none !important;
  animation: none !important;
}
body .modal-backdrop.show { opacity: .45 !important; }

/* Entrada suave */
.modal.fade .modal-dialog {
  transform: translateY(14px) scale(.98);
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
}
.modal.show .modal-dialog {
  transform: none;
  opacity: 1;
}

/* Contenedor */
.modal .modal-content,
.modal .historial-modal-content,
.modal .info-modal-content {
  background: var(--ref-blanco);
  color: var(--ref-tinta);
  text-align: left;
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 70px -24px rgba(11, 37, 64, .45);
  animation: none;
}

/* Botones globales dentro de modales */
.modal button { margin-top: 0; }

/* ---------- Encabezados ---------- */
.modal .historial-header,
.modal .info-modal-header {
  position: relative;
  background: var(--ref-blanco);
  color: var(--ref-tinta);
  padding: 20px 64px 18px 22px;
  border-bottom: 1px solid var(--ref-linea);
}
.modal .historial-header::before,
.modal .info-modal-header::before { display: none; }

.modal .historial-title-container,
.modal .info-modal-header .header-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 0;
}

.modal .historial-icon,
.modal .info-header-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--ref-azul-claro);
  color: var(--ref-azul);
  font-size: 19px;
  filter: none;
  animation: none;
}

.modal .historial-header .modal-title,
.modal .info-modal-header .modal-title {
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ref-tinta);
  text-align: left;
  text-shadow: none;
  animation: none;
}

/* Botón cerrar (historial) */
.modal .historial-header .btn-close {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 34px;
  height: 34px;
  margin: -17px 0 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #f1f5f9;
  opacity: 1;
  box-shadow: none;
  transform: none;
}
.modal .historial-header .btn-close::before,
.modal .historial-header .btn-close::after {
  width: 14px;
  height: 2px;
  background-color: var(--ref-gris);
  box-shadow: none;
}
.modal .historial-header .btn-close:hover {
  background: #e4ebf2;
  transform: none;
  box-shadow: none;
}
.modal .historial-header .btn-close:hover::before,
.modal .historial-header .btn-close:hover::after {
  background-color: var(--ref-tinta);
  box-shadow: none;
}

/* Botón cerrar (información) */
.modal .custom-close-btn {
  top: 50% !important;
  right: 18px !important;
  width: 34px !important;
  height: 34px !important;
  margin-top: -17px !important;
  border-radius: 10px;
  background: #f1f5f9;
}
.modal .custom-close-btn:hover {
  background: #e4ebf2;
  transform: none;
}
.modal .close-icon { width: 14px; height: 14px; }
.modal .close-icon::before,
.modal .close-icon::after { background-color: var(--ref-gris); }
.modal .custom-close-btn:hover .close-icon::before,
.modal .custom-close-btn:hover .close-icon::after {
  background-color: var(--ref-tinta);
  box-shadow: none;
}

/* ---------- Historial: cuerpo ---------- */
.modal .historial-body {
  padding: 20px 22px;
  background: var(--ref-blanco);
  background-image: none;
}
.modal .historial-body::after { display: none; }

.modal .historial-intro {
  margin: 0 0 12px;
  padding: 0;
  text-align: left;
  font-size: 14px;
  font-weight: 400;
  color: var(--ref-gris);
  animation: none;
}
.modal .historial-intro p { margin: 0; }

.modal .historial-counter {
  display: inline-flex;
  align-items: center;
  width: auto;
  margin: 0 0 14px;
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--ref-azul-claro);
  box-shadow: none;
  color: var(--ref-azul);
  font-size: 12.5px;
  font-weight: 600;
  animation: none;
}
.modal .historial-counter #historial-count {
  padding: 0 4px 0 0;
  font-size: inherit;
  color: var(--ref-azul);
}
.modal .historial-counter #historial-count::after { display: none; }

.modal .historial-container {
  max-height: 300px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  animation: none;
}
.modal .historial-container::-webkit-scrollbar { width: 6px; }
.modal .historial-container::-webkit-scrollbar-track { background: transparent; }
.modal .historial-container::-webkit-scrollbar-thumb {
  background: #d3deea;
  border: 0;
  border-radius: 10px;
}

.modal .historial-items { gap: 8px; }

.modal .historial-item {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--ref-linea);
  border-radius: 12px;
  background: var(--ref-blanco);
  box-shadow: none;
  color: var(--ref-tinta);
  font-family: 'Consolas', 'SF Mono', 'Roboto Mono', monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
}
.modal .historial-item::before {
  color: var(--ref-gris-claro);
  margin-right: 12px;
  font-size: .95em;
}
.modal .historial-item::after { display: none; }
.modal .historial-item:hover {
  background: var(--ref-fondo);
  border-color: var(--ref-azul-borde);
  box-shadow: none;
  transform: none !important;
}
.modal .historial-item:hover::before { color: var(--ref-azul); transform: none; }

.modal .historial-empty { text-align: center; color: var(--ref-gris); }
.modal .historial-empty i {
  color: var(--ref-gris-claro);
  font-size: 2.4em;
  opacity: .5;
  animation: none;
}
.modal .historial-empty p { color: var(--ref-gris); font-size: 14.5px; }

/* ---------- Pies de modal ---------- */
.modal .historial-footer,
.modal .info-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  background: var(--ref-blanco);
  border-top: 1px solid var(--ref-linea);
}
.modal .historial-footer { justify-content: space-between; }
.modal .historial-footer::before { display: none; }

.modal .btn-borrar-historial {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid #f1d0d0;
  border-radius: 12px;
  background: var(--ref-blanco);
  color: #c62828;
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
}
.modal .btn-borrar-historial::before { display: none; }
.modal .btn-borrar-historial i { animation: none; }
.modal .btn-borrar-historial:hover {
  background: #fdf3f3;
  border-color: #eab7b7;
  color: #b71c1c;
  transform: none;
  box-shadow: none;
}

.modal .btn-secondary,
.modal .btn-outline-secondary {
  margin: 0;
  padding: 10px 18px;
  border: 1px solid var(--ref-linea);
  border-radius: 12px;
  background: #f1f5f9;
  color: var(--ref-tinta);
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
}
.modal .btn-secondary::before { display: none; }
.modal .btn-secondary:hover,
.modal .btn-outline-secondary:hover {
  background: #e4ebf2;
  border-color: #d6e0ea;
  color: var(--ref-tinta);
  transform: none;
  box-shadow: none;
}

.modal .info-understood-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--ref-azul);
  color: var(--ref-blanco);
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
  animation: none;
}
.modal .info-understood-btn::before,
.modal .info-understood-btn::after { display: none; }
.modal .info-understood-btn:hover {
  background: var(--ref-azul-osc);
  color: var(--ref-blanco);
  transform: none;
  box-shadow: none;
  text-shadow: none;
}
.modal .info-understood-btn i { font-size: 16px; }

/* ---------- Información: pestañas ---------- */
.modal .info-modal-body {
  padding: 0;
  background: var(--ref-blanco);
}

.modal .info-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 22px 0;
  background: var(--ref-blanco);
  border-bottom: 1px solid var(--ref-linea);
}
.modal .info-tabs .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 -1px;
  padding: 12px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ref-gris);
  font-size: 14px;
  font-weight: 600;
  transition: color .2s ease, border-color .2s ease;
}
.modal .info-tabs .nav-link i { font-size: 16px; }
.modal .info-tabs .nav-link:hover,
.modal .info-tabs .nav-link:hover:not(.active) {
  background: transparent;
  color: var(--ref-azul);
}
.modal .info-tabs .nav-link.active {
  background: transparent;
  color: var(--ref-azul);
  border-bottom-color: var(--ref-azul);
}

.modal .info-tab-content { padding: 22px; }

/* Tarjetas */
.modal .info-card {
  height: 100%;
  border: 1px solid var(--ref-linea);
  border-radius: 16px;
  background: var(--ref-blanco);
  box-shadow: none;
}
.modal .info-card:hover { transform: none; box-shadow: none; }

.modal .info-card-header {
  padding: 18px 18px 0;
  background: transparent;
  border-bottom: 0;
}
.modal .info-step {
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ref-azul-claro);
  color: var(--ref-azul);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .9px;
}
.modal .info-card-header h6 {
  margin: 0;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--ref-tinta);
}

.modal .info-card-body { padding: 12px 18px 18px; }
.modal .info-card-body p {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ref-gris);
}

.modal .info-tip {
  gap: 10px;
  margin-top: 8px;
  padding: 11px 13px;
  border: 1px solid var(--ref-azul-borde);
  border-left: 1px solid var(--ref-azul-borde);
  border-radius: 12px;
  background: var(--ref-fondo);
}
.modal .info-tip i { color: var(--ref-azul); font-size: 16px; }
.modal .info-tip span { color: #33475b; font-size: 13.5px; line-height: 1.5; }

.modal .info-list li {
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 9px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ref-gris);
}
.modal .info-list li i { margin-top: 3px; color: var(--ref-azul); font-size: 14px; }

/* Imágenes */
.modal .image-highlight {
  padding: 8px;
  border: 1px solid var(--ref-linea);
  border-radius: 16px;
  background: var(--ref-blanco);
  box-shadow: none;
}
.modal .image-highlight:hover { transform: none; box-shadow: var(--ref-sombra-sm); }
.modal .info-image { border: 0; border-radius: 10px; }

.modal .zoom-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--ref-linea);
  border-radius: 10px;
  background: var(--ref-blanco);
  color: var(--ref-azul);
  font-size: 16px;
  box-shadow: var(--ref-sombra-sm);
}
.modal .zoom-button:hover {
  background: var(--ref-azul);
  border-color: var(--ref-azul);
  color: var(--ref-blanco);
  transform: none;
}

/* Información adicional */
.modal .info-additional {
  margin-top: 0;
  padding: 0 22px 22px;
}
.modal .info-divider { margin-bottom: 16px; }
.modal .info-divider::before { background-color: var(--ref-linea); }
.modal .info-divider span {
  padding: 0 12px;
  background-color: var(--ref-blanco);
  color: var(--ref-gris-claro);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1px;
}

.modal .info-tip-box {
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--ref-linea);
  border-radius: 16px;
  background: var(--ref-blanco);
  box-shadow: none;
}
.modal .info-tip-box:hover { transform: none; box-shadow: none; }
.modal .tip-icon,
.modal .info-tip-box:nth-child(1) .tip-icon,
.modal .info-tip-box:nth-child(2) .tip-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--ref-azul-claro);
  color: var(--ref-azul);
  font-size: 18px;
}
.modal .tip-content h6 {
  margin: 0 0 6px;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ref-tinta);
}
.modal .tip-content p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ref-gris);
}
.modal .tip-content strong { color: var(--ref-azul); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
  .ref-pasos { grid-template-columns: 1fr; }

  /* Pestañas como botones en 2 columnas */
  .modal .info-modal-body .info-tabs {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 14px 16px;
  }
  .modal .info-modal-body .info-tabs .nav-link {
    width: 100%;
    max-width: none;
    min-height: 44px;
    margin: 0;
    padding: 8px 6px;
    flex-direction: row;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--ref-linea);
    border-radius: 10px;
    font-size: 12.5px;
  }
  .modal .info-modal-body .info-tabs .nav-link.active {
    background: var(--ref-azul-claro);
    border-color: var(--ref-azul-borde);
    color: var(--ref-azul);
  }
  .modal .info-tab-content { padding: 16px; }
  .modal .info-additional { padding: 0 16px 16px; }
  .modal .image-highlight { margin-top: 14px; }
}

@media (max-width: 576px) {
  /* Hero */
  .ref-hero { --banda-extra: 110px; padding: 18px 8px 0; }
  .ref-hero::after { height: 44px; }
  .ref-pill { font-size: 12px; padding: 5px 12px; }
  .ref-titulo { font-size: 29px; margin: 0 auto 10px; }
  .ref-bajada { font-size: 14.5px; max-width: 34ch; }
  .ref-orbes span:nth-child(1) { width: 60px; height: 60px; left: -18px; top: 20px; }
  .ref-orbes span:nth-child(2) { width: 32px; height: 32px; right: 2px; top: 40px; }
  .ref-orbes span:nth-child(3) { display: none; }

  /* Tarjeta */
  .ref-main { margin-top: 22px; padding: 0 2px; }
  .ref-card { padding: 20px 16px 18px; border-radius: 20px; }
  .ref-card-head { align-items: flex-start; }
  .ref-card #predio { height: 54px; font-size: 20px; padding: 0 44px 0 46px; }
  .ref-card #predio::placeholder { font-size: 17px; }
  .ref-card .ref-buscador .icono-busqueda { left: 16px; }
  .ref-card .ref-btn-buscar { height: 52px; font-size: 15px; }
  .ref-card .ref-btn-limpiar { flex-basis: 52px; width: 52px; height: 52px; }
  .ref-meta { gap: 6px 14px; font-size: 12px; }

  /* Resultado: etiqueta arriba, valor abajo, alineados con el ícono */
  .ref-card #resultado { padding: 18px 14px 16px; }
  .ref-card #resultado .etiqueta { display: inline-block; margin-bottom: 2px; }
  .ref-card #resultado .valor { display: block; padding-left: 28px; }
  .ref-card #resultado #referencia-valor { display: inline-block; margin-left: 28px; padding: 7px 12px; letter-spacing: 1.5px; }
  .ref-card #resultado > div[style*="margin-left: 25px"] { margin-left: 28px !important; }

  /* Pasos */
  .ref-pasos { margin-top: 16px; gap: 10px; }
  .ref-paso { padding: 14px; }

  .modal .modal-dialog { margin: 12px; }
  .modal .historial-header,
  .modal .info-modal-header { padding: 16px 58px 14px 16px; }
  .modal .historial-header .modal-title,
  .modal .info-modal-header .modal-title { font-size: 15.5px; }
  .modal .historial-body { padding: 16px; }
  .modal .historial-footer,
  .modal .info-modal-footer {
    flex-direction: column-reverse;
    padding: 12px 16px;
  }
  .modal .btn-borrar-historial,
  .modal .btn-secondary,
  .modal .btn-outline-secondary,
  .modal .info-understood-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Menos movimiento */
@media (prefers-reduced-motion: reduce) {
  .ref-card #resultado,
  .ref-card #btnVerHistorial,
  .modal.fade .modal-dialog { animation: none !important; transition: none !important; }
}

/* =========================================================
   ARREGLOS GENERALES DE LA PÁGINA
   ========================================================= */
/* Tu CSS le pone padding a html y body en celular; eso deja
   orillas de color alrededor del header y del footer. */
html, body { padding: 0; }

/* El menú del celular está escondido fuera de la pantalla a la
   derecha y eso permitía arrastrar la página hacia un lado. */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
@supports (overflow-x: clip) {
  html, body { overflow-x: clip; }
}

/* Como ya no hay padding en body, la sección necesita su propio margen */
@media (max-width: 576px) {
  .ref-hero { padding-left: 16px; padding-right: 16px; }
  .ref-main { padding-left: 14px; padding-right: 14px; }
}

/* =========================================================
   DECORACIÓN DE FONDO: recibos e íconos de pago
   (solo visual, no se puede seleccionar ni hacer clic)
   ========================================================= */
.ref-main {
  position: relative;
  isolation: isolate;
}

.ref-deco {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1500px;
  margin-left: -750px;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

/* Íconos sueltos */
.ref-ico {
  position: absolute;
  color: var(--ref-azul);
  opacity: .13;
  line-height: 1;
  animation: refFlota 9s ease-in-out infinite;
}
.ref-ico.i1  { top: 150px;    left: calc(50% - 600px); font-size: 40px; --rot: -12deg; }
.ref-ico.i2  { top: 340px;    left: calc(50% - 420px); font-size: 28px; --rot: 8deg;  animation-delay: -2s; }
.ref-ico.i3  { bottom: 30px;  left: calc(50% - 610px); font-size: 36px; --rot: -6deg; animation-delay: -4s; }
.ref-ico.i4  { bottom: 34px;  left: calc(50% - 470px); font-size: 30px; --rot: 10deg; animation-delay: -6s; }
.ref-ico.i5  { top: 300px;    left: calc(50% - 630px); font-size: 26px; --rot: -4deg; animation-delay: -1s; }
.ref-ico.i6  { top: 145px;    left: calc(50% + 420px); font-size: 32px; --rot: 10deg; animation-delay: -3s; }
.ref-ico.i7  { top: 150px;    left: calc(50% + 580px); font-size: 42px; --rot: -8deg; animation-delay: -5s; }
.ref-ico.i8  { top: 270px;    left: calc(50% + 570px); font-size: 28px; --rot: 6deg;  animation-delay: -7s; }
.ref-ico.i9  { bottom: 40px;  left: calc(50% + 590px); font-size: 36px; --rot: -10deg; animation-delay: -2.5s; }
.ref-ico.i10 { bottom: 24px;  left: calc(50% + 440px); font-size: 28px; --rot: 4deg;  animation-delay: -4.5s; }

@keyframes refFlota {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50%      { transform: translateY(-10px) rotate(var(--rot, 0deg)); }
}

/* Mini recibos ilustrados */
.ref-recibo {
  position: absolute;
  width: 128px;
  padding: 14px 14px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--ref-blanco);
  border-radius: 10px 10px 0 0;
  opacity: .75;
  filter: drop-shadow(0 12px 18px rgba(11, 37, 64, .12));
  /* orilla de abajo en zigzag, como recibo cortado */
  -webkit-mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - 8px) no-repeat,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 8px repeat-x;
          mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - 8px) no-repeat,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 8px repeat-x;
  animation: refFlota 11s ease-in-out infinite;
}
.ref-recibo.r1 { top: 175px; left: calc(50% - 490px); --rot: -8deg; }
.ref-recibo.r2 { top: 205px; left: calc(50% + 400px); --rot: 7deg; width: 116px; animation-delay: -5s; }

.rr-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--ref-azul-borde);
}
.rr-head i { color: var(--ref-azul); font-size: 15px; }
.rr-bar {
  flex: 1;
  height: 7px;
  border-radius: 4px;
  background: var(--ref-azul);
  opacity: .8;
}
.rr-line {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: #e3ebf3;
}
.rr-line.corta { width: 60%; }
.rr-code {
  display: block;
  height: 26px;
  margin-top: 4px;
  background: repeating-linear-gradient(90deg,
    var(--ref-tinta) 0 2px, transparent 2px 4px,
    var(--ref-tinta) 4px 5px, transparent 5px 7px,
    var(--ref-tinta) 7px 10px, transparent 10px 12px);
  opacity: .75;
  border-radius: 2px;
}
.rr-num {
  display: block;
  width: 70%;
  height: 7px;
  border-radius: 4px;
  background: var(--ref-azul-claro);
  border: 1px solid var(--ref-azul-borde);
}

/* Íconos blancos dentro de la banda azul */
.ref-ico-banda {
  position: absolute;
  color: #fff;
  opacity: .14;
  line-height: 1;
  animation: refFlota 10s ease-in-out infinite;
}
.ref-ico-banda.b1 { top: 20px;  left: 4%;   font-size: 42px; --rot: -12deg; }
.ref-ico-banda.b2 { top: 180px; left: 12%;  font-size: 30px; --rot: 8deg;  animation-delay: -3s; }
.ref-ico-banda.b3 { top: 30px;  right: 10%; font-size: 34px; --rot: 10deg; animation-delay: -6s; }
.ref-ico-banda.b4 { top: 200px; right: 3%;  font-size: 40px; --rot: -6deg; animation-delay: -2s; }

/* En pantallas angostas no hay espacio a los lados de la tarjeta */
@media (max-width: 960px) {
  .ref-deco { display: none; }
}
@media (max-width: 576px) {
  .ref-ico-banda { opacity: .12; }
  .ref-ico-banda.b1 { top: 8px;   left: 2%;  font-size: 28px; }
  .ref-ico-banda.b2 { top: 230px; left: 4%;  font-size: 22px; }
  .ref-ico-banda.b3 { top: 6px;   right: 4%; font-size: 24px; }
  .ref-ico-banda.b4 { top: 236px; right: 4%; font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .ref-ico, .ref-recibo, .ref-ico-banda { animation: none; transform: rotate(var(--rot, 0deg)); }
}

/* =========================================================
   PRIVACIDAD
   ========================================================= */
.ref-privacidad-nota {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--ref-azul-claro);
  border: 1px solid var(--ref-azul-borde);
  text-align: left;
}
.ref-privacidad-nota i {
  flex: 0 0 auto;
  margin-top: 1px;
  font-size: 18px;
  color: var(--ref-azul);
}
.ref-privacidad-nota p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #0d4f8b;
}
.ref-privacidad-nota strong { color: var(--ref-azul-osc); }

.ref-privacidad {
  margin-top: 14px;
  background: var(--ref-blanco);
  border: 1px solid var(--ref-linea);
  border-radius: 16px;
  box-shadow: var(--ref-sombra-sm);
  text-align: left;
  overflow: hidden;
}
.ref-privacidad summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--ref-tinta);
  user-select: none;
}
.ref-privacidad summary::-webkit-details-marker { display: none; }
.ref-privacidad summary span { display: inline-flex; align-items: center; gap: 8px; }
.ref-privacidad summary span i { color: var(--ref-azul); font-size: 16px; }
.ref-privacidad summary:hover { background: var(--ref-fondo); }
.ref-privacidad-flecha {
  color: var(--ref-gris-claro);
  font-size: 14px;
  transition: transform .25s ease;
}
.ref-privacidad[open] .ref-privacidad-flecha { transform: rotate(180deg); }
.ref-privacidad-texto {
  padding: 2px 18px 16px;
  border-top: 1px solid var(--ref-linea);
}
.ref-privacidad-texto p {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ref-gris);
}
.ref-privacidad-texto strong { color: var(--ref-tinta); }
/* =========================================================
   HEADER QUE SIGUE: más fluido
   ========================================================= */
.capas-header.sticky {
  animation: none;
  will-change: transform;
}
.capas-bubble {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}