/* Global page loader — orange theme: warm tinted backdrop, orange ring, icon badge, short label */
.app-page-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.82);   /* light white veil — the orange ring stays the focus */
    -webkit-backdrop-filter: blur(2px);
            backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.dark .app-page-loader { background: rgba(17, 24, 39, 0.82); }
.app-page-loader.is-active { opacity: 1; visibility: visible; pointer-events: auto; }

/* Thin orange progress bar along the top */
.app-loader-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; overflow: hidden; background: rgba(234, 88, 12, 0.15); }
.app-loader-bar span {
    position: absolute; top: 0; bottom: 0; width: 40%; border-radius: 3px;
    background: linear-gradient(90deg, rgba(234, 88, 12, 0), #f97316 35%, #ea580c 70%, rgba(234, 88, 12, 0));
    animation: app-loader-bar 1.2s ease-in-out infinite;
}
@keyframes app-loader-bar { 0% { left: -42%; } 100% { left: 102%; } }

.app-loader-card { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; }

/* Orb: soft orange track, bright orange arc spinning, orange gradient badge with the section icon */
.app-loader-orb { position: relative; width: 84px; height: 84px; }
.app-loader-orb__track,
.app-loader-orb__ring {
    position: absolute; inset: 0; border-radius: 50%;
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
}
.app-loader-orb__track { background: rgba(234, 88, 12, 0.16); }
.app-loader-orb__ring {
    background: conic-gradient(from 0deg, rgba(249, 115, 22, 0) 0deg, #fdba74 90deg, #f97316 200deg, #ea580c 300deg, rgba(234, 88, 12, 0) 360deg);
    animation: app-loader-spin 0.9s linear infinite;
}
.app-loader-orb__core {
    position: absolute; inset: 13px; border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
    color: #fff; font-size: 1.3rem;
    box-shadow: 0 10px 24px -8px rgba(234, 88, 12, 0.65);
    animation: app-loader-breathe 1.6s ease-in-out infinite;
}
.app-loader-orb__core .fa-spinner { animation: app-loader-spin 1s linear infinite; }

@keyframes app-loader-spin { to { transform: rotate(360deg); } }
@keyframes app-loader-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.app-loader-label {
    margin: 0; padding: 0.3rem 0.85rem; border-radius: 999px;
    font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em;
    color: #c2410c; background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(251, 146, 60, 0.45);
}
.dark .app-loader-label { color: #fdba74; background: rgba(124, 45, 18, 0.35); border-color: rgba(251, 146, 60, 0.4); }

@media (prefers-reduced-motion: reduce) {
    .app-loader-orb__ring { animation-duration: 2.4s; }
    .app-loader-orb__core { animation: none; }
    .app-loader-bar span { animation-duration: 2.5s; }
    .app-page-loader { transition-duration: 0.01ms; }
}
