/* Login */
#login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1a4a7a 0%, #1a6abf 60%, #e8920e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-box {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.login-logo {
  width: 130px;
  margin-bottom: 0.4rem;
}

.login-box h2 {
  font-size: 1.1rem;
  color: #1a6abf;
  font-weight: 700;
}

.login-box p {
  font-size: 0.88rem;
  color: #666;
}

.login-box input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 2px solid #dde3ec;
  border-radius: 8px;
  font-size: 1.3rem;
  text-align: center;
  letter-spacing: 0.4rem;
  outline: none;
  transition: border 0.2s;
}

.login-box input:focus {
  border-color: #1a6abf;
}

.login-box button {
  width: 100%;
  padding: 0.7rem;
  background: #1a6abf;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.login-box button:hover {
  background: #e8920e;
}

.login-error {
  color: #d32f2f !important;
  font-size: 0.85rem !important;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --blue:        #1a6abf;
  --blue-dark:   #1458a0;
  --blue-deeper: #1a4a7a;
  --orange:      #e8920e;
  --orange-dark: #d17d08;
  --bg:          #f0f4f8;
  --card:        #ffffff;
  --border:      #d4e0ec;
  --border-sub:  #e8f0f7;
  --text:        #1a2f4a;
  --text-2:      #6a90b0;
  --shadow-sm:   0 1px 4px rgba(26,74,122,.07);
  --shadow-card: 0 6px 24px rgba(26,106,191,.12);
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 10% 0%, rgba(26,106,191,.06) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 100%, rgba(90,180,232,.04) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.95);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(26,74,122,.08);
  backdrop-filter: blur(8px);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.navbar-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.navbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: -.01em;
}

.navbar-sub {
  font-size: 0.75rem;
  color: var(--text-2);
}

.navbar-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue);
  background: rgba(26,106,191,.07);
  border: 1px solid rgba(26,106,191,.18);
  border-radius: 999px;
  padding: 5px 14px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .6; transform: scale(1.25); }
}

/* ── Main ── */
main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

.page-header p {
  font-size: 0.9rem;
  color: var(--text-2);
  margin-top: 4px;
}

/* ── Tarjeta del mapa ── */
.mapa-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  max-width: 70%;
  margin: 0 auto;
}

#mapa-container {
  position: relative;
  display: block;
  width: 100%;
  background: #eef4fb;
}

#mapa-img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  min-height: 320px;
}

/* ── Zonas clicables ── */
.zona {
  position: absolute;
  background: rgba(232,146,14,.22);
  border: 2px solid var(--orange);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, box-shadow .2s, transform .15s;
  box-shadow: 0 0 0 1px rgba(232,146,14,.4);
}

.zona span {
  background: rgba(180,90,0,.88);
  color: #fff;
  font-weight: 700;
  font-size: 0.6rem;
  padding: 5px 12px;
  border-radius: 5px;
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
  letter-spacing: .01em;
}

.zona:hover {
  background: rgba(232,146,14,.38);
  box-shadow: 0 0 0 3px rgba(232,146,14,.35), 0 4px 20px rgba(232,146,14,.3);
  transform: scale(1.04);
}

.zona:active {
  transform: scale(.97);
}


/* ── Grid de chips de áreas ── */
.areas-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.area-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  transition: background .15s, box-shadow .15s, border-color .15s;
  box-shadow: var(--shadow-sm);
}

.area-chip:hover {
  background: rgba(26,106,191,.07);
  border-color: var(--blue);
  box-shadow: 0 2px 10px rgba(26,106,191,.15);
}

.chip-icon {
  font-size: 1.2rem;
  line-height: 1;
}

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(10,20,40,.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  backdrop-filter: blur(6px);
}

.modal.oculto {
  display: none;
}

.modal-contenido {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(10,20,40,.5);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  width: 100%;
  background: var(--blue);
  border-bottom: 3px solid var(--orange);
  gap: 12px;
}

.modal-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-pdf {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--orange);
  color: #fff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  transition: background .2s, transform .15s;
  white-space: nowrap;
}

.btn-pdf:hover {
  background: var(--orange-dark);
  transform: translateY(-1px);
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: .9;
}

.modal-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.01em;
}

.btn-cerrar {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 6px;
  transition: background .2s;
}

.btn-cerrar:hover {
  background: rgba(255,255,255,.28);
}

#modal-video {
  width: 100%;
  max-height: 80vh;
  background: #000;
  display: block;
  object-fit: contain;
}

.video-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 0.6rem 0 0.2rem;
  background: #111;
  width: 100%;
}

.btn-seek {
  background: #1a6abf;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 1.2rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-seek:hover {
  background: #e8920e;
}
