.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -9999; /* force behind everything */
    overflow: hidden;
}

.video-background video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover; /* ensures cover behavior across sizes */
}

.content-overlay {
    position: relative; /* sits above the video (video z-index:-9999) */
    z-index: 1000; /* ensure content is well above nav/other elements */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: none; /* ensure no gradient overlay so video is fully visible */
}

.auth-panel {
    background: rgba(255, 255, 255, 0.06); /* subtle translucent container */
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: white;
    max-width: 640px;
    width: 92%;
    padding: 2.25rem;
    box-shadow: 0 6px 30px rgba(0,0,0,0.4);
}

/* Welcome page: remove background/border/shadow so video is fully visible behind content */
.auth-panel--no-bg {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0.75rem 0.75rem 1.5rem 0.75rem !important;
}

/* Scoped rules for the welcome page to remove scroll and ensure video covers viewport */
.welcome-page, .welcome-page html, .welcome-page body {
    height: 100vh;
}

.welcome-page {
    overflow: hidden; /* remove page scrolling on welcome only */
    background: transparent !important;
}

.welcome-page .video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
}

.welcome-page .video-background video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
}

/* Force removal of any background styles coming from global CSS inside the welcome page */
.welcome-page *,
.welcome-page *:before,
.welcome-page *:after {
    background: transparent !important;
}

/* Ensure the main container inside base_auth doesn't block the video */
.welcome-page .container,
.welcome-page main,
.welcome-page .bg-white,
.welcome-page .bg-background {
    background: transparent !important;
}

.welcome-page .content-overlay {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Backdrop that sits only behind the text (not the whole container) */
.welcome-page .text-backdrop {
    display: inline-block;
    background: rgba(0, 0, 0, 0.42);
    padding: 0.75rem 1.1rem;
    border-radius: 10px;
    max-width: 100%;
}

.welcome-page .text-backdrop h2, .welcome-page .text-backdrop p {
    margin: 0;
    color: #fff;
}

.auth-panel h2 {
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.auth-panel p {
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: rgba(255,255,255,0.03);
    border: 2px solid rgba(255,255,255,0.95);
    color: white;
    padding: 0.75rem 1.75rem;
    transition: all 0.22s ease;
    font-weight: 600;
    text-shadow: none;
    backdrop-filter: none;
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

/* Small control buttons for video (play fallback and unmute) */
.video-control-button, #video-play-btn, #video-unmute-btn {
    position: fixed;
    z-index: 2000;
    background: rgba(0,0,0,0.56);
    color: #fff;
    border: none;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}

#video-play-btn {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}


/* Mute button positioned bottom-right (persistent) */
#video-mute-btn, #video-unmute-btn {
    right: 1rem;
    bottom: 1rem;
    left: auto;
    transform: none;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
}

/* Ensure the mute button is visible even if other rules try to neutralize backgrounds */
#video-mute-btn {
    display: block !important;
    background: rgba(0,0,0,0.64) !important;
    color: #ffffff !important;
    z-index: 99999 !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    backdrop-filter: blur(4px) !important;
}

#video-mute-btn:hover {
    background: rgba(0,0,0,0.78) !important;
    transform: translateY(-2px);
}

/* Slightly smaller on small screens */
@media (max-width: 480px) {
    #video-unmute-btn {
        left: 0.6rem;
        bottom: 0.6rem;
        padding: 0.35rem 0.7rem;
        font-size: 0.85rem;
    }
    #video-play-btn { padding: 0.6rem 0.9rem; }
}
