@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=TH+Sarabun:wght@400;700&display=swap");

html,
body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Roboto", "TH Sarabun", sans-serif;
}

.root {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ===== Brand Loader =====
 * Shared by the pre-React boot splash in index.html (#splash) and the React
 * <BrandLoader> component, so the hand-off from the static splash to the React
 * loader is seamless (identical markup + styles). Plain CSS (not MUI/makeStyles)
 * so it is available on the very first paint, before the JS bundle runs.
 */
.bl-splash,
.bl-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
}
.bl-splash {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: radial-gradient(130% 110% at 50% -10%, #ffffff 0%, #eef4fc 55%, #e3edfa 100%);
}
.bl-overlay {
  position: absolute;
  inset: 0;
  z-index: 1200;
  background: rgba(255, 255, 255, 0.82);
}
.bl-block {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 24px;
}
.bl-fade {
  transition: opacity 0.45s ease;
}
.bl-hidden {
  opacity: 0 !important;
  pointer-events: none;
}

.bl-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
/* Logo sits on its own row above the route, so the drawing line never
   crosses the logo (the route is a "road" beneath the brand). */
.bl-logo {
  width: 230px;
  max-width: 70%;
  height: auto;
  animation: bl-float 3s ease-in-out infinite;
}
.bl-art {
  position: relative;
  width: 280px;
  max-width: 80vw;
  height: 52px;
}
.bl-route {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.bl-stage--sm {
  gap: 4px;
}
.bl-stage--sm .bl-logo {
  width: 152px;
}
.bl-stage--sm .bl-art {
  width: 210px;
  height: 39px;
}
.bl-base {
  fill: none;
  stroke: rgba(27, 59, 111, 0.13);
  stroke-width: 3;
  stroke-dasharray: 5 8;
}
/* pathLength="100" normalises the dash length regardless of the path's real
   geometry, so the draw starts fully hidden and fills to 100%. */
.bl-prog {
  fill: none;
  stroke: #1ca0db;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: bl-draw 2.6s ease-in-out infinite;
}
@keyframes bl-draw {
  0% {
    stroke-dashoffset: 100;
  }
  60% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0.2;
  }
}
.bl-pin {
  animation: bl-move 2.6s ease-in-out infinite;
}
@keyframes bl-move {
  0% {
    offset-distance: 0%;
  }
  60% {
    offset-distance: 100%;
  }
  100% {
    offset-distance: 100%;
    opacity: 0;
  }
}
@keyframes bl-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
.bl-status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #34537f;
  font-size: 15px;
  font-weight: 600;
  font-family: "Roboto", "TH Sarabun", sans-serif;
}
.bl-dots span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1ca0db;
  margin: 0 2px;
  animation: bl-dot 1s ease-in-out infinite;
}
.bl-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.bl-dots span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes bl-dot {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-4px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .bl-prog,
  .bl-pin,
  .bl-logo,
  .bl-dots span {
    animation: none;
  }
  .bl-prog {
    stroke-dashoffset: 0;
  }
}
