.file_login {
    position: fixed;
    inset: 0;
    z-index: 2147483646; /* very high but allow container to be one step above */
}

.file_login_wrapper {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35); /* dim overlay (no blur by default on non-protected pages) */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    z-index: 2147483645; /* below popup container */
    /* No blur by default */
}

/* Apply blur only on protected pages when guest opens the popup */
body.ster-ra-protected-guest .file_login_wrapper {
    -webkit-backdrop-filter: blur(6px) brightness(.9);
    backdrop-filter: blur(6px) brightness(.9);
}

.file_login_container {
    background: #ffffff;
    max-width: 480px;
    width: 90%;
    border-radius: 10px;
    /* Use wrapper flex centering to avoid transform/fixed issues with theme */
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    z-index: 2147483647 !important;
    padding: 24px 24px 16px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.3);
    /* If the screen is short, allow the register form to scroll */
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.file_login_hide {
    position: absolute;
    top: 8px;
    right: 8px;
}

.file_login_close_span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 16px;
    background: rgba(0,0,0,0.4);
    cursor: pointer;
    transition: background 0.2s ease;
}

.file_login_close_span:hover {
    background: rgba(0,0,0,0.6);
}

.file_login_content {
    margin-top: 24px;
}

.file_login_tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.file_login_tab {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    border-radius: 3px;
    background: #eee;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.file_login_tab.active {
    background: #444;
    color: #fff;
}

.ster-ra-login-form input,
.ster-ra-register-form input {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 8px;
    border: 1px solid #ccc;
}

/* Make inputs match the design: taller, rounded corners */
.ster-ra-login-form input,
.ster-ra-register-form input,
.ster-ra-lost-form input {
    padding: 14px 16px;
    border-radius: 10px;
    height: 48px;
    box-sizing: border-box;
}

.ster-ra-login-form button,
.ster-ra-register-form button,
.ster-ra-lost-form button {
    display: block;
    width: 100%;
    padding: 14px 0;
    border: none;
    background: #e4013b;
    color: #fff;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 18px;
    margin-bottom: 8px;
    transition: background 0.2s;
    box-shadow: none;
    letter-spacing: 0.01em;
}
.ster-ra-login-form button:hover,
.ster-ra-register-form button:hover,
.ster-ra-lost-form button:hover {
    background: #b9002e;
}

/* Primary styled button matching the screenshots */
.ster-ra-btn {
    background: #e4013b; /* primary brand red */
    color: #ffffff;
    padding: 14px 0;
    border-radius: 10px;
    font-weight: 700;
    font-size: 18px;
    border: none;
    cursor: pointer;
    display: block;
    width: 100%;
    margin-top: 16px;
    margin-bottom: 8px;
    transition: filter 0.15s;
    box-shadow: 0 2px 8px rgba(228,1,59,0.08);
    letter-spacing: 0.01em;
}

.ster-ra-btn:hover {
    filter: brightness(0.93);
}
.ster-ra-login-form input,
.ster-ra-register-form input,
.ster-ra-lost-form input {
    padding: 14px 16px;
    border-radius: 10px;
    height: 48px;
    box-sizing: border-box;
    font-size: 16px;
}
/* Scrollable registration form for small screens */
@media (max-width: 600px) {
    .file_login_container {
        max-width: 100vw;
        width: 100vw;
        min-height: 60vh;
        max-height: 95vh;
        overflow-y: auto;
        border-radius: 10px;
        padding: 18px 6px 12px 6px;
    }
    .ster-ra-login-form input,
    .ster-ra-register-form input {
        font-size: 15px;
        height: 44px;
    }
    .ster-ra-btn {
        font-size: 16px;
        padding: 12px 0;
    }
}

.ster-ra-error {
    color: #cc0000;
    margin-bottom: 10px;
}

.ster-ra-success,
.ster-ra-notice {
    color: #008000;
    margin-bottom: 10px;
}

.ster-ra-lost-result {
    display: block;
    padding: 8px 10px;
    margin-bottom: 10px;
    border-radius: 4px;
}
.ster-ra-lost-result.success {
    background: #e6f7ea;
    color: #1b6b21;
    border: 1px solid #c2e5c7;
}
.ster-ra-lost-result.error {
    background: #fff0f0;
    color: #cc0000;
    border: 1px solid #f2c2c2;
}

/* When the popup is open on protected pages we obscure the rest of the page
   to prevent reading/copying content while leaving the popup interactive. */
/* Simpler and more reliable approach:
   - Apply a gentle blur + dim to every element when obscured
   - Then restore pointer-events and remove blur for the popup and
     for common cookie/banner widgets so they stay visible and usable
*/
/* No global blur: rely on the fixed wrapper overlay to darken and block interaction
   beneath the popup. This avoids stacking-context/filter issues that can move the popup. */

/* On small devices use a slightly smaller blur to preserve usability */
@media (max-width: 480px) {
    .file_login_wrapper {
        align-items: flex-end; /* on small screens show popup from bottom */
        padding: 16px;
    }

    .file_login_container {
        position: relative;
        width: 100%;
        max-width: 100%;
        border-radius: 8px 8px 0 0;
        margin: 0 auto;
    }
}

/* Hard overrides to resist legacy/theme popup styles that force width/height/margins */
.file_login .file_login_wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.file_login .file_login_container {
    width: 90% !important;
    max-width: 480px !important;
    height: auto !important;
    margin: 0 !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    overflow-y: auto !important;
}
