/* Global app loader (AppLoader.razor): branded overlay, page-change bar, small corner chip.
   Linked once in App.razor with the other global CSS. */

.al-overlay {
  position: fixed; inset: 0; z-index: 2500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .38);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: al-fade .18s ease-out;
  cursor: progress;
}
.al-card {
  width: min(360px, calc(100vw - 32px));
  background: #fff; color: #1e293b;
  border-radius: 18px; padding: 26px 24px 22px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .35);
  animation: al-pop .22s ease-out;
}
.al-logo { position: relative; width: 84px; height: 84px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; }
.al-logo img { width: 46px; height: 46px; object-fit: contain; animation: al-pulse 1.6s ease-in-out infinite; }
.al-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 4px solid #e3f2fd; border-top-color: var(--brand-700, #0d47a1); border-right-color: var(--brand-600, #1565c0);
  animation: al-spin 1s linear infinite;
}
.al-title { font-size: 1.1rem; font-weight: 800; color: var(--brand-700, #0d47a1); }
.al-detail { margin-top: 4px; font-size: .86rem; color: #64748b; }
.al-bar { margin: 16px auto 0; height: 4px; width: 100%; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.al-bar span { display: block; height: 100%; width: 40%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-600, #1565c0), #0d9488); animation: al-slide 1.2s ease-in-out infinite; }
.al-slow { margin-top: 14px; padding: 8px 10px; border-radius: 10px; background: #fff8e1; color: #8a5a00; font-size: .8rem; line-height: 1.45; }

/* thin bar while changing pages */
.al-topbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2600; overflow: hidden; background: transparent; pointer-events: none; }
.al-topbar span { display: block; height: 100%; width: 35%; background: linear-gradient(90deg, var(--brand-600, #1565c0), #0d9488); animation: al-slide 1s ease-in-out infinite; }

/* background (non-blocking) work */
.al-chip {
  position: fixed; right: 16px; bottom: 16px; z-index: 2400;
  display: inline-flex; align-items: center; gap: 8px;
  background: #0f172a; color: #fff; font-size: .8rem; font-weight: 600;
  padding: 8px 14px; border-radius: 999px; box-shadow: 0 6px 18px rgba(15, 23, 42, .35);
}
.al-chip-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; animation: al-pulse 1s ease-in-out infinite; }

html.sm-dark .al-card { background: #1e293b; color: #e2e8f0; }
html.sm-dark .al-title { color: #90caf9; }
html.sm-dark .al-detail { color: #94a3b8; }
html.sm-dark .al-bar { background: #334155; }
html.sm-dark .al-ring { border-color: #334155; border-top-color: #64b5f6; border-right-color: #4db6ac; }

@keyframes al-spin { to { transform: rotate(360deg); } }
@keyframes al-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.12); opacity: .85; } }
@keyframes al-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@keyframes al-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes al-pop { from { transform: translateY(8px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .al-ring, .al-logo img, .al-bar span, .al-topbar span, .al-chip-dot { animation: none; }
  .al-bar span { width: 100%; }
}
@media print { .al-overlay, .al-topbar, .al-chip { display: none !important; } }
