/* Static start screen (white screen while loading).
 * Markup: <div class="qnb-splash"> inside #root in app/index.html. It is visible as soon as the HTML
 * and the head stylesheets are in, while the JavaScript bundles still download, and React replaces it
 * on its first render.
 */
.qnb-splash {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #ffffff;
  color: #1b124b;
  font-family: 'qnb-sans', Arial, Helvetica, sans-serif;
  text-align: center;
  overflow: auto;
}

/* Forced desktop layout on phones (fo app/index.html) scales the page down to ~25 %; the inline script sets
   --qnb-splash-zoom = 1 / scale so the start screen keeps its normal size. Unset (responsive): 1. */
.qnb-splash > * {
  zoom: var(--qnb-splash-zoom, 1);
}

.qnb-splash__logo {
  width: 180px;
  height: auto;
  margin-bottom: 32px;
}

.qnb-splash__spinner {
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  border: 5px solid #e4e2ec;
  border-top-color: #1b124b;
  border-radius: 50%;
  animation: qnb-splash-spin 0.9s linear infinite;
}

.qnb-splash__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.qnb-splash p span {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 400;
  color: #6b6880;
}

/* Hidden until the delay has passed: "still loading" after 15 s, the reload link after 90 s.
   React removes the whole screen as soon as the application starts. */
.qnb-splash__slow,
.qnb-splash__stuck {
  max-width: 520px;
  margin: 24px 0 0;
  font-size: 15px;
  line-height: 1.5;
  visibility: hidden;
  opacity: 0;
  animation: qnb-splash-show 0.4s ease-out forwards;
}

.qnb-splash__slow {
  animation-delay: 15s;
}

.qnb-splash__stuck {
  animation-delay: 90s;
}

.qnb-splash__stuck a {
  color: #1b124b;
  font-weight: 600;
  text-decoration: underline;
}

@keyframes qnb-splash-show {
  to {
    visibility: visible;
    opacity: 1;
  }
}

@keyframes qnb-splash-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .qnb-splash__spinner {
    animation-duration: 3s;
  }
}
