/* ── Loader compartido de los reportes — copiado del visor GeoPerú ──
   Overlay a pantalla completa con la marca GEOPERÚ en wireframe animado.
   El JS de cada reporte muestra/oculta #spinner con el atributo hidden. */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(17, 24, 39, 0.55);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.loader[hidden] {
  display: none;
}

.loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loader-mtn {
  width: 220px;
  height: 120px;
  overflow: visible;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.28));
}

.loader-mtn path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  animation: loaderDraw 3.4s ease-in-out infinite;
}

.loader-mtn path:nth-child(1) { animation-delay: 0s; }
.loader-mtn path:nth-child(2) { animation-delay: 0.05s; }
.loader-mtn path:nth-child(3) { animation-delay: 0.10s; }
.loader-mtn path:nth-child(4) { animation-delay: 0.15s; }
.loader-mtn path:nth-child(5) { animation-delay: 0.20s; }
.loader-mtn path:nth-child(6) { animation-delay: 0.25s; }
.loader-mtn path:nth-child(7) { animation-delay: 0.30s; }
.loader-mtn path:nth-child(8) { animation-delay: 0.35s; }
.loader-mtn path:nth-child(9) { animation-delay: 0.40s; }
.loader-mtn path:nth-child(10) { animation-delay: 0.45s; }
.loader-mtn path:nth-child(11) { animation-delay: 0.50s; }
.loader-mtn path:nth-child(12) { animation-delay: 0.55s; }
.loader-mtn path:nth-child(13) { animation-delay: 0.60s; }
.loader-mtn path:nth-child(14) { animation-delay: 0.65s; }
.loader-mtn path:nth-child(15) { animation-delay: 0.70s; }
.loader-mtn path:nth-child(16) { animation-delay: 0.75s; }
.loader-mtn path:nth-child(17) { animation-delay: 0.80s; }

@keyframes loaderDraw {
  0%   { stroke-dashoffset: 1; opacity: 0; }
  12%  { opacity: 0.92; }
  50%  { stroke-dashoffset: 0; opacity: 0.92; }
  78%  { stroke-dashoffset: 0; opacity: 0.92; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

.loader-text {
  color: #fff;
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.loader-dots::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: loaderDots 1.4s steps(1, end) infinite;
}

@keyframes loaderDots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
  100% { content: ""; }
}

@media (prefers-reduced-motion: reduce) {
  .loader {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .loader-mtn path {
    animation: none;
    opacity: 0.92;
    stroke-dashoffset: 0;
  }
  .loader-dots::after {
    animation: none;
    content: "…";
  }
}

@media print {
  .loader { display: none !important; }
}
