/*
 * AA-Customizer  ·  Login Page SPA
 * Prefix: aac-spa-*  (no collisions with Bootstrap or Alliance Auth)
 *
 * This file is loaded automatically when `login_spa_enabled` is True.
 * Page content comes from <section data-route="..."> elements provided
 * via the "Login Page — Extra Body HTML" admin field.
 */

/* ── hidden content source (always invisible; JS reads from it) ──────── */
#aac-spa-body-src,
#aac-spa-content { display: none !important; }

/* ── overlay ──────────────────────────────────────────────────────────── */
#aac-spa {
    position: fixed;
    inset: 0;
    z-index: 9999;
    /* display: none by default; JS sets to flex when a route is active */
    display: none;
    flex-direction: column;
    /* the login background (image / video / colour) shows through */
}

/* ── nav ──────────────────────────────────────────────────────────────── */
#aac-spa-nav {
    display: flex;
    align-items: center;
    padding: 0 2rem;
    height: 56px;
    background: rgba(10, 10, 15, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 1rem;
}

#aac-spa-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #c4b5fd;
    flex: 1;
    white-space: nowrap;
}

.aac-spa-diamond { color: #8b5cf6; font-size: 1.1rem; }

#aac-spa-links {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    gap: 0.2rem;
    align-items: center;
}

#aac-spa-links a {
    display: block;
    padding: 0.4rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

#aac-spa-links a:hover,
#aac-spa-links a.aac-spa-active {
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.15);
    text-decoration: none;
}

#aac-spa-signin-link {
    display: block;
    padding: 0.4rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
    margin-left: 0.5rem;
    white-space: nowrap;
    transition: all 0.15s;
}
#aac-spa-signin-link:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
    color: #fbbf24;
    text-decoration: none;
}

/* hamburger — hidden on desktop */
#aac-spa-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 22px; height: 16px;
    background: none; border: none;
    cursor: pointer; padding: 0;
    margin-left: 0.5rem;
}
#aac-spa-menu-btn span {
    display: block;
    height: 2px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
    transition: opacity 0.15s;
}

@media (max-width: 600px) {
    #aac-spa-menu-btn { display: flex; }
    #aac-spa-links {
        position: absolute;
        top: 56px; left: 0; right: 0;
        flex-direction: column;
        background: rgba(10, 10, 15, 0.95);
        border-bottom: 1px solid rgba(139, 92, 246, 0.3);
        padding: 0.75rem 1rem;
        gap: 0.1rem;
        display: none;
    }
    #aac-spa-links.open { display: flex; }
    #aac-spa-links a { padding: 0.6rem 0.85rem; }
    #aac-spa-signin-link { margin-left: 0; }
}

/* ── view / content area ─────────────────────────────────────────────── */
#aac-spa-view {
    flex: 1;
    min-height: 0;       /* flex scroll fix: allows item to shrink so overflow-y can actually scroll */
    overflow-y: auto;
    padding: 0;
    display: block !important; /* some auth-framework theme CSS applies display:flex to <main>;
                                  force block so injected section children stack vertically */
}

/* ── shared page wrapper (applied by convention in user's section HTML) ── */
.aac-spa-page {
    max-width: 640px;
    width: 100%;
    margin: 0 auto;        /* horizontal centering (was handled by parent flex) */
    padding: 3rem 0;       /* breathing room for short sections */
    text-align: center;
    color: #fff;
}

/* ── hero / home ─────────────────────────────────────────────────────── */
.aac-spa-corp-tag {
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(139, 92, 246, 0.7);
    font-family: 'Courier New', monospace;
    margin-bottom: 0.75rem;
}

.aac-spa-hero-title {
    font-size: clamp(2rem, 7vw, 4.5rem);
    font-weight: 900;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 50px rgba(139, 92, 246, 0.55), 0 0 100px rgba(139, 92, 246, 0.2);
    margin: 0 0 0.5rem;
    line-height: 1.1;
}

.aac-spa-hero-sub {
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 2.5rem;
}

.aac-spa-hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── inner pages ─────────────────────────────────────────────────────── */
.aac-spa-page-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #c4b5fd;
    margin-bottom: 1.25rem;
}

.aac-spa-body-text {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.95rem;
    line-height: 1.75;
    max-width: 520px;
    margin: 0 auto;
}

/* stat row */
.aac-spa-stat-row {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}
.aac-spa-stat { text-align: center; }
.aac-spa-stat-num {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: #8b5cf6;
    line-height: 1;
}
.aac-spa-stat-label {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.3rem;
}

/* requirements list */
.aac-spa-req-list {
    list-style: none;
    padding: 0; margin: 0 auto;
    max-width: 400px;
    text-align: left;
}
.aac-spa-req-list li {
    padding: 0.65rem 0 0.65rem 1.75rem;
    position: relative;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.12);
}
.aac-spa-req-list li::before {
    content: "◆";
    position: absolute;
    left: 0;
    color: #8b5cf6;
    font-size: 0.55rem;
    top: 50%; transform: translateY(-50%);
}

/* ── buttons ─────────────────────────────────────────────────────────── */
.aac-spa-btn {
    display: inline-block;
    padding: 0.65rem 1.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.15s;
    cursor: pointer;
}

.aac-spa-btn-primary {
    background: #8b5cf6;
    color: #fff !important;
    border: 1px solid #8b5cf6;
}
.aac-spa-btn-primary:hover {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #fff !important;
    box-shadow: 0 0 24px rgba(139, 92, 246, 0.45);
    text-decoration: none;
}

.aac-spa-btn-outline {
    background: transparent;
    color: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.aac-spa-btn-outline:hover {
    border-color: rgba(139, 92, 246, 0.6);
    color: #c4b5fd !important;
    background: rgba(139, 92, 246, 0.1);
    text-decoration: none;
}
