/* ==============================================================
   Pantalla de carga (index.html, antes de que arranque Angular).
   La misma hoja azul con cuadrícula que la cabecera y el acceso;
   el símbolo se dibuja trazo a trazo (cabeza, cuerpo, cinta), se
   rellena y respira mientras llega la aplicación.
   ============================================================== */

.op-carga {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  color: #fff;
  background-color: #264259;
  background-image: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 55%),
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 100% 100%, 14px 14px, 14px 14px;
  background-position: center top;
  font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* el símbolo: cada parte se dibuja con trazo y luego se rellena */
.op-carga-marca {
  width: 112px;
  height: 112px;
  overflow: visible;
  animation: op-carga-respira 2.6s ease-in-out 2.4s infinite alternate;
}
.op-carga-marca path {
  fill: #fff;
  fill-opacity: 0;
  stroke: #fff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: op-carga-traza 1.1s cubic-bezier(0.65, 0, 0.35, 1) forwards, op-carga-rellena 0.6s ease-out forwards;
}
/* de arriba abajo: cabeza, cuerpo, cinta */
.op-carga-marca .op-carga-cabeza {
  animation-delay: 0.15s, 1.15s;
}
.op-carga-marca .op-carga-cuerpo {
  animation-delay: 0.5s, 1.5s;
}
.op-carga-marca .op-carga-cinta {
  animation-delay: 0.85s, 1.85s;
}

.op-carga-nombre {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-indent: 0.28em; /* compensa el espaciado de la última letra para centrar de verdad */
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  opacity: 0;
  animation: op-carga-aparece 0.8s ease-out 1.9s forwards;
}

/* línea de espera indeterminada: fina, discreta, siempre en marcha */
.op-carga-linea {
  position: relative;
  width: 112px;
  height: 2px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
  opacity: 0;
  animation: op-carga-aparece 0.8s ease-out 2.2s forwards;
}
.op-carga-linea::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.75);
  animation: op-carga-avanza 1.6s cubic-bezier(0.4, 0, 0.2, 1) 2.2s infinite;
}

/* aviso si la aplicación no llega (lo enseña el script de index.html a los 8 s) */
.op-carga-aviso {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 28px;
  margin: 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.62);
}
.op-carga-aviso a {
  color: #fff;
}

@keyframes op-carga-traza {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes op-carga-rellena {
  to {
    fill-opacity: 1;
    stroke-width: 0;
  }
}
@keyframes op-carga-aparece {
  to {
    opacity: 1;
  }
}
@keyframes op-carga-respira {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.045);
  }
}
@keyframes op-carga-avanza {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(250%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .op-carga-marca,
  .op-carga-marca path,
  .op-carga-nombre,
  .op-carga-linea,
  .op-carga-linea::after {
    animation: none;
  }
  .op-carga-marca path {
    fill-opacity: 1;
    stroke-width: 0;
  }
  .op-carga-nombre,
  .op-carga-linea {
    opacity: 1;
  }
}
