/* Splash / loading — แสดงใน <app-root> ตั้งแต่ refresh จน Angular bootstrap + โหลด session เสร็จ
   โหลดผ่าน <link> ตรงใน index.html (render-blocking ก่อน JS bundle) เพื่อให้ styled ทันตั้งแต่เฟรมแรก */
.app-splash {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  z-index: 99999;
  opacity: 1;
  visibility: visible;
  transition:
    opacity 400ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* แอปพร้อม (NavigationEnd แรก) → fade out แล้วซ่อน */
body.app-ready .app-splash {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.app-splash__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
}
.app-splash__logo {
  width: 150px;
  height: auto;
  animation: app-splash-pulse 1.6s ease-in-out infinite;
}
.app-splash__ring {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(32, 72, 130, 0.15);
  border-top-color: #204882;
  border-radius: 50%;
  animation: app-splash-spin 0.8s linear infinite;
}
@keyframes app-splash-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes app-splash-pulse {
  0%,
  100% {
    opacity: 1;
    transform: translateY(0);
  }
  50% {
    opacity: 0.55;
    transform: translateY(-2px);
  }
}
