/* ==========================================================================
   Premium splash screen
   Shown before Angular boots (static markup in index.html), then mirrored by
   the Angular splash component so the handoff is seamless.
   Design rules: calm motion, stable layout, honest progress, theme aware.
   ========================================================================== */

body {
  margin: 0;
  padding: 0;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: #f6f8fc;
  color: #475569;
  line-height: 1.5;
  font-size: 14px;
  font-weight: 400;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
  transition: opacity 0.45s ease;
}

.splash-screen span {
  color: #475569;
  transition: none !important;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

/* ── Ambient brand glow ─────────────────────────────────────────────── */
.splash-aurora {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(38% 38% at 22% 28%, rgba(var(--splash-primary-rgb, 0, 158, 247), 0.16) 0%, transparent 70%),
    radial-gradient(34% 34% at 78% 32%, rgba(var(--splash-accent-rgb, 99, 102, 241), 0.14) 0%, transparent 70%),
    radial-gradient(42% 42% at 50% 84%, rgba(var(--splash-primary-rgb, 0, 158, 247), 0.10) 0%, transparent 70%);
  filter: blur(12px);
  animation: splash-drift 18s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes splash-drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(0, -3%, 0) scale(1.06); }
}

/* ── Center stage ───────────────────────────────────────────────────── */
.splash-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 2.5rem 2.75rem 2rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 50px -18px rgba(15, 23, 42, 0.22), 0 2px 8px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  min-width: 320px;
  max-width: min(92vw, 460px);
  animation: splash-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes splash-rise {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Logo in a floating badge ───────────────────────────────────────── */
.splash-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  height: 104px;
  padding: 14px;
  border-radius: 26px;
  background: #ffffff;
  border: 1px solid rgba(var(--splash-primary-rgb, 0, 158, 247), 0.18);
  box-shadow: 0 12px 28px -10px rgba(15, 23, 42, 0.28), 0 0 0 6px rgba(var(--splash-primary-rgb, 0, 158, 247), 0.05);
  animation: splash-float 5s ease-in-out infinite;
}

.splash-badge img {
  max-width: 100%;
  max-height: 76px;
  width: auto;
  object-fit: contain;
}

@keyframes splash-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ── Brand lockup ───────────────────────────────────────────────────── */
.splash-name {
  margin-top: 1.35rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: 0.01em;
  line-height: 1.15;
  color: var(--splash-primary, #0e7490);
  text-align: center;
  word-break: break-word;
}

.splash-tagline {
  margin-top: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #94a3b8;
  text-align: center;
  min-height: 1em;
}

/* ── Indeterminate progress ─────────────────────────────────────────── */
.splash-progress {
  position: relative;
  width: 100%;
  height: 4px;
  margin-top: 1.6rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}

.splash-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--splash-primary, #0e7490),
    var(--splash-accent, #6366f1)
  );
  animation: splash-sweep 1.5s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes splash-sweep {
  0% { left: -40%; }
  100% { left: 100%; }
}

/* ── Status line ────────────────────────────────────────────────────── */
.splash-status {
  margin-top: 0.9rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #64748b;
  text-align: center;
  min-height: 2.6em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-status .splash-status-text {
  display: inline-block;
  max-width: 100%;
  line-height: 1.45;
  padding: 0 0.35rem;
  animation: splash-fade-swap 0.4s ease both;
}

@keyframes splash-fade-swap {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.splash-dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
  opacity: 0.5;
  animation: splash-pulse 1.4s ease-in-out infinite;
}

@keyframes splash-pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.8; }
}

/* ── Dark mode ──────────────────────────────────────────────────────── */
[data-bs-theme='dark'] .splash-screen {
  background-color: #0b1120;
  color: #cbd5e1;
}

[data-bs-theme='dark'] .splash-screen span {
  color: #cbd5e1;
}

[data-bs-theme='dark'] .splash-aurora {
  opacity: 0.7;
}

[data-bs-theme='dark'] .splash-card {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.7);
}

[data-bs-theme='dark'] .splash-badge {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.2);
}

[data-bs-theme='dark'] .splash-tagline {
  color: #64748b;
}

[data-bs-theme='dark'] .splash-status {
  color: #94a3b8;
}

/* ── Small screens ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .splash-card {
    padding: 2rem 1.75rem 1.6rem;
    min-width: 0;
    width: calc(100vw - 3rem);
  }

  .splash-badge {
    width: 84px;
    height: 84px;
    border-radius: 22px;
  }

  .splash-badge img {
    max-height: 60px;
  }

  .splash-name {
    font-size: 1.35rem;
  }
}

/* ── Accessibility ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .splash-aurora,
  .splash-card,
  .splash-badge,
  .splash-progress-bar,
  .splash-status .splash-status-text,
  .splash-dot {
    animation: none !important;
  }

  .splash-progress-bar {
    left: 0;
    width: 100%;
  }
}

#root {
  opacity: 1;
  transition: opacity 1s ease-in-out;
}
