/* "Connecting" overlay shown while a page waits for the database
   (created by db-loading.js, dismissed by window.databaseLoadingReady()).
   Self-contained: the login pages load this file without app/orbium.css, so
   every value is spelled out here, matching the design-system tokens
   (canvas #ECECEE, surface #FFF, ink #1E1E22, muted #6F6F76, Poppins,
   radius 18px, shadow-pop, ease cubic-bezier(.2,.8,.2,1)). */
#databaseLoading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: rgba(236, 236, 238, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #1E1E22;
  font: 500 14px/1.4 'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: opacity 220ms cubic-bezier(.2, .8, .2, 1), visibility 0s linear 0s;
  animation: database-loading-in 220ms cubic-bezier(.2, .8, .2, 1) both;
}

.database-loading-card {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(360px, 100%);
  padding: 16px 22px 16px 18px;
  border-radius: 18px;
  background: #FFFFFF;
  box-shadow: 0 18px 48px rgba(30, 30, 34, .16), 0 2px 6px rgba(30, 30, 34, .06);
  animation: database-loading-pop 220ms cubic-bezier(.2, .8, .2, 1) both;
}

.database-loading-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.database-loading-text b { font-weight: 600; color: #1E1E22; }
.database-loading-text small { font-size: 12.5px; font-weight: 400; color: #6F6F76; }
.database-loading-text small:empty { display: none; }

#databaseLoading.is-ready {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 200ms cubic-bezier(.2, .8, .2, 1), visibility 0s linear 200ms;
}

.database-loading-spinner {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid #E3E3E6;
  border-top-color: #1E1E22;
  animation: database-loading-spin 0.8s linear infinite;
}

@keyframes database-loading-spin {
  to { transform: rotate(360deg); }
}
@keyframes database-loading-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes database-loading-pop {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  #databaseLoading,
  .database-loading-card { animation: none; }
  .database-loading-spinner { animation-duration: 1.8s; }
}

@media print {
  #databaseLoading { display: none !important; }
}
