:root {
  --initial-loader-bg: #ffffff;
  --initial-loader-color: #1f4166;
}

body {
  margin: 0;
}

html {
  overflow-x: hidden;
  overflow-y: scroll;
}

/* Hide the Vue app while splash screen is active */
body:not(.app-ready) #app {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Show Vue app only after splash screen is finished */
body.app-ready #app {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Prevent scroll while splash is active */
body:not(.app-ready) {
  overflow: hidden;
}

/* Restore scroll after app is ready */
body.app-ready {
  overflow: auto;
}

/* Splash screen */
#loading-bg {
  position: fixed;
  inset: 0;
  z-index: 2147483647;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  width: 100vw;
  height: 100vh;
  min-height: 100vh;

  background: var(--initial-loader-bg, #ffffff);
  gap: 1rem;

  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transition:
    opacity 0.35s ease,
    visibility 0.35s ease;
}

/* Hide splash after app is ready */
body.app-ready #loading-bg {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Logo */
.loading-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-logo svg {
  display: block;
  width: 60px;
  height: 60px;
}

/* Loader spinner */
.loading {
  position: relative;
  box-sizing: border-box;
  width: 55px;
  height: 55px;
  border: 3px solid transparent;
  border-radius: 50%;
}

.loading .effect-1,
.loading .effect-2,
.loading .effect-3 {
  position: absolute;
  inset: 0;

  box-sizing: border-box;
  width: 100%;
  height: 100%;

  border: 6px double transparent;
  border-inline-start: 6px double var(--initial-loader-color, #1f4166);
  border-radius: 50%;
}

.loading .effect-1 {
  animation: rotate 1s ease infinite;
}

.loading .effect-2 {
  animation: rotate-opacity 1s ease infinite 0.1s;
}

.loading .effect-3 {
  animation: rotate-opacity 1s ease infinite 0.2s;
}

.loading .effects {
  transition: all 0.3s ease;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(1turn);
  }
}

@keyframes rotate-opacity {
  0% {
    opacity: 0.1;
    transform: rotate(0deg);
  }

  100% {
    opacity: 1;
    transform: rotate(1turn);
  }
}
