/* First paint, before the application bundle. Removed with the HTML fallback at mount. */
html:has(.app-startup) body {
  margin: 0;
}

.app-startup {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  color: #edf3f8;
  background: #0b111a;
  font-family: system-ui, sans-serif;
}

.app-startup::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent, #0b111a 80%), url('/auth/connection-field.svg') center 36% / auto 130% no-repeat;
  opacity: 0.4;
}

.app-startup-content {
  display: grid;
  justify-items: center;
  gap: 32px;
  padding: 24px;
  text-align: center;
}

.app-startup-content > img {
  display: block;
  max-width: 60vw;
  height: auto;
  filter: invert(1);
}

.app-startup-progress {
  width: 96px;
  height: 2px;
  overflow: hidden;
  background: #263b4a;
}

.app-startup-progress::after {
  content: '';
  display: block;
  width: 40%;
  height: 100%;
  background: #b6d7e9;
  animation: app-startup-progress 1400ms ease-in-out infinite;
}

@keyframes app-startup-progress {
  from { transform: translateX(-100%); }
  to { transform: translateX(350%); }
}

.app-startup-error {
  display: none;
  color: #c3d1dd;
  font-size: 14px;
  line-height: 1.6;
}

.app-startup-error button {
  min-height: 44px;
  padding: 8px 20px;
  border: 1px solid #8293a3;
  border-radius: 6px;
  background: transparent;
  color: #edf3f8;
  font: inherit;
  cursor: pointer;
}

.app-startup-error button:focus-visible {
  outline: 2px solid #b6d7e9;
  outline-offset: 3px;
}

.app-startup[data-state='error'] .app-startup-progress {
  display: none;
}

.app-startup[data-state='error'] .app-startup-error {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .app-startup-progress::after { animation: none; }
}

[data-reduce-effects='on'] .app-startup-progress::after {
  animation: none;
}
