/* Loader animado inspirado en RoggiDev */
.loader-cubes {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #10111b;
  z-index: 99999;
  transition: opacity 0.7s cubic-bezier(.4,2,.6,1);
  overflow: hidden;
}
.loader-cubes-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.loader-cubes-bg .bg-dot {
  position: absolute;
  border-radius: 50%;
  background: #19f9d8;
  opacity: var(--dot-opacity, 0.18);
  animation: bg-dot-move var(--dot-duration, 4s) linear infinite;
}
.loader-cubes-bg .bg-dot.dot-a { left: 10%; top: 20%; width: 12px; height: 12px; --dot-opacity: 0.18; --dot-duration: 4s; animation-delay: 0s; }
.loader-cubes-bg .bg-dot.dot-b { left: 80%; top: 30%; width: 18px; height: 18px; --dot-opacity: 0.13; --dot-duration: 5.2s; animation-delay: 1s; }
.loader-cubes-bg .bg-dot.dot-c { left: 50%; top: 70%; width: 8px; height: 8px; --dot-opacity: 0.22; --dot-duration: 3.2s; animation-delay: 2s; }
.loader-cubes-bg .bg-dot.dot-d { left: 30%; top: 60%; width: 16px; height: 16px; --dot-opacity: 0.15; --dot-duration: 4.7s; animation-delay: 1.5s; }
.loader-cubes-bg .bg-dot.dot-e { left: 70%; top: 80%; width: 10px; height: 10px; --dot-opacity: 0.19; --dot-duration: 3.8s; animation-delay: 2.5s; }
.loader-cubes-bg .bg-dot.dot-f { left: 20%; top: 75%; width: 14px; height: 14px; --dot-opacity: 0.12; --dot-duration: 5.5s; animation-delay: 0.7s; }
.loader-cubes-bg .bg-dot.dot-g { left: 60%; top: 15%; width: 20px; height: 20px; --dot-opacity: 0.10; --dot-duration: 6.2s; animation-delay: 1.8s; }
.loader-cubes-bg .bg-dot.dot-h { left: 85%; top: 60%; width: 9px; height: 9px; --dot-opacity: 0.21; --dot-duration: 3.5s; animation-delay: 2.9s; }
.loader-cubes-bg .bg-dot.dot-i { left: 40%; top: 40%; width: 13px; height: 13px; --dot-opacity: 0.16; --dot-duration: 4.3s; animation-delay: 1.2s; }
.loader-cubes-bg .bg-dot.dot-j { left: 55%; top: 85%; width: 11px; height: 11px; --dot-opacity: 0.20; --dot-duration: 3.9s; animation-delay: 2.2s; }

@keyframes bg-dot-move {
  0% { transform: translateY(0) scale(1) rotate(0deg); opacity: var(--dot-opacity, 0.18); }
  30% { transform: translateY(-30px) scale(1.2) rotate(10deg); }
  50% { transform: translateY(-60px) scale(1.3) rotate(-10deg); opacity: calc(var(--dot-opacity, 0.18) + 0.08); }
  70% { transform: translateY(-30px) scale(1.1) rotate(5deg); }
  100% { transform: translateY(0) scale(1) rotate(0deg); opacity: var(--dot-opacity, 0.18); }
}
.loader-cubes.hide {
  opacity: 0;
  pointer-events: none;
}
.cube-grid {
  position: relative;
  width: 120px;
  height: 120px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 12px;
}
.cube {
  width: 32px;
  height: 32px;
  background: #19f9d8;
  border-radius: 10px;
  box-shadow: 0 0 24px #19f9d8cc;
  opacity: 0.92;
  transform: scale(0.7);
  animation: cube-pop 1.2s cubic-bezier(.4,2,.6,1) forwards;
}
.cube.center {
  animation-delay: 0.2s;
}
.cube.top {
  animation-delay: 0.4s;
}
.cube.right {
  animation-delay: 0.6s;
}
.cube.bottom {
  animation-delay: 0.8s;
}
.cube.left {
  animation-delay: 1.0s;
}
@keyframes cube-pop {
  0% { opacity: 0; transform: scale(0.2); }
  60% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}
.loader-cubes-title {
  color: #19f9d8;
  font-size: 2.2em;
  font-weight: 900;
  letter-spacing: 2px;
  margin-top: 32px;
  text-align: center;
  opacity: 0;
  animation: loader-title-fade 1.2s 1.2s cubic-bezier(.4,2,.6,1) forwards;
}
.loader-cubes-title .highlight {
  background: linear-gradient(90deg, #19f9d8 40%, #00e6ff 100%);
  color: #10111b;
  padding: 0.1em 0.4em;
  border-radius: 0.5em;
  box-shadow: 0 0 18px #19f9d8cc;
  font-weight: 900;
  letter-spacing: 1px;
}

/* Dots animation below loader */
.loader-cubes-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 36px;
  gap: 16px;
}
.loader-cubes-dots .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #19f9d8;
  opacity: 0.7;
  box-shadow: 0 0 12px #19f9d8cc;
  animation: dot-bounce 1.2s infinite cubic-bezier(.4,2,.6,1);
}
.loader-cubes-dots .dot1 { animation-delay: 0s; }
.loader-cubes-dots .dot2 { animation-delay: 0.2s; }
.loader-cubes-dots .dot3 { animation-delay: 0.4s; }

@keyframes dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.7; }
  40% { transform: translateY(-18px); opacity: 1; }
}
@keyframes loader-title-fade {
  0% { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}