/* =====================================================
   MICROTRUST CREDIT UNION — GLOBAL PAGE LOADER
   assets/css/page-loader.css

   Color palette (1:1 brand match with nav.php):
   Background : #1a1a2e  (hp-navy, frosted)
   Mark font  : Libre Baskerville — loaded via @import
   Wordmark   : Josefin Sans — loaded via @import
   Gold       : #c9a84c
   Subtext    : rgba(255,255,255,0.55)
   ===================================================== */

/* Load brand fonts directly — can't rely on the page's
   own <link> tags being parsed before this CSS fires    */
@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@700&family=Libre+Baskerville:wght@700&display=swap');

/* ── Overlay ── */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 26, 46, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* ── Center content column ── */
.page-loader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    user-select: none;
}

/* ── Spinner ── */
.page-loader-spinner {
    position: relative;
    width: 100px;
    height: 100px;
}

.pl-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 3px solid transparent;
}

/* Outer ring */
.pl-ring-1 {
    width: 100px;
    height: 100px;
    margin: -50px 0 0 -50px;
    border-top-color: #c9a84c;
    animation: plSpin 1.8s linear infinite;
}

/* Middle ring */
.pl-ring-2 {
    width: 74px;
    height: 74px;
    margin: -37px 0 0 -37px;
    border-right-color: #b8962a;
    animation: plSpin 1.3s linear infinite reverse;
}

/* Inner ring */
.pl-ring-3 {
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border-bottom-color: rgba(201, 168, 76, 0.7);
    animation: plSpin 0.9s linear infinite;
}

/* Center pulsing dot */
.pl-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    background: #c9a84c;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: plDotPulse 1.4s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(201, 168, 76, 0.55);
}

/* ── Logo block — mirrors .hfn-logo in nav.php exactly ── */
.page-loader-logo {
    display: flex;
    align-items: center;
    animation: plPulse 2s ease-in-out infinite;
}

/* Horizontal lockup: [MT box] + divider + stacked text — identical structure to .hfn-logo */
.pl-logo-lockup {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* MT mark box — identical to .hfn-logo-box */
.pl-logo-mark {
    width: 38px;
    height: 38px;
    border: 2px solid #c9a84c;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pl-logo-mark span {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #c9a84c;
    letter-spacing: -0.02em;
    line-height: 1;
}

/* Vertical divider — identical to .hfn-logo-divider */
.pl-logo-divider {
    width: 1px;
    height: 28px;
    background: rgba(201, 168, 76, 0.35);
    flex-shrink: 0;
}

/* Stacked text block — identical to .hfn-logo-text */
.pl-logo-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* "MICROTRUST" — identical to .hfn-logo-line1 */
.pl-logo-line1 {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: #c9a84c;
    letter-spacing: 0.2em;
    line-height: 1;
    white-space: nowrap;
}

/* "CREDIT UNION" — identical to .hfn-logo-line2 */
.pl-logo-line2 {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.52rem;
    font-weight: 700;
    color: #c9a84c;
    letter-spacing: 5px;
    line-height: 1;
    white-space: nowrap;
    padding-top: 2px;
}

/* ── Subtext ── */
.page-loader-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0;
    animation: plFadeSlide 1.8s ease-in-out infinite;
}

/* =====================================================
   KEYFRAMES
   ===================================================== */

@keyframes plSpin {
    100% { transform: rotate(360deg); }
}

@keyframes plPulse {
    0%, 100% { opacity: 1;   transform: scale(1); }
    50%       { opacity: 0.8; transform: scale(0.97); }
}

@keyframes plDotPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 10px rgba(201, 168, 76, 0.45);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        box-shadow: 0 0 20px rgba(201, 168, 76, 0.7);
    }
}

@keyframes plFadeSlide {
    0%, 100% { opacity: 0.5; transform: translateY(0); }
    50%       { opacity: 1;   transform: translateY(-2px); }
}

/* ── Fade out state (added by page-loader.js) ── */
.page-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.page-loader.hidden {
    display: none;
}

/* ── Dark mode ── */
body.dark-mode .page-loader,
[data-theme="dark"] .page-loader {
    background: rgba(20, 20, 36, 0.97);
}