/* Estilo inspirado en la identidad visual de Ipsos (ipsos.com) */

.hidden { display: none !important; }

:root {
  --navy: #121B5A;        /* azul marino Ipsos */
  --navy-90: rgba(18, 27, 90, 0.9);
  --navy-70: rgba(18, 27, 90, 0.7);
  --teal: #14A19E;        /* turquesa Ipsos */
  --teal-light: #1DAFAD;
  --teal-dark: #0F8481;
  --blue: #2F469C;
  --bg: #F4F6FA;
  --card: #FFFFFF;
  --line: #DDE2EE;
  --text: #121B5A;
  --muted: #5B6386;
  --danger: #C62828;

  --font-head: "Barlow Semi Condensed", "Roboto Condensed", Arial, Helvetica, sans-serif;
  --font-body: "Barlow", "Barlow Semi Condensed", Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

h1, h2, .brand-title, .zona-nombre, .detalle-direccion {
  font-family: var(--font-head);
}

/* ---------- Encabezado ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.site-header-inner {
  max-width: 760px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); min-width: 0; }
.brand-mark {
  flex: none;
  display: inline-flex; align-items: flex-end; justify-content: flex-start;
  width: 40px; height: 40px; padding: 0 0 4px 5px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--navy) 55%, var(--teal) 100%);
  color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 13px; letter-spacing: .01em;
  border-radius: 4px;
}
.brand-title {
  font-weight: 700; font-size: 17px; text-transform: uppercase; letter-spacing: .03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.logout {
  color: var(--navy); font-family: var(--font-head); font-weight: 600; font-size: 14px;
  text-transform: uppercase; letter-spacing: .05em; text-decoration: none;
  padding: 8px 12px; border: 1px solid var(--line);
}
.logout:hover { border-color: var(--teal); color: var(--teal-dark); }

/* ---------- Franja de título (como los banners de ipsos.com) ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--navy);
  color: #fff;
}
.hero::after {
  /* triángulo turquesa en la esquina, como el sitio de Ipsos */
  content: ""; position: absolute; right: 0; bottom: 0;
  width: 90px; height: 90px;
  background: linear-gradient(135deg, transparent 50%, var(--teal) 50%);
}
.hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 28px 20px 30px; }
.hero h1 { margin: 0; font-size: 34px; font-weight: 700; line-height: 1.1; }
.hero p { margin: 6px 0 0; color: rgba(255, 255, 255, 0.8); font-size: 16px; padding-right: 70px; }

/* Volver y botones de navegación dentro de la franja (pantalla de detalle) */
.hero-back {
  display: inline-block; margin: -6px 0 10px; padding: 6px 0;
  background: none; border: none; cursor: pointer; color: #fff;
  font-family: var(--font-head); font-weight: 700; font-size: 15px;
  text-transform: uppercase; letter-spacing: .06em;
}
.hero-back:hover { color: var(--teal-light); }
.hero-back:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 2px; }
.hero-nav {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px;
  margin-top: 16px; max-width: 460px; padding-right: 40px;
}
.hero-nav a { width: 100%; }
.hero-btn-outline {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: 15px;
  text-transform: uppercase; letter-spacing: .06em; text-decoration: none;
  padding: 13px 18px; color: #fff; border: 2px solid #fff; background: transparent;
}
.hero-btn-outline:hover { background: #fff; color: var(--navy); }
.hero-btn-outline:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 2px; }

/* ---------- Contenido ---------- */
.container { max-width: 760px; margin: 0 auto; padding: 24px 20px 40px; }

input[type=text], input[type=password], input[type=search] {
  width: 100%;
  background: #fff; border: 1px solid var(--line); border-bottom: 2px solid var(--navy);
  color: var(--text); font: inherit; font-size: 17px;
  padding: 13px 14px; border-radius: 0; outline: none;
  -webkit-appearance: none; appearance: none;
}
input:focus { border-bottom-color: var(--teal); box-shadow: 0 2px 0 0 var(--teal); }
input::placeholder { color: #9AA0BC; }

button { font: inherit; }
.primary, .secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-head); font-weight: 700; font-size: 15px;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 13px 18px; border-radius: 0; cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.primary { background: var(--teal); color: #fff; border: 2px solid var(--teal); }
.primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.secondary { background: #fff; color: var(--navy); border: 2px solid var(--navy); white-space: nowrap; }
.secondary:hover { background: var(--navy); color: #fff; }
.secondary:disabled { opacity: .6; cursor: wait; }
.primary:focus-visible, .secondary:focus-visible, .zona-btn:focus-visible, .result-item:focus-visible, .link-back:focus-visible {
  outline: 3px solid var(--teal-light); outline-offset: 2px;
}

.link-back {
  background: none; border: none; padding: 4px 0; cursor: pointer;
  color: var(--teal-dark); font-family: var(--font-head); font-weight: 700; font-size: 15px;
  text-transform: uppercase; letter-spacing: .05em;
}
.link-back:hover { color: var(--navy); }

/* ---------- Login ---------- */
.login-form { display: grid; gap: 16px; max-width: 380px; }
.login-form label {
  display: grid; gap: 8px;
  font-family: var(--font-head); font-weight: 600; font-size: 14px;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}

/* ---------- Avisos ---------- */
.flash {
  margin-bottom: 16px; padding: 12px 14px; font-size: 15px;
  background: #E7F6F5; border-left: 4px solid var(--teal); color: var(--navy);
}
.flash.error { background: #FDECEC; border-left-color: var(--danger); color: #7A1414; }

/* ---------- Paso 1: zonas ---------- */
.zonas { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.zona-btn {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--navy);
  color: var(--navy); padding: 20px 18px 22px; cursor: pointer; text-align: left;
  border-radius: 0; box-shadow: 0 1px 2px rgba(18, 27, 90, 0.06);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.zona-btn::after {
  content: "\2192"; position: absolute; right: 16px; bottom: 16px;
  font-size: 20px; color: var(--teal); transition: transform .15s;
}
.zona-btn:hover { border-top-color: var(--teal); box-shadow: 0 6px 18px rgba(18, 27, 90, 0.12); }
.zona-btn:hover::after { transform: translateX(4px); }
.zona-nombre { font-size: 24px; font-weight: 700; line-height: 1.1; }
.zona-total { font-size: 14px; color: var(--muted); }

/* ---------- Paso 2: búsqueda ---------- */
.paso-header { margin-bottom: 14px; }
.buscador { display: flex; gap: 10px; margin-bottom: 10px; }
.contador {
  font-family: var(--font-head); font-size: 14px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; min-height: 20px; margin: 4px 0 8px;
}

.results { background: #fff; border: 1px solid var(--line); min-height: 60px; }
.result-item {
  display: flex; flex-direction: column; gap: 3px; width: 100%;
  background: none; border: none; border-left: 4px solid transparent;
  color: var(--navy); text-align: left; padding: 13px 16px; cursor: pointer;
}
.result-item + .result-item { border-top: 1px solid var(--line); }
.result-item:hover { background: #F0F8F8; border-left-color: var(--teal); }
.result-dir { font-size: 16px; font-weight: 600; }
.result-id { color: var(--muted); font-size: 13px; }
.result-empty { padding: 14px 16px; color: var(--muted); }
#btnMas { margin-top: 12px; width: 100%; }

/* ---------- Paso 3: detalle ---------- */
.detalle-card {
  background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--teal);
  padding: 14px 18px 16px; margin-bottom: 14px; display: grid; gap: 2px;
}
.detalle-label {
  font-family: var(--font-head); font-weight: 600; font-size: 13px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; margin-top: 14px;
}
.detalle-label:first-child { margin-top: 0; }
.detalle-direccion { font-size: 28px; font-weight: 700; line-height: 1.1; color: var(--navy); }
.detalle-localidad { font-size: 15px; color: var(--muted); }
.detalle-id-row { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.detalle-id-row .detalle-label { margin: 0; }
.detalle-id {
  font-family: var(--font-head); font-size: 24px; font-weight: 700; color: var(--teal-dark);
  font-variant-numeric: tabular-nums;
}

/* Mapa y navegación */
.mapa-wrap {
  position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: 420px;
  overflow: hidden; border: 1px solid var(--line); background: #E9ECF4;
}
.mapa-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mapa-nota { font-size: 13px; color: var(--muted); margin: 8px 0 16px; }

/* ---------- Móvil ---------- */
@media (max-width: 640px) {
  .site-header-inner { padding: 8px 16px; }
  .brand-mark { width: 34px; height: 34px; font-size: 11px; }
  .brand-title { font-size: 15px; }
  .hero-inner { padding: 22px 16px 24px; }
  .hero h1 { font-size: 28px; }
  .hero::after { width: 60px; height: 60px; }
  .hero p { padding-right: 40px; font-size: 15px; }
  .container { padding: 18px 16px 32px; }
  .zonas { grid-template-columns: 1fr 1fr; gap: 10px; }
  .zona-btn { padding: 16px 14px 34px; }
  .zona-nombre { font-size: 21px; }
  .zona-btn::after { right: 12px; bottom: 10px; }
  .buscador { flex-direction: column; }
  .buscador .secondary { width: 100%; }
  .hero-nav { padding-right: 56px; }
  .detalle-direccion { font-size: 24px; }
}
