/* splash.css — KommuneKI
   Liten, selvstendig fil som lastes FØR bundle.css.
   Alle klasser prefikset med sp- for å unngå kollisjon.
   Splash dekker hele skjermen med z-index — ingen skjuling av app-elementer nødvendig. */

/* --- Splash container --- */
#splash {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f4f6f8;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#splash::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(25, 118, 210, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 60% 60% at 80% 60%, rgba(0, 137, 123, 0.05) 0%, transparent 70%);
  animation: sp-bg 8s ease-in-out infinite alternate;
}

@keyframes sp-bg {
  0%   { opacity: 0.6; transform: scale(1); }
  100% { opacity: 1;   transform: scale(1.05); }
}

/* --- Card --- */
#splash .sp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 3rem 2rem;
  animation: sp-card-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes sp-card-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Logo --- */
#splash .sp-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  box-shadow:
    0 4px 24px rgba(25, 118, 210, 0.15),
    0 0 0 1px rgba(25, 118, 210, 0.08);
  margin-bottom: 1.25rem;
  animation: sp-logo-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

@keyframes sp-logo-in {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

/* --- Title --- */
#splash .sp-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: #1e3a5f;
  margin: 0 0 0.3rem;
  letter-spacing: -0.01em;
  animation: sp-text-in 0.5s ease 0.2s both;
}

#splash .sp-subtitle {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0 0 2rem;
  font-weight: 400;
  animation: sp-text-in 0.5s ease 0.3s both;
}

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

/* --- Loader bar --- */
#splash .sp-loader {
  width: 200px;
  height: 3px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1rem;
  animation: sp-text-in 0.5s ease 0.4s both;
}

#splash .sp-loader-bar {
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, #1976d2, #42a5f5);
  border-radius: 3px;
  animation: sp-progress 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes sp-progress {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* --- Status text --- */
#splash .sp-status {
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 0;
  animation: sp-text-in 0.5s ease 0.5s both;
  letter-spacing: 0.01em;
}

#splash .sp-status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1976d2;
  margin-right: 6px;
  vertical-align: middle;
  animation: sp-pulse 1.5s ease-in-out infinite;
}

@keyframes sp-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50%      { opacity: 1;   transform: scale(1.1); }
}

/* --- Responsive --- */
@media (max-width: 480px) {
  #splash .sp-card { padding: 2rem 1.5rem 1.5rem; }
  #splash .sp-logo { width: 56px; height: 56px; border-radius: 12px; }
  #splash .sp-title { font-size: 1.15rem; }
  #splash .sp-loader { width: 160px; }
}

/* --- Fade-out --- */
#splash.sp-hiding {
  animation: sp-fade-out 0.35s ease forwards;
}

@keyframes sp-fade-out {
  to { opacity: 0; transform: scale(1.02); pointer-events: none; }
}
