/* Isolated startup/auth-transition screen. These styles never target app pages. */
.siami-app-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
  background: #fbfcfd;
  color: #12314c;
}

.siami-preloader-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  width: min(330px, calc(100vw - 44px));
  min-height: 94px;
  padding: 16px 22px;
  overflow: hidden;
  border: 1px solid #dceaf0;
  border-radius: 21px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(19, 49, 76, .06);
}

.siami-preloader-brand::before {
  position: absolute;
  top: -1px;
  left: 18%;
  width: 38%;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, #e0a52d 0%, #197a43 52%, #2f9ac0 100%);
  content: "";
  animation: siami-loader-sweep 1.25s ease-in-out infinite alternate;
}

.siami-preloader-logo {
  display: block;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  object-fit: contain;
}

.siami-preloader-wordmark {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.siami-preloader-wordmark strong {
  color: #12314c;
  font: 800 25px/1 'Plus Jakarta Sans', Inter, sans-serif;
  letter-spacing: -.045em;
}

.siami-preloader-wordmark small {
  color: #63788b;
  font: 600 10px/1.4 Inter, sans-serif;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.siami-preloader-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 9px;
}

.siami-preloader-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a8c3d4;
  animation: siami-loader-pulse .85s ease-in-out infinite;
}

.siami-preloader-dots i:nth-child(2) { background: #d6a936; animation-delay: .14s; }
.siami-preloader-dots i:nth-child(3) { background: #2c8653; animation-delay: .28s; }

.siami-preloader-caption {
  margin: -16px 0 0;
  color: #8192a2;
  font: 700 11px/1.4 Inter, sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.siami-preloader-error {
  max-width: 34ch;
  margin: 0;
  padding-inline: 16px;
  text-align: center;
  font: 400 16px/1.5 Inter, sans-serif;
}

.siami-preloader-retry {
  padding: 10px 20px;
  border: 1px solid #12613a;
  border-radius: 8px;
  background: #12613a;
  color: #fff;
  font: 600 16px/1.5 Inter, sans-serif;
  cursor: pointer;
}

.siami-preloader-retry:focus-visible { outline: 3px solid #d6a936; outline-offset: 3px; }

@keyframes siami-loader-pulse {
  0%, 100% { opacity: .42; }
  50% { opacity: 1; }
}

@keyframes siami-loader-sweep {
  from { left: 12%; }
  to { left: 50%; }
}

html[data-theme="dark"] .siami-app-preloader { background: #0d1723; color: #e8f0f5; }
html[data-theme="dark"] .siami-preloader-brand { border-color: #263d4e; background: #142332; box-shadow: 0 8px 28px rgba(0, 0, 0, .24); }
html[data-theme="dark"] .siami-preloader-wordmark strong { color: #f0f6fa; }
html[data-theme="dark"] .siami-preloader-wordmark small,
html[data-theme="dark"] .siami-preloader-caption { color: #a7b7c4; }

@media (prefers-reduced-motion: reduce) {
  .siami-preloader-brand::before,
  .siami-preloader-dots i { animation: none; }
}
