/* 登录页面样式 */
@import url('./common.css');

/* 全局字体设置 */
body {
    font-family: 'Rubik', sans-serif;
    scroll-behavior: smooth;
    background: white;
    min-height: 100vh;
}

/* 背景装饰 */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(248, 246, 250, 0.8) 0%, rgba(240, 235, 245, 0.9) 100%);
    z-index: -1;
    pointer-events: none;
}

/* 主要内容 */
.main-content {
    padding-top: 0;
}

.login-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 10;
    overflow: hidden;
}

/* 背景模糊效果 */
.login-background-blur {
    position: absolute;
    width: 600px;
    height: 400px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(180.61, 163.24, 241.74, 0.25);
    box-shadow: 100px 100px 100px rgba(0, 0, 0, 0.1);
    border-radius: 9999px;
    filter: blur(50px);
    z-index: 1;
    pointer-events: none;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 32px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.12), 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.4);
    position: relative;
    z-index: 15;
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out;
    overflow: hidden;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--quest-gradient);
    border-radius: 32px 32px 0 0;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 20;
}

.login-title {
    font-size: 3rem;
    font-weight: 800;
    color: #332564;
    margin-bottom: 1rem;
    font-family: 'Rubik', sans-serif;
    line-height: 1.2;
    background: linear-gradient(135deg, #332564 0%, #4B264F 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: #D76E13;
    font-size: 1.25rem;
    font-weight: 500;
    opacity: 0.9;
}

.login-form {
    margin-bottom: 2rem;
    position: relative;
    z-index: 20;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #332564;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    font-size: 1rem;
    font-family: 'Rubik', sans-serif;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.form-input:focus {
    outline: none;
    border-color: #54497D;
    box-shadow: 0 0 0 3px rgba(84, 73, 125, 0.1);
    background: rgba(255, 255, 255, 1);
}

.form-input::placeholder {
    color: #AAAAAA;
    font-weight: 400;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}

.forgot-password {
    color: #6287E4;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
}

.forgot-password:hover {
    color: #54497D;
    background: rgba(98, 135, 228, 0.1);
    text-decoration: none;
}

/* 底部Logo */
.bottom-logo {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.bottom-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

.logo-link {
    display: block;
    text-decoration: none;
}

.logo-link img {
    width: 80px;
    height: 27px;
    object-fit: contain;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Rubik', sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 140px;
    animation: buttonGlow 4s ease-in-out infinite;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

@keyframes buttonGlow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(84, 73, 125, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(84, 73, 125, 0.5);
    }
}

.btn-primary {
    background: #54497D;
    color: white;
    box-shadow: 0 4px 12px rgba(84, 73, 125, 0.3);
}

.btn-primary:hover {
    background: #4a3f6b;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 24px rgba(84, 73, 125, 0.4);
}

.btn-secondary {
    background: white;
    color: #54497D;
    border: 2px solid #54497D;
    box-shadow: 0 2px 8px rgba(84, 73, 125, 0.2);
}

.btn-secondary:hover {
    background: #54497D;
    color: white;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 24px rgba(84, 73, 125, 0.4);
}

.signup-section {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 20;
    margin-top: 1rem;
}

.signup-text {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* 忘记密码模态框 */
.forgot-password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.forgot-password-modal.show {
    display: flex;
}

.forgot-password-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-heavy);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--quest-purple);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: 50%;
    transition: var(--transition-fast);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--quest-purple);
}

.modal-message {
    margin: var(--spacing-md) 0;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    display: none;
}

.modal-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.modal-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f1b0b7;
}

/* 消息样式 */
.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
    position: relative;
}

.message.error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.message.success {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.message.info {
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.message.warning {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fed7aa;
}

/* Close button for persistent messages */
.message-close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.message-close-btn:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.1);
}

.message-close-btn:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .login-section {
        min-height: 100vh;
        padding: 1rem;
    }
    
    .bottom-logo {
        bottom: 15px;
        right: 15px;
    }
    
    .logo-link img {
        width: 70px;
        height: 23px;
    }
    
    .login-container {
        padding: 2rem;
        max-width: 100%;
    }
    
    .login-title {
        font-size: 2.5rem;
    }
    
    .login-subtitle {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 14px 28px;
        font-size: 0.9rem;
        min-width: 140px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 1.5rem;
    }
    
    .login-title {
        font-size: 2rem;
    }
    
    .login-subtitle {
        font-size: 1rem;
    }
    
    .form-input {
        padding: 14px 16px;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 0.85rem;
        min-width: 120px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        text-align: center;
    }
    
    .forgot-password {
        order: 2;
        text-align: center;
    }
    
    .forgot-password-content {
        padding: 1.5rem;
        margin: 1rem;
        width: calc(100% - 32px);
    }
}

/* === Translation Button Styles === */
.translation-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(75, 38, 79, 0.05);
    border: 1px solid rgba(75, 38, 79, 0.2);
    border-radius: 8px;
    color: #332564;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    position: absolute;
    top: 0;
    right: 0;
}

.translation-btn:hover {
    background: rgba(75, 38, 79, 0.08);
    border-color: #54497D;
    transform: translateY(-1px);
    text-decoration: none;
}

.translation-flag {
    font-size: 1rem;
}

.translation-text {
    font-size: 0.875rem;
}

/* Header positioning for translation button */
.login-header-top {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.login-title {
    margin-bottom: 1rem;
}

/* === Remember Me Checkbox Styles === */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #332564;
    margin: 0;
    padding: 0;
}

.checkbox-input {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #332564;
}

.checkbox-text {
    font-size: 0.875rem;
    color: #332564;
    opacity: 0.8;
    line-height: 1.4;
}

.checkbox-label:hover .checkbox-text {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .checkbox-text {
        font-size: 0.8rem;
    }
}
