/* Login: full-screen animation, form card on top */

html.login-stage,
html.login-stage body {
    min-height: 100%;
    min-height: 100dvh;
    background: #05070a;
    overflow: auto;
}

html.login-stage body {
    -webkit-font-smoothing: antialiased;
}

.cx-screen {
    --red: #ff3344;
    --ink: #fff;
    --sub: rgba(255, 255, 255, 0.78);
    --lab: #7c8795;
    position: relative;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(28px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
    overflow: hidden;
    background: #05070a;
}

.cx-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.cx-bg video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.cx-bg2,
.cx-scrim {
    display: none;
}

html.login-stage-novideo .cx-bg {
    display: none;
}

.cx-dock {
    position: relative;
    z-index: 2;
    width: min(440px, 100%);
    direction: rtl;
}

.cx-screen .auth-page {
    min-height: 0;
    padding: 0;
    display: block;
    overflow: visible;
    background: transparent;
}

.cx-screen .auth-card {
    width: 100%;
    max-width: none;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 22px;
    padding: 32px 28px 28px;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.22),
        inset 0 1px 1px rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(24px) saturate(1.45);
    -webkit-backdrop-filter: blur(24px) saturate(1.45);
    animation: none;
    position: relative;
    overflow: hidden;
}

.cx-screen .auth-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.2px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.42) 0%,
        rgba(255, 255, 255, 0.12) 22%,
        rgba(255, 255, 255, 0) 45%,
        rgba(255, 255, 255, 0) 58%,
        rgba(255, 255, 255, 0.1) 82%,
        rgba(255, 255, 255, 0.28) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.cx-screen .auth-header {
    text-align: center;
    margin-bottom: 22px;
}

.cx-screen .auth-logo {
    width: 88px;
    height: 88px;
    margin: 0 auto 14px;
    filter: none;
    overflow: visible;
}

.cx-screen .auth-logo::after {
    display: none;
}

.cx-screen .auth-logo img,
.cx-screen .auth-logo .vira-mark {
    border-radius: 28%;
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 46%, rgba(0, 0, 0, 0.55) 62%, transparent 78%);
    mask-image: radial-gradient(circle at 50% 50%, #000 46%, rgba(0, 0, 0, 0.55) 62%, transparent 78%);
}

.cx-screen .auth-title {
    font-weight: 700;
    font-size: 1.65rem;
    line-height: 1.25;
    color: var(--ink);
    margin: 0 0 8px;
}

.cx-screen .auth-subtitle {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--sub);
}

.cx-screen .login-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 22px;
    background: rgba(255, 255, 255, 0.06);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cx-screen .login-tab {
    flex: 1;
    border-radius: 9px;
    background: transparent;
    color: var(--lab);
    font-weight: 600;
    font-size: 0.92rem;
    padding: 11px 8px;
    border: none;
    margin: 0;
}

.cx-screen .login-tab:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.04);
}

.cx-screen .login-tab.active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-bottom-color: transparent;
}

.cx-screen .form-label {
    color: var(--lab);
    font-size: 0.82rem;
}

.cx-screen .form-control {
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--ink);
}

.cx-screen .form-control:focus {
    border-color: rgba(255, 255, 255, 0.42);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.12);
}

.cx-screen .password-input-wrapper {
    position: relative;
}

.cx-screen .password-input-wrapper .form-control {
    padding-right: 46px;
    padding-left: 14px;
}

.cx-screen .toggle-password {
    position: absolute;
    right: 12px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.cx-screen .toggle-password:hover {
    color: #fff;
}

.cx-screen .btn-primary {
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    color: #1b2430 !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    box-shadow: none !important;
    font-weight: 600;
}

.cx-screen .btn-primary:hover {
    background: #fff !important;
    color: #111 !important;
    transform: none;
}

.cx-screen .btn-primary .spinner {
    border-color: rgba(27, 36, 48, 0.2);
    border-top-color: #1b2430;
}

.cx-screen .otp-input {
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
}

.cx-screen .otp-input:focus {
    border-color: rgba(255, 255, 255, 0.42);
}

.cx-screen .alert-error {
    border-radius: 10px;
    background: rgba(255, 51, 68, 0.12);
    border: 1px solid rgba(255, 51, 68, 0.4);
}

.cx-screen .password-hint,
.cx-screen .otp-timer,
.cx-screen .resend-btn,
.cx-screen .change-btn {
    color: var(--lab);
}

.cx-screen .otp-timer .time,
.cx-screen .change-btn,
.cx-screen .resend-btn {
    color: var(--red);
}

.cx-screen .countdown-container,
.cx-screen .countdown-item,
.cx-screen .modal-content {
    border-radius: 12px;
}

.cx-screen .remember-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cx-screen .remember-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #fff;
}

.cx-screen .remember-row label {
    cursor: pointer;
    color: var(--sub);
    margin: 0;
}

.cx-screen .btn-ghost {
    color: rgba(255, 255, 255, 0.72);
}

.cx-screen .btn-ghost:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

html.intro .cx-dock {
    opacity: 0;
    transform: translateY(12px);
}

@media (max-width: 599px) {
    .cx-screen {
        align-items: center;
        justify-content: center;
        padding:
            max(36px, calc(env(safe-area-inset-top) + 24px))
            18px
            max(28px, calc(env(safe-area-inset-bottom) + 18px));
    }

    .cx-bg video {
        object-position: center top;
    }

    .cx-dock {
        width: min(400px, 100%);
    }

    .cx-screen .auth-card {
        padding: 26px 18px 22px;
    }

    .cx-screen .auth-logo {
        width: 72px;
        height: 72px;
    }

    .cx-screen .auth-title {
        font-size: 1.4rem;
    }
}

@media (hover: hover) {
    .cx-screen .btn-primary:hover {
        background: #fff !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html.intro .cx-dock {
        opacity: 1;
        transform: none;
    }

    .cx-screen *,
    .cx-screen *::before,
    .cx-screen *::after {
        transition: none !important;
        animation: none !important;
    }
}

.cx-screen .password-notice {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.cx-screen .password-notice .notice-icon {
    color: rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
}

.cx-screen .password-notice .notice-text {
    color: var(--sub);
    font-size: 0.88rem;
    line-height: 1.7;
    margin: 0;
}

.cx-screen .otp-input-laser,
.cx-screen .otp-box {
    width: 48px;
    height: 56px;
    font-size: 1.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    color: #fff;
    font-weight: 700;
}

.cx-screen .otp-input-laser:focus,
.cx-screen .otp-box:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.42);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.cx-screen .otp-box.filled {
    border-color: rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.12);
}

.cx-screen :focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}
