body {
  margin: 0;
  padding: 0;
}

/* ============================================================================
 * Modern loading / splash screen (ConnecMe2 revamp).
 * ========================================================================== */
#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Match the app's white light canvas. */
  background: #ffffff;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

/* Dark theme splash — driven by the .dark class the boot script sets from the
   saved theme (not the OS preference), so it always matches the app. */
html.dark #splash-screen {
  background: #0a0a0c;
}

#splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cm2-splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  animation: cm2-splash-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cm2-splash-logo {
  height: 56px;
  width: auto;
  animation: cm2-splash-pulse 1.8s ease-in-out infinite;
}

/* Thin indeterminate progress bar in the brand orange. */
.cm2-splash-bar {
  position: relative;
  width: 168px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.14);
}

.cm2-splash-bar > span {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, #fbbf24, #f97316);
  animation: cm2-splash-slide 1.15s ease-in-out infinite;
}

@keyframes cm2-splash-slide {
  0% {
    left: -42%;
  }
  50% {
    left: 34%;
  }
  100% {
    left: 100%;
  }
}

@keyframes cm2-splash-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.78;
    transform: scale(0.975);
  }
}

@keyframes cm2-splash-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cm2-splash-logo,
  .cm2-splash-bar > span,
  .cm2-splash-inner {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
  }
}
