/* Shared splash screen styling for StudioPilot web builds. */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--splash-text, rgba(21, 42, 14, 0.75));
  background: #ffffff;
}

:root {
  color-scheme: light;
}

body.initial-loader-active {
  /* Allow Flutter to render underneath */
  overflow: hidden;
}

#loading_indicator {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 6vw, 32px);
  background: linear-gradient(
    180deg,
    rgba(104, 193, 55, 0.9) 0%,
    rgba(104, 193, 55, 0.55) 35%,
    rgba(104, 193, 55, 0.24) 70%,
    rgba(255, 255, 255, 0.0) 100%
  );
  backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 9999;
}

body.initial-loader-active #loading_indicator {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.initial-loader-active #loading_indicator.initial-loader--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.initial-loader-card {
  background: var(--splash-surface, #ffffff);
  border-radius: 28px;
  padding: clamp(32px, 6vw, 56px);
  width: clamp(260px, 38vw, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, 4vw, 28px);
  text-align: center;
  box-shadow:
    0 22px 48px rgba(25, 51, 16, 0.24),
    0 8px 18px rgba(25, 51, 16, 0.14);
  backdrop-filter: blur(12px);
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--theme-color-muted, rgba(104, 193, 55, 0.16));
  color: var(--theme-color-strong, #326215);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.brand-chip__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--theme-color, #68C137);
  box-shadow: 0 0 0 6px rgba(104, 193, 55, 0.12);
}

.loader {
  position: relative;
  width: clamp(68px, 12vw, 88px);
  height: clamp(68px, 12vw, 88px);
  margin-bottom: clamp(24px, 4vw, 32px);
}

.loader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 6px solid var(--theme-color-soft, rgba(104, 193, 55, 0.18));
  border-top-color: var(--theme-color, #68C137);
  border-right-color: var(--theme-color-light, #8fd857);
  animation: ring-spin 1.25s cubic-bezier(0.6, 0.2, 0.2, 0.8) infinite;
}

.loader__orbit {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  animation: orbit 1.6s linear infinite;
  opacity: 0.75;
}

.loader__orbit::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--theme-color, #68C137);
  box-shadow: 0 0 0 6px rgba(104, 193, 55, 0.16);
}

.loader__orbit--inner {
  inset: 20px;
  animation-duration: 1.2s;
  opacity: 0.55;
}

.loader__orbit--inner::before {
  width: 10px;
  height: 10px;
  top: -4px;
  background: var(--theme-color-light, #8fd857);
  box-shadow: 0 0 0 4px rgba(143, 216, 87, 0.18);
}

.loader__core {
  position: absolute;
  inset: calc(50% - 10px);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--theme-color, #68C137);
  box-shadow: 0 6px 12px rgba(104, 193, 55, 0.3);
  animation: pulse 1.4s ease-in-out infinite;
}

.splash-text {
  margin: 0;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.35);
}

.splash-text__accent {
  color: var(--theme-color, #68C137);
  font-weight: 600;
}

@keyframes ring-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

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

@keyframes pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(0.92);
    opacity: 0.82;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.08);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader__ring,
  .loader__orbit,
  .loader__core {
    animation-duration: 0.001s;
    animation-iteration-count: 1;
  }
}
