@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --brand-start: #4f46e5;
    --brand-end: #7c3aed;
    --brand: #6366f1;
    --brand-h: #4f46e5;
    --glass-bg: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.25);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    overflow: hidden;
    position: relative;
}

.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 8s ease-in-out infinite;
}

.bg-orb-1 {
    width: 400px;
    height: 400px;
    background: var(--brand-start);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.bg-orb-2 {
    width: 300px;
    height: 300px;
    background: var(--brand-end);
    bottom: -80px;
    right: -80px;
    animation-delay: -3s;
}

.bg-orb-3 {
    width: 200px;
    height: 200px;
    background: #06b6d4;
    top: 50%;
    right: 10%;
    animation-delay: -5s;
}

@keyframes float {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(20px, -20px) scale(1.05);
    }

    66% {
        transform: translate(-10px, 15px) scale(0.95);
    }
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.card {
    position: relative;
    z-index: 10;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 52px 44px;
    width: 100%;
    max-width: 420px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    opacity: 0;
    transform: translateY(30px);
    animation: cardIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.brand-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.brand-icon i {
    font-size: 24px;
    color: #fff;
}

.brand-name {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.sub {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 40px;
    letter-spacing: 0.3px;
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    display: block;
}

.form-control {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    padding: 12px 16px;
    transition: all 0.25s ease;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    outline: none;
    color: #fff;
}

.form-control.error {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

.form-control.success {
    border-color: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15);
}

.input-group {
    position: relative;
}

#password {
    padding-right: 44px;
}

.eye {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.35);
    transition: color 0.2s;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
}

.eye:hover {
    color: rgba(255, 255, 255, 0.8);
}

.err {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13px;
    margin-bottom: 20px;
}

.field-err {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: shake 0.3s ease;
}

.field-err i {
    font-size: 13px;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

.btn-login {
    background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    padding: 14px;
    color: #fff;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    animation: fieldIn 0.5s ease 0.35s forwards;
}

.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--brand-end), var(--brand-start));
    opacity: 0;
    transition: opacity 0.25s;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
}

.btn-login:hover:not(:disabled)::before {
    opacity: 1;
}

.btn-login span,
.btn-login i {
    position: relative;
    z-index: 1;
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.field-group {
    opacity: 0;
    animation: fieldIn 0.5s ease forwards;
}

.field-group:nth-of-type(1) {
    animation-delay: 0.15s;
}

.field-group:nth-of-type(2) {
    animation-delay: 0.25s;
}

.login-slider {
    animation-delay: 0.3s;
}

.login-slider__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.login-slider__refresh {
    border: none;
    background: transparent;
    color: rgba(224, 231, 255, 0.82);
    font-size: 12px;
    padding: 0;
}

.login-slider__refresh:hover {
    color: #fff;
}

.login-slider__stage {
    position: relative;
    width: 100%;
    height: 132px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.login-slider__bg {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

.login-slider__piece {
    position: absolute;
    left: 0;
    top: 0;
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 8px 14px rgba(15, 23, 42, 0.35));
    pointer-events: none;
}

.login-slider__bar {
    position: relative;
    height: 42px;
    margin-top: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    user-select: none;
}

.login-slider__progress {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.34), rgba(34, 211, 238, 0.22));
}

.login-slider__handle {
    position: absolute;
    left: 0;
    top: 2px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    color: #4338ca;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.24);
    cursor: grab;
    touch-action: none;
}

.login-slider__handle:active {
    cursor: grabbing;
}

.login-slider__hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.58);
    font-size: 13px;
    pointer-events: none;
}

.login-slider.is-verified .login-slider__hint {
    color: #bbf7d0;
}

.login-slider.is-verified .login-slider__handle {
    color: #047857;
}

.login-slider__err {
    margin-top: 8px;
}

@keyframes fieldIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 16px;
    padding: 0 16px;
    color: rgba(148, 163, 184, 0.85);
    z-index: 1;
    pointer-events: none;
}

.so-password-expired-policy {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
}

.so-password-expired-policy__intro {
    color: rgba(226, 232, 240, 0.9);
}

/* 深色登录卡：覆盖 password-policy.css 中面向浅色背景的 Bootstrap 变量色 */
.so-password-expired-policy .so-password-strength__bar {
    background-color: rgba(255, 255, 255, 0.18);
}

.so-password-expired-policy .so-password-strength__label {
    color: rgba(226, 232, 240, 0.88);
}

.so-password-expired-policy .so-password-strength__label--weak {
    color: #fca5a5;
}

.so-password-expired-policy .so-password-strength__label--fair {
    color: #fdba74;
}

.so-password-expired-policy .so-password-strength__label--medium {
    color: #fde68a;
}

.so-password-expired-policy .so-password-strength__label--strong {
    color: #86efac;
}

.so-password-expired-policy .so-password-policy__item--pending {
    color: rgba(203, 213, 225, 0.92);
}

.so-password-expired-policy .so-password-policy__item--pending .bi {
    color: rgba(203, 213, 225, 0.7);
}

.so-password-expired-policy .so-password-policy__item--ok {
    color: #86efac;
}

.so-password-expired-policy .so-password-policy__item--fail {
    color: #fca5a5;
}

.login-sso-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
}

.login-sso-divider::before,
.login-sso-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
}

.btn-login-sso {
    border-color: rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    border-radius: 12px;
    padding: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-login-sso:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}
