/* Pantalla de carga inicial: logo Bovitrack con entrada suave, respiración, halo y destello. */

.app-loading {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  top: 10em;
}
.app-loading p {
  display: block;
  font-size: 1.17em;
  margin-inline-start: 0;
  margin-inline-end: 0;
  font-weight: normal;
}

.app-loading--splash {
  top: 0;
  margin-top: 20vh;
  gap: 1.75rem;
}

.bovi-loader {
  position: relative;
  width: 170px;
  aspect-ratio: 850 / 750;
  animation:
    bovi-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) both,
    bovi-breathe 3.2s ease-in-out 0.9s infinite;
}

.bovi-glow {
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle, rgba(23, 114, 64, 0.16) 0%, rgba(23, 114, 64, 0) 65%);
  animation: bovi-glow 3.2s ease-in-out infinite;
}

.bovi-logo {
  position: absolute;
  inset: 0;
  background: url('/content/images/bobitrack.svg') center / contain no-repeat;
}

/* Destello que recorre la silueta del logo (el propio SVG hace de máscara). */
.bovi-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0) 62%);
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-mask: url('/content/images/bobitrack.svg') center / contain no-repeat;
  mask: url('/content/images/bobitrack.svg') center / contain no-repeat;
  animation: bovi-shine 3.2s ease-in-out 1.2s infinite;
}

.bovi-wordmark {
  color: #0b5a31;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.45em;
  /* Compensa el letter-spacing sobrante del último carácter para un centrado óptico. */
  text-indent: 0.45em;
  text-transform: uppercase;
  animation: bovi-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

.bovi-dots {
  display: flex;
  gap: 10px;
  animation: bovi-enter 0.9s ease-out 0.55s both;
}
.bovi-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #177240;
  animation: bovi-dot 1.4s ease-in-out infinite;
}
.bovi-dots span:nth-child(2) {
  animation-delay: 0.18s;
}
.bovi-dots span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes bovi-enter {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes bovi-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.045);
  }
}

@keyframes bovi-glow {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes bovi-shine {
  0% {
    background-position: 100% 0;
  }
  55%,
  100% {
    background-position: 0% 0;
  }
}

@keyframes bovi-dot {
  0%,
  55%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  25% {
    opacity: 1;
    transform: translateY(-5px);
  }
}

/* Error irrecuperable: la app no ha llegado a arrancar. */
.bovi-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.5rem;
  text-align: center;
  animation: bovi-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.bovi-error-logo {
  width: 96px;
  aspect-ratio: 850 / 750;
  background: url('/content/images/bobitrack.svg') center / contain no-repeat;
  filter: grayscale(1);
  opacity: 0.4;
}
.bovi-error h1 {
  margin: 0.75rem 0 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: #1f2a25;
}
.bovi-error p {
  margin: 0;
  max-width: 34rem;
  color: #5c6b64;
}
.bovi-error button {
  margin-top: 1rem;
  padding: 0.6rem 2.25rem;
  border: none;
  border-radius: 2rem;
  background: #177240;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.bovi-error button:hover {
  background: #0b5a31;
}

@media (prefers-reduced-motion: reduce) {
  .bovi-loader,
  .bovi-glow,
  .bovi-wordmark,
  .bovi-dots,
  .bovi-dots span,
  .bovi-error {
    animation: none;
  }
  .bovi-shine {
    display: none;
  }
}
