/* Pre-Angular boot splash — linked from index.html (not Angular styles bundle). */

.app-boot {
  --app-boot-primary: #0284c7;
  --app-boot-primary-soft: #dbeafe;
  --app-boot-primary-ring: #bfdbfe;
  --app-boot-text: #1e3a5f;
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1.25rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, #e8f4fc 0%, transparent 70%),
    linear-gradient(180deg, #eef7fd 0%, #f5faff 45%, #ffffff 100%);
  font-family: 'Iconic', system-ui, sans-serif;
}

.app-boot__frame {
  position: relative;
  z-index: 1;
  width: min(100%, 22rem);
  animation: app-boot-enter 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.app-boot__layer {
  pointer-events: none;
  position: absolute;
  inset: 0.35rem 0.5rem;
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 32px -10px rgba(2, 132, 199, 0.1);
}

.app-boot__layer--back {
  transform: rotate(6deg) scale(0.98);
}

.app-boot__layer--mid {
  transform: rotate(-5deg) scale(0.99);
}

.app-boot__card {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  width: 100%;
  padding: 2.75rem 2rem 2.25rem;
  border-radius: 2rem;
  background: #ffffff;
  box-shadow:
    0 18px 48px -16px rgba(2, 132, 199, 0.18),
    0 8px 24px -8px rgba(15, 23, 42, 0.06);
}

.app-boot__logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 7.25rem;
  height: 7.25rem;
  border-radius: 9999px;
  background: #fff;
  box-shadow:
    0 0 0 6px #fff,
    0 0 0 8px var(--app-boot-primary-ring),
    0 10px 28px -10px rgba(2, 132, 199, 0.28);
}

.app-boot__logo {
  height: 5.5rem;
  width: auto;
  max-width: 6.25rem;
  object-fit: contain;
}

.app-boot__status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.app-boot__spin {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border: 2.5px solid var(--app-boot-primary-soft);
  border-top-color: var(--app-boot-primary);
  animation: app-boot-spin 0.8s linear infinite;
}

.app-boot__text {
  margin: 0;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--app-boot-text);
}

.app-boot__track {
  width: 10rem;
  height: 0.375rem;
  margin-top: 0.35rem;
  overflow: hidden;
  border-radius: 9999px;
  background: var(--app-boot-primary-soft);
}

.app-boot__bar {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  border-radius: 9999px;
  background: linear-gradient(90deg, #0369a1, var(--app-boot-primary));
  animation: app-boot-fill 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes app-boot-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes app-boot-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes app-boot-fill {
  0% {
    transform: scaleX(0.12);
    opacity: 0.85;
  }
  55% {
    transform: scaleX(0.92);
    opacity: 1;
  }
  75% {
    transform: scaleX(0.88);
    opacity: 1;
  }
  100% {
    transform: scaleX(0.12);
    opacity: 0.85;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-boot__frame {
    animation: none;
  }

  .app-boot__spin,
  .app-boot__bar {
    animation: none;
  }

  .app-boot__bar {
    transform: scaleX(0.9);
    opacity: 0.9;
  }
}

/* /intro — ก่อน Angular boot ใช้พื้นเทา backdrop ไม่ใช่โทนฟ้า app-boot */
html.intro-route-active,
html.intro-route-active body {
  background-color: rgb(51, 51, 51) !important;
}

html.intro-route-active .app-boot {
  background: rgb(51, 51, 51) !important;
}

html.intro-route-active .app-boot__text {
  color: #e2e8f0;
}
