html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  background: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  overflow: hidden;
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(240, 8, 15, 0.08), transparent 26%),
    linear-gradient(135deg, #ffffff 0%, #fff7f7 100%);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.app-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-card {
  width: min(360px, 100%);
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 28px 24px;
  border: 1px solid rgba(240, 8, 15, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 60px rgba(22, 28, 45, 0.12);
  text-align: center;
  font-family: Roboto, Arial, sans-serif;
}

.loader-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.loader-copy {
  display: grid;
  gap: 6px;
  color: #263238;
}

.loader-copy strong {
  font-size: 24px;
  line-height: 1.2;
}

.loader-copy span {
  font-size: 14px;
  color: #637381;
}

.loader-bar {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #f3d4d6;
}

.loader-bar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: #f0080f;
  animation: loading-bar 1.15s ease-in-out infinite;
}

.pwa-install-button {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 10000;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: #f0080f;
  color: #ffffff;
  font: 700 14px/1 Roboto, Arial, sans-serif;
  box-shadow: 0 12px 32px rgba(240, 8, 15, 0.26);
  cursor: pointer;
}

.pwa-install-button:hover,
.pwa-install-button:focus-visible {
  background: #d9070d;
  outline: 3px solid rgba(240, 8, 15, 0.18);
  outline-offset: 2px;
}

@keyframes loading-bar {
  0% {
    transform: translateX(-110%);
  }
  52% {
    transform: translateX(72%);
  }
  100% {
    transform: translateX(250%);
  }
}

@media (max-width: 640px) {
  .loader-card {
    padding: 24px 18px;
  }

  .loader-logo {
    width: 84px;
    height: 84px;
  }

  .pwa-install-button {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
}
