/*
 * WordPress登录页面自定义样式
 * 为登录页面提供炫酷的视觉效果
 */

body.login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

/* 动态背景效果 */
body.login::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%), 
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%), 
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.3) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundFloat 20s ease-in-out infinite;
}

@keyframes backgroundFloat {
    0%, 100% { 
        opacity: 0.3; 
        transform: scale(1) rotate(0deg); 
    }
    50% { 
        opacity: 0.1; 
        transform: scale(1.1) rotate(5deg); 
    }
}

/* 粒子效果容器 */
body.login::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 160px 30px, #ddd, transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: sparkle 20s linear infinite;
    z-index: -1;
    opacity: 0.6;
}

@keyframes sparkle {
    from { transform: translateY(0px); }
    to { transform: translateY(-200px); }
}

#login {
    width: 400px;
    padding: 2rem 0;
    position: relative;
    z-index: 1;
}

/* 登录表单容器 */
#loginform {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 15px 30px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

/* 表单内部装饰效果 */
#loginform::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Logo区域 */
.login h1 {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.login h1 a {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    position: relative;
    transition: all 0.3s ease;
}

.login h1 a:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 5px 15px rgba(102, 126, 234, 0.4));
}

.login h1 a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.login h1 a:hover::after {
    width: 100%;
}

/* 输入字段样式 */
.login label {
    color: #4a5568;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: block;
    position: relative;
}

.login input[type="text"],
.login input[type="password"],
.login input[type="email"] {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.login input[type="text"]:focus,
.login input[type="password"]:focus,
.login input[type="email"]:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.1),
        0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

/* 输入字段动画效果 */
.login .input {
    position: relative;
    margin-bottom: 1.5rem;
}

.login .input::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 12px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.login .input:focus-within::before {
    opacity: 0.1;
}

/* 提交按钮 */
.wp-core-ui .button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    padding: 1rem 2rem;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.wp-core-ui .button-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.wp-core-ui .button-primary:hover::before {
    left: 100%;
}

.wp-core-ui .button-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.wp-core-ui .button-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

/* 复选框样式 */
.login .forgetmenot {
    margin: 1.5rem 0;
}

.login input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #667eea;
    border-radius: 4px;
    background: white;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
}

.login input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.login .forgetmenot label {
    color: #4a5568;
    font-size: 0.875rem;
    margin-left: 0.5rem;
    cursor: pointer;
}

/* 底部链接 */
#nav,
#backtoblog {
    text-align: center;
    margin-top: 1rem;
}

#nav a,
#backtoblog a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

#nav a:hover,
#backtoblog a:hover {
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#nav a::after,
#backtoblog a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 1px;
    background: white;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

#nav a:hover::after,
#backtoblog a:hover::after {
    width: 100%;
}

/* 错误消息样式 */
.login #login_error,
.login .message {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #dc3545;
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.1);
    animation: slideDown 0.3s ease-out;
}

.login .message {
    border-left-color: #28a745;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 密码强度指示器 */
.pw-weak {
    background: rgba(255, 193, 7, 0.1) !important;
    border-color: #ffc107 !important;
}

.pw-strong {
    background: rgba(40, 167, 69, 0.1) !important;
    border-color: #28a745 !important;
}

/* 语言选择器 */
.language-switcher {
    text-align: center;
    margin-top: 1rem;
}

.language-switcher select {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    padding: 0.5rem;
    color: #4a5568;
    font-size: 0.875rem;
}

/* 响应式设计 */
@media screen and (max-width: 480px) {
    #login {
        width: 90%;
        margin: 0 auto;
    }
    
    #loginform {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }
    
    .login h1 a {
        font-size: 1.5rem;
    }
    
    .login input[type="text"],
    .login input[type="password"],
    .login input[type="email"] {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
    
    .wp-core-ui .button-primary {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    #loginform {
        background: rgba(30, 30, 30, 0.95);
        color: #e2e8f0;
    }
    
    .login label {
        color: #cbd5e0;
    }
    
    .login input[type="text"],
    .login input[type="password"],
    .login input[type="email"] {
        background: rgba(45, 45, 45, 0.8);
        color: #e2e8f0;
        border-color: rgba(99, 102, 241, 0.3);
    }
    
    .login .forgetmenot label {
        color: #cbd5e0;
    }
}

/* 加载动画 */
.login-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(102, 126, 234, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.login-loading.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* 无障碍功能增强 */
.login input:focus,
.login button:focus,
.login a:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    #loginform {
        background: white;
        border: 2px solid #000;
    }
    
    .login input[type="text"],
    .login input[type="password"],
    .login input[type="email"] {
        border-color: #000;
    }
    
    .wp-core-ui .button-primary {
        background: #000;
        color: #fff;
    }
}
