/* ==================== ESFERAS 3D GRANDES EN TODO EL FONDO + ANIMACIONES 60FPS GPU ==================== */
.esfera-fondo {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
  box-shadow: inset -14px -18px 30px rgba(15, 22, 30, 0.16), 0 22px 44px rgba(15, 22, 30, 0.16);
}

/* 10 esferas grandes (mate blancas + 7 colores de los criterios) desplazándose detrás del blur */
.ef-1  { width: 220px; height: 220px; top: 4%;    left: 2%;   background: radial-gradient(circle at 30% 28%, #fff3bf, #f59f00 68%, #c97a00); animation: derivar-a 12s ease-in-out infinite alternate; }
.ef-2  { width: 175px; height: 175px; top: 56%;   left: 6%;   background: radial-gradient(circle at 30% 28%, #ffffff, #d9dfe2 66%, #aeb7bc); animation: derivar-b 14s ease-in-out infinite alternate; }
.ef-3  { width: 210px; height: 210px; top: 14%;   left: 26%;  background: radial-gradient(circle at 30% 28%, #ffd8a8, #ea580c 68%, #b84207); animation: derivar-c 13s ease-in-out infinite alternate; }
.ef-4  { width: 195px; height: 195px; bottom: 4%; left: 28%;  background: radial-gradient(circle at 30% 28%, #fbcfe8, #db2777 68%, #a31858); animation: derivar-a 11.5s ease-in-out infinite alternate-reverse; }
.ef-5  { width: 230px; height: 230px; top: 26%;   left: 46%;  background: radial-gradient(circle at 30% 28%, #bbf7d0, #2b9a22 68%, #1d7017); animation: derivar-b 13.5s ease-in-out infinite alternate-reverse; }
.ef-6  { width: 185px; height: 185px; bottom: 8%; left: 52%;  background: radial-gradient(circle at 30% 28%, #bfdbfe, #1d6ce0 68%, #124da6); animation: derivar-c 12.5s ease-in-out infinite alternate; }
.ef-7  { width: 215px; height: 215px; top: 6%;    right: 16%; background: radial-gradient(circle at 30% 28%, #ddd6fe, #7c3aed 68%, #5b21b6); animation: derivar-a 14.5s ease-in-out infinite alternate; }
.ef-8  { width: 205px; height: 205px; bottom: 6%; right: 12%; background: radial-gradient(circle at 30% 28%, #99f6e4, #0d9488 68%, #096e65); animation: derivar-b 11s ease-in-out infinite alternate; }
.ef-9  { width: 155px; height: 155px; top: 44%;   right: 2%;  background: radial-gradient(circle at 30% 28%, #ffffff, #e2e6e8 64%, #bac2c7); animation: derivar-c 10.5s ease-in-out infinite alternate-reverse; }
.ef-10 { width: 145px; height: 145px; top: 36%;   left: 16%;  background: radial-gradient(circle at 30% 28%, #ffffff, #e6eaec 65%, #bfc7cc); animation: derivar-a 10s ease-in-out infinite alternate; }

/* Animaciones continuas sin interacción en Login */
.uiverse-login-card:not(.abierta-google) .uiverse-google-emblema {
  animation: latir-emblema 2.4s ease-in-out infinite;
}
.uiverse-login-card:not(.abierta-google) .uiverse-flecha {
  animation: empujar-flecha 1.5s ease-in-out infinite;
}
.tarjeta-zebra .zebra-icono {
  animation: flotar-vivo 3.2s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -0.44s);
}
.tarjeta-zebra .zebra-icono::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  border: 2px solid var(--c1);
  opacity: 0;
  animation: pulso-icono 2.8s ease-out infinite;
  animation-delay: calc(var(--i, 0) * 0.36s);
}

/* Animaciones continuas sin interacción en Interior */
.halo-giratorio { animation: rotar-360 7s linear infinite; }
.icono-tile-birrete { animation: flotar-vivo 3.2s ease-in-out infinite; }
.tarjeta-criterio .orbe-icono {
  animation: flotar-vivo 3.2s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -0.42s);
}
.tarjeta-criterio .criterio-pie-glow {
  animation: respirar-aura 2.8s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -0.36s);
}

/* ==================== TRANSICIÓN CINÉTICA DE LOGIN / LOGOUT ==================== */
.seccion-login.saliendo-login {
  animation: salir-login 0.42s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.seccion-login.entrando-login .uiverse-login-escenario,
.seccion-login.entrando-login .tarjeta-zebra {
  animation: entrada-cascada 0.46s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}

.portal-transicion {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 38, 40, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.portal-transicion.activo { opacity: 1; pointer-events: auto; }
.portal-transicion.saliendo {
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.4s ease, transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.portal-onda {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.65);
  opacity: 0;
}
.portal-transicion.activo .onda-a { animation: expandir-onda 1.05s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.portal-transicion.activo .onda-b { border-color: #00b4a2; animation: expandir-onda 1.05s cubic-bezier(0.16, 1, 0.3, 1) 0.16s forwards; }
.portal-transicion.activo .onda-c { border-color: #f59f00; animation: expandir-onda 1.05s cubic-bezier(0.16, 1, 0.3, 1) 0.32s forwards; }

.portal-nucleo {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 38px 54px;
  background: rgba(255, 255, 255, 0.92);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.30);
  transform: translate3d(0, 24px, 0) scale(0.74);
  opacity: 0;
}
.portal-transicion.activo .portal-nucleo { animation: brote-nucleo 0.54s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

.portal-anillo {
  position: relative;
  width: 124px;
  height: 124px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.portal-halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #f59f00, #ea580c, #db2777, #2b9a22, #1d6ce0, #7c3aed, #0d9488, #f59f00);
  animation: rotar-360 2.4s linear infinite;
}
.portal-avatar {
  position: relative;
  z-index: 1;
  width: 114px;
  height: 114px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #ffffff;
  display: block;
  background: #ecece8;
}
.portal-avatar-texto {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fuente-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--grafito-oscuro);
}
.portal-check-badge {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #0d9488;
  color: #ffffff;
  border: 3px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}
.check-trazo { stroke-dasharray: 28; stroke-dashoffset: 28; }
.portal-transicion.activo .check-trazo { animation: dibujar-check 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.22s forwards; }
.portal-saludo { margin: 4px 0 0; font-family: var(--fuente-display); font-size: 1.75rem; font-weight: 700; text-transform: uppercase; color: var(--grafito-oscuro); text-align: center; }

.vista-interior.animar-entrada .elemento-cascada {
  animation: entrada-cascada 0.44s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--orden, 0) * 55ms);
}

/* ==================== KEYFRAMES 100% GPU (SOLO transform Y opacity) ==================== */
@keyframes derivar-a { 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(7vw, 9vh, 0) scale(1.08); } }
@keyframes derivar-b { 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(-8vw, -8vh, 0) scale(1.1); } }
@keyframes derivar-c { 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(6vw, -9vh, 0) scale(0.94); } }
@keyframes rotar-360 { to { transform: rotate(360deg); } }
@keyframes flotar-vivo { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -8px, 0); } }
@keyframes latir-emblema { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(0, -5px, 0) scale(1.06); } }
@keyframes empujar-flecha { 0%, 100% { transform: translate3d(0, 0, 0); opacity: 0.78; } 50% { transform: translate3d(9px, 0, 0); opacity: 1; } }
@keyframes pulso-icono { 0% { transform: scale(0.95); opacity: 0.65; } 100% { transform: scale(1.36); opacity: 0; } }
@keyframes respirar-aura { 0%, 100% { opacity: 0.30; } 50% { opacity: 0.92; } }
@keyframes expandir-onda { 0% { transform: scale(0.45); opacity: 0.92; } 100% { transform: scale(6.5); opacity: 0; } }
@keyframes brote-nucleo { 0% { transform: translate3d(0, 24px, 0) scale(0.74); opacity: 0; } 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 1; } }
@keyframes dibujar-check { to { stroke-dashoffset: 0; } }
@keyframes salir-login { to { opacity: 0; transform: scale(0.94); } }
@keyframes entrada-cascada {
  0% { opacity: 0; transform: translate3d(0, 22px, 0) scale(0.97); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@media (max-width: 768px) {
  .esfera-fondo { width: 130px; height: 130px; }
}
