:root {
  --startup-ink: #0f2745;
  --startup-muted: #60728a;
  --startup-accent: #0c6b4f;
  --startup-accent-soft: rgba(12, 107, 79, .15);
}

.app-startup-loader {
  display: none;
}

html.app-startup-pending,
html.app-startup-pending body {
  overflow: hidden !important;
}

html.app-startup-pending .app-startup-loader {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: max(28px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom));
  overflow: hidden;
  direction: rtl;
  color: var(--startup-ink);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .98) 0 16%, rgba(248, 250, 252, .98) 48%, #f3f6fa 100%);
  font-family: Yekan, Vazirmatn, Tahoma, Arial, sans-serif;
  opacity: 1;
  visibility: visible;
  transition: opacity .28s ease, visibility .28s ease;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

html.app-startup-pending .app-startup-loader.is-leaving {
  opacity: 0;
  visibility: hidden;
}

.app-startup-loader__ambient {
  position: absolute;
  width: min(70vw, 560px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(2px);
  opacity: .5;
  pointer-events: none;
  z-index: -1;
}

.app-startup-loader__ambient--one {
  top: -36%;
  right: -28%;
  background: radial-gradient(circle, rgba(13, 92, 67, .10), transparent 68%);
}

.app-startup-loader__ambient--two {
  bottom: -38%;
  left: -30%;
  background: radial-gradient(circle, rgba(26, 83, 142, .09), transparent 68%);
}

.app-startup-loader__content {
  width: min(100%, 390px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translateY(-2vh);
}

.app-startup-loader__logo-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 31px;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(15, 39, 69, .10);
  box-shadow: 0 22px 55px rgba(15, 39, 69, .14), inset 0 1px 0 rgba(255, 255, 255, .9);
  animation: appStartupBreath 2.4s ease-in-out infinite;
}

.app-startup-loader__logo-ring {
  position: absolute;
  inset: -9px;
  border-radius: 38px;
  border: 1px solid rgba(12, 107, 79, .15);
  animation: appStartupRing 2.4s ease-out infinite;
}

.app-startup-loader__logo {
  width: 90px;
  height: 90px;
  display: block;
  object-fit: contain;
  border-radius: 24px;
}

.app-startup-loader__name {
  max-width: 100%;
  margin: 0;
  color: var(--startup-ink);
  font-size: clamp(26px, 6vw, 34px);
  font-weight: 800;
  line-height: 1.55;
  letter-spacing: -.5px;
}

.app-startup-loader__message {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 9px;
  color: #40546d;
  font-size: 15px;
  font-weight: 600;
}

.app-startup-loader__message i {
  width: 4px;
  height: 4px;
  display: block;
  border-radius: 50%;
  background: currentColor;
  opacity: .25;
  animation: appStartupDot 1.2s ease-in-out infinite;
}

.app-startup-loader__message i:nth-of-type(2) { animation-delay: .16s; }
.app-startup-loader__message i:nth-of-type(3) { animation-delay: .32s; }

.app-startup-loader__track {
  position: relative;
  width: min(82vw, 330px);
  height: 8px;
  margin-top: 26px;
  overflow: hidden;
  border: 1px solid rgba(15, 39, 69, .10);
  border-radius: 999px;
  background: rgba(15, 39, 69, .07);
  box-shadow: inset 0 1px 3px rgba(15, 39, 69, .08);
}

.app-startup-loader__runner {
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: -25%;
  width: 22%;
  min-width: 48px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0a573f, #17a06f 55%, #73dbb4);
  box-shadow: 0 0 16px rgba(19, 145, 100, .45);
  animation: appStartupTravel 1.35s cubic-bezier(.55, .05, .35, .95) infinite;
  will-change: transform;
}

.app-startup-loader__hint {
  min-height: 22px;
  margin-top: 14px;
  color: var(--startup-muted);
  font-size: 12px;
  line-height: 1.7;
}

@keyframes appStartupTravel {
  0% { transform: translateX(0); }
  100% { transform: translateX(570%); }
}

@keyframes appStartupBreath {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.025); }
}

@keyframes appStartupRing {
  0% { opacity: .38; transform: scale(.96); }
  75%, 100% { opacity: 0; transform: scale(1.12); }
}

@keyframes appStartupDot {
  0%, 70%, 100% { opacity: .22; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-2px); }
}

@media (max-width: 520px) {
  .app-startup-loader__content { transform: translateY(-1vh); }
  .app-startup-loader__logo-wrap {
    width: 102px;
    height: 102px;
    border-radius: 28px;
    margin-bottom: 20px;
  }
  .app-startup-loader__logo { width: 82px; height: 82px; border-radius: 22px; }
  .app-startup-loader__logo-ring { border-radius: 35px; }
  .app-startup-loader__name { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .app-startup-loader,
  .app-startup-loader__logo-wrap,
  .app-startup-loader__logo-ring,
  .app-startup-loader__message i,
  .app-startup-loader__runner {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }
  .app-startup-loader__runner { left: 39%; }
}
