body {
  margin: 0;
}

html {
  overflow: hidden scroll;
}

/* ── Фон preloader (заливает весь экран до монтирования Vue) ── */
#loading-bg {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--initial-loader-bg, #fff);
  z-index: 2147483647;
}

/* ── Прогресс-бар в стиле nprogress / GitHub ── */
#nprogress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 2147483647;
  pointer-events: none;
}

#nprogress .bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--initial-loader-color, #696cff);
  transform-origin: left center;
  animation: nprogress-indeterminate 2s ease-in-out infinite;
}

/* Блик (светлая полоска, бегущая по бару) */
#nprogress .glow {
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: nprogress-glow 2s ease-in-out infinite;
}

/* Анимация: бар «дышит» — то расширяется, то сужается */
@keyframes nprogress-indeterminate {
  0% {
    transform: scaleX(0);
  }
  25% {
    transform: scaleX(0.3);
  }
  50% {
    transform: scaleX(0.6);
  }
  75% {
    transform: scaleX(0.3);
  }
  100% {
    transform: scaleX(0);
  }
}

@keyframes nprogress-glow {
  0% {
    right: 100%;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    right: -100px;
    opacity: 0;
  }
}

/* ── Логотип / название под прогресс-баром ── */
.loading-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-top: 48px;
}

.loading-brand .logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--initial-loader-color, #696cff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  font-family: system-ui, -apple-system, sans-serif;
  animation: logo-pulse 2s ease-in-out infinite;
}

.loading-brand .app-name {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--initial-loader-color, #696cff);
  letter-spacing: -0.01em;
  opacity: 0.7;
  animation: logo-pulse 2s ease-in-out infinite;
}

@keyframes logo-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}
