/*
 * BGNU loaders (from the "BGNU loaders & logo animation" design).
 * Markup comes from <x-bgnu-loader type="…"> (resources/views/components/bgnu-loader.blade.php):
 *   splash  1a  round seal on a white medallion (always visible), glow, orbiting gold ring, sheen, wordmark; navy
 *   orbit   1b  seal medallion in a spinning gold orbit, navy
 *   ring    1c  full seal medallion inside a ring of 12 pulsing dots, light surface  (page loader)
 *   fill    1d  shield fills bottom-up with a gold progress bar, navy
 *   seal    1e  small seal spinner for cards / panels
 *   dots    1e  three bouncing dots, inline with text
 *   spin    1e  button spinner (use inside dark buttons)
 * All class names start with "bgl-" (the theme already ships FullCalendar ".fc" and others).
 */
.bgl { --bgl-navy: #12204a; --bgl-navy-2: #1a2d63; --bgl-gold: #d4b475; --bgl-gold-2: #b88a3a; --bgl-ink: #3a4260;
       display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
       font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; line-height: 1.4; }
.bgl *, .bgl *::before, .bgl *::after { box-sizing: border-box; }
.bgl-label { font-size: 12px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: #5b6276; text-align: center; padding-left: .3em; }

/* Seal medallion: the WHOLE round seal (images/login/bgnu-seal.webp, square, centred, navy on white) on a white disc
   with a thin gold rim. The image is never cropped: its artwork fits inside the circle. */
.bgl-face { position: absolute; border-radius: 50%; overflow: hidden; background: #fff; box-shadow: 0 0 0 2px rgba(212, 180, 117, .85); }
.bgl .bgl-face img { position: absolute; display: block; inset: 0; width: 100%; height: 100%; max-width: none; left: 0; top: 0; right: auto; margin: 0; }

/* ---------- 1c ring (light) ---------- */
.bgl-ring-box { position: relative; width: var(--bgl-size, 150px); height: var(--bgl-size, 150px); }
.bgl-ring-dot { position: absolute; inset: 0; }
.bgl-ring-dot i { position: absolute; left: 50%; top: 0; width: 6%; height: 6%; margin-left: -3%; border-radius: 50%; background: #1b2f6b;
                  animation: bglDot 1.2s ease-in-out infinite; }
.bgl-ring-dot.gold i { background: var(--bgl-gold-2); }
.bgl-ring .bgl-face { inset: 16%; box-shadow: 0 0 0 2px rgba(212, 180, 117, .85), 0 8px 24px rgba(18, 32, 74, .25); }

/* ---------- 1b orbit (navy) ---------- */
.bgl-orbit .bgl-label { color: rgba(244, 239, 227, .75); }
.bgl-orbit-box { position: relative; width: var(--bgl-size, 150px); height: var(--bgl-size, 150px); }
.bgl-orbit-arc { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(212, 180, 117, .15); border-top-color: var(--bgl-gold); border-right-color: var(--bgl-gold);
                 animation: bglSpin 1.4s cubic-bezier(.5, .15, .5, .85) infinite; }
.bgl-orbit-dash { position: absolute; inset: 6%; border-radius: 50%; border: 1px dashed rgba(212, 180, 117, .35); animation: bglSpinRev 9s linear infinite; }
.bgl-orbit-sat { position: absolute; inset: 0; animation: bglSpin 2.8s linear infinite; }
.bgl-orbit-sat i { position: absolute; left: 50%; top: -4px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #f0dca8; box-shadow: 0 0 12px 3px rgba(240, 220, 168, .6); }
.bgl-orbit .bgl-face { inset: 13.33%; animation: bglBreath 2.8s ease-in-out infinite; }

/* ---------- 1d shield fill (navy) ---------- */
.bgl-fill { gap: 24px; }
.bgl-fill-box { position: relative; width: var(--bgl-size, 120px); aspect-ratio: 200 / 283; }
.bgl-fill-box img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bgl-fill-box .ghost { opacity: .16; filter: grayscale(1) brightness(1.6); }
.bgl-fill-box .full { animation: bglFill 3s cubic-bezier(.5, 0, .3, 1) infinite; }
.bgl-fill-bar { width: 160px; height: 3px; border-radius: 2px; background: rgba(212, 180, 117, .18); overflow: hidden; }
.bgl-fill-bar i { display: block; height: 100%; background: var(--bgl-gold); animation: bglBar 3s cubic-bezier(.5, 0, .3, 1) infinite; }
.bgl-fill .bgl-label { color: rgba(244, 239, 227, .75); }

/* Gold sheen clipped to the logo shape (1a, 1d) */
.bgl-sheen { position: absolute; inset: 0; overflow: hidden; pointer-events: none;
             -webkit-mask-image: url(../images/login/bgnu-logo.webp); mask-image: url(../images/login/bgnu-logo.webp);
             -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
.bgl-sheen i { position: absolute; top: -10%; bottom: -10%; width: 36%; background: linear-gradient(90deg, rgba(255, 240, 205, 0), rgba(255, 240, 205, .42), rgba(255, 240, 205, 0)); }
.bgl-fill .bgl-sheen i { animation: bglSheen 3s ease-in-out infinite; }

/* ---------- 1a splash (navy) ----------
   The seal is the priority: the round university seal (images/login/bgnu-seal.webp, navy on white) sits on a
   white medallion and is fully visible from the first frame (short fade-in only, never masked or hidden).
   All the motion happens AROUND it: soft gold glow, a gold arc + dashed ring orbiting the medallion,
   a travelling dot, and a light sheen passing over the seal. */
.bgl-splash { gap: 18px; }
.bgl-splash-stage { position: relative; width: min(var(--bgl-size, 320px), calc(100vw - 40px)); aspect-ratio: 1; }
.bgl-splash-glow { position: absolute; inset: 4%; border-radius: 50%;
                   background: radial-gradient(closest-side, rgba(212, 180, 117, .34) 62%, rgba(212, 180, 117, .10) 80%, rgba(212, 180, 117, 0));
                   animation: bglGlow 2.8s ease-in-out infinite; }
.bgl-splash-arc { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(212, 180, 117, .14); border-top-color: var(--bgl-gold); border-right-color: var(--bgl-gold);
                  animation: bglSpin 1.6s cubic-bezier(.5, .15, .5, .85) infinite; }
.bgl-splash-dash { position: absolute; inset: 5%; border-radius: 50%; border: 1px dashed rgba(212, 180, 117, .40); animation: bglSpinRev 14s linear infinite; }
.bgl-splash-sat { position: absolute; inset: 0; animation: bglSpin 3.2s linear infinite; }
.bgl-splash-sat i { position: absolute; left: 50%; top: -4px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #f0dca8; box-shadow: 0 0 12px 3px rgba(240, 220, 168, .6); }
.bgl-splash-box { position: absolute; inset: 12%; border-radius: 50%; overflow: hidden; background: #fff;
                  box-shadow: 0 0 0 3px rgba(212, 180, 117, .85), 0 0 0 7px rgba(212, 180, 117, .16), 0 18px 40px rgba(4, 10, 30, .5);
                  animation: bglLogoIn .45s cubic-bezier(.2, .8, .2, 1) both; }
.bgl-splash-box > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; display: block; }
.bgl-splash .bgl-sheen { -webkit-mask-image: none; mask-image: none; border-radius: 50%; }
.bgl-splash .bgl-sheen i { width: 34%; background: linear-gradient(90deg, rgba(212, 180, 117, 0), rgba(212, 180, 117, .22), rgba(212, 180, 117, 0)); animation: bglSheenB 3.2s ease-in-out infinite; }
.bgl-splash-word { display: flex; flex-direction: column; align-items: center; gap: 10px; animation: bglWordIn .6s ease .2s both; }
.bgl-splash-word i { width: 120px; height: 1px; background: var(--bgl-gold); }
.bgl-splash-word span { font-size: 12px; font-weight: 600; letter-spacing: .32em; text-transform: uppercase; color: #f4efe3; text-align: center; padding-left: .32em; }

/* Navy full-screen surface for splash / orbit / fill */
.bgl-screen { position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center; padding: 16px;
              background: radial-gradient(90% 80% at 50% 30%, #1c2f68 0%, #111f47 55%, #0a1430 100%); }
.bgl-screen[hidden] { display: none; }

/* ---------- 1e inline ---------- */
.bgl-inline { flex-direction: row; gap: 14px; }
.bgl-inline .bgl-text { font-size: 14px; color: var(--bgl-ink); letter-spacing: 0; text-transform: none; font-weight: 500; }
.bgl-seal-box { position: relative; width: var(--bgl-size, 40px); height: var(--bgl-size, 40px); flex: none; }
.bgl-seal-box > i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #ebe5d6; border-top-color: var(--bgl-gold-2); animation: bglSpin 1s linear infinite; }
.bgl-seal-box .bgl-face { inset: 15%; }
.bgl-dots-row { display: inline-flex; gap: 6px; }
.bgl-dots-row i { width: 7px; height: 7px; border-radius: 50%; background: var(--bgl-navy); animation: bglBounce 1.2s ease-in-out infinite; }
.bgl-dots-row i:nth-child(2) { background: var(--bgl-gold-2); animation-delay: .15s; }
.bgl-dots-row i:nth-child(3) { animation-delay: .3s; }
.bgl-spin { display: inline-block; width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid rgba(246, 241, 228, .3); border-top-color: var(--bgl-gold, #d4b475);
            animation: bglSpin .8s linear infinite; vertical-align: middle; }
.bgl-spin[hidden] { display: none; }

/* ---------- Page loader: replaces the theme's single-logo #global-loader ---------- */
#global-loader.bgl-page { display: flex; align-items: center; justify-content: center; background: #f6f3ec; text-align: center; }
#global-loader.bgl-page .bgl-face img { position: absolute; top: 0; left: 0; right: auto; width: 100%; height: 100%; margin: 0; }
.dark-mode #global-loader.bgl-page { background: #f6f3ec; }

/* ---------- Keyframes ---------- */
@keyframes bglSpin { to { transform: rotate(360deg); } }
@keyframes bglSpinRev { to { transform: rotate(-360deg); } }
@keyframes bglBreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes bglDot { 0%, 100% { opacity: .18; transform: scale(.7); } 40% { opacity: 1; transform: scale(1.15); } }
@keyframes bglBounce { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-6px); opacity: 1; } }
@keyframes bglFill { 0% { clip-path: inset(100% 0 0 0); } 80%, 100% { clip-path: inset(0 0 0 0); } }
@keyframes bglBar { 0% { width: 0%; } 80%, 100% { width: 100%; } }
@keyframes bglSheen { 0%, 55% { transform: translateX(-140%) skewX(-18deg); } 85%, 100% { transform: translateX(240%) skewX(-18deg); } }
@keyframes bglSheenB { 0%, 45% { transform: translateX(-160%) skewX(-20deg); } 80%, 100% { transform: translateX(260%) skewX(-20deg); } }
@keyframes bglLogoIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes bglWordIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes bglGlow { 0%, 100% { opacity: .55; transform: scale(.97); } 50% { opacity: 1; transform: scale(1.03); } }

/* Reduced motion: keep a gentle sign of activity, drop the travel */
@media (prefers-reduced-motion: reduce) {
    .bgl-orbit-arc, .bgl-seal-box > i, .bgl-spin, .bgl-splash-arc { animation-duration: 3s; }
    .bgl-orbit-dash, .bgl-orbit-sat, .bgl-orbit .bgl-face, .bgl-sheen i, .bgl-splash-dash, .bgl-splash-sat, .bgl-splash-glow,
    .bgl-splash-box, .bgl-splash-word { animation: none; }
}

/* Larger inline text (e.g. dashboard attendance check) */
.bgl-lg .bgl-text { font-size: 16px; font-weight: 600; color: #12204a; }
.bgl-inline.bgl-lg { padding: 14px 0; }
