/* Only account forms receive this treatment; payment and notice dialogs stay scoped out. */
body.qfo-auth-open > .dimmer {
    background: rgba(0, 0, 0, .78);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    z-index: 1090;
}

.ri-popup.qfo-auth-dialog {
    z-index: 1100;
    padding: 18px 16px;
}

.qfo-auth-dialog .ri-popup-body {
    max-width: 100%;
    max-height: 100%;
    padding-top: 0;
    padding-bottom: 48px;
    margin: auto;
}

.qfo-auth-dialog .ri-popup-content,
.login-and-register .col-12 > .bg-white {
    position: relative;
    border: 1px solid rgba(160, 188, 245, .45);
    border-radius: 18px !important;
    box-shadow: 0 20px 64px rgba(0, 0, 0, .32), 0 0 28px rgba(113, 160, 255, .1);
}

/* An independent border layer preserves the theme's light/dark card surface. */
@supports ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
    .qfo-auth-dialog .ri-popup-content,
    .login-and-register .col-12 > .bg-white {
        border-color: transparent;
    }

    .qfo-auth-dialog .ri-popup-content::before,
    .login-and-register .col-12 > .bg-white::before {
        content: "";
        position: absolute;
        z-index: 2;
        inset: 0;
        padding: 1px;
        border-radius: inherit;
        background: linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(127, 218, 255, .85) 18%, rgba(140, 170, 255, .22) 42%, rgba(180, 153, 255, .7) 72%, rgba(255, 255, 255, .95));
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        pointer-events: none;
    }
}

.qfo-auth-dialog .ri-popup-content {
    max-height: calc(100vh - 90px);
    max-height: calc(100dvh - 90px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.qfo-auth-dialog .ri-popup-close { bottom: 4px; transform: none; }

.login-and-register.bg-type-none {
    display: flex;
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    background: #080808;
}

.login-and-register.bg-type-none > .container {
    height: auto !important;
    min-height: 100vh;
    min-height: 100svh;
}

/* Keep account inputs legible against the black dialog, including browser autofill. */
[data-bs-theme=dark] :is(.qfo-auth-dialog, .login-and-register) .account-from .form-control {
    --qfo-auth-input-ring: 0 0 0 0 transparent;
    color-scheme: dark;
    background-color: #171a20;
    border-color: #647084;
    color: #f4f6fb;
    caret-color: #f4f6fb;
    box-shadow: var(--qfo-auth-input-ring);
}

[data-bs-theme=dark] :is(.qfo-auth-dialog, .login-and-register) .account-from .form-control::placeholder {
    color: #b6bfce;
    opacity: 1;
}

[data-bs-theme=dark] :is(.qfo-auth-dialog, .login-and-register) .account-from .form-control:focus {
    --qfo-auth-input-ring: 0 0 0 3px rgba(137, 177, 255, .24);
    border-color: #9fc2ff;
}

[data-bs-theme=dark] :is(.qfo-auth-dialog, .login-and-register) .account-from .form-control:disabled {
    background-color: #111317;
    border-color: #3f4857;
    color: #a4adba;
}

[data-bs-theme=dark] :is(.qfo-auth-dialog, .login-and-register) .account-from .form-control:is(:-webkit-autofill, :autofill) {
    -webkit-text-fill-color: #f4f6fb;
    -webkit-box-shadow: inset 0 0 0 1000px #171a20, var(--qfo-auth-input-ring);
    box-shadow: inset 0 0 0 1000px #171a20, var(--qfo-auth-input-ring);
}

[data-bs-theme=dark] :is(.qfo-auth-dialog, .login-and-register) .account-from .form-label {
    color: #e4e9f2;
}

/* Match the VIP call to action without recoloring third-party login buttons. */
:is(.qfo-auth-dialog, .login-and-register) .account-from button[type=submit] {
    --qfo-auth-button-focus: #6354cc;
    background: linear-gradient(115deg, #465fe0, #7745c7) !important;
    border-color: rgba(154, 176, 255, .65) !important;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(89, 76, 187, .18);
}

:is(.qfo-auth-dialog, .login-and-register) .account-from button[type=submit]:hover:not(:disabled):not(.disabled) {
    background: linear-gradient(115deg, #3c52c8, #6536b3) !important;
    color: #fff;
}

:is(.qfo-auth-dialog, .login-and-register) .account-from button[type=submit]:focus-visible {
    outline: 2px solid var(--qfo-auth-button-focus);
    outline-offset: 3px;
}

[data-bs-theme=dark] :is(.qfo-auth-dialog, .login-and-register) .account-from button[type=submit] {
    --qfo-auth-button-focus: #b3a7ff;
}

:is(.qfo-auth-dialog, .login-and-register) .account-from button[type=submit]:is(:disabled, .disabled) {
    background: #667085 !important;
    border-color: #667085 !important;
    color: #fff;
    box-shadow: none;
    opacity: 1;
}

@media (max-width: 575.98px) {
    .login-and-register .col-12 { padding-left: 16px; padding-right: 16px; }
    .login-and-register .col-12 > .bg-white > div { padding-left: 20px !important; padding-right: 20px !important; }
}

@media (prefers-reduced-motion: reduce) {
    .qfo-auth-dialog .ri-popup-body,
    .qfo-auth-dialog .ri-popup-close .svg-close { transition: none; }
}
