/* login.css - 统一设计风格与主页 */

/* 导入与主页相同的变量 */
:root {
    --primary-color: #FF3B30; /* 主题红 */
    --secondary-color: #FFD1DC; /* 淡粉 */
    --accent-color: #6A5ACD; /* 紫色点缀 */
    --text-dark: #2c3e50; /* 深灰文字 */
    --text-light: #555; /* 浅灰文字 */
    --bg-light: #FDFCFA; /* 极浅背景 */
    --bg-card: #FFFFFF; /* 卡片背景 */
    --border-light: #E6E6FA; /* 浅边框/分割线 */
    --gradient-start: #FFD1DC; /* 粉色渐变起始 */
    --gradient-end: #E6E6FA;   /* 淡紫渐变结束 */
    --shadow-soft: 0 5px 15px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.08);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
}

/* 导入字体，与 register.css 一致 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* 多语言支持 */
.zh, .en, .ja, .ru, .fr {
    display: none;
    font-weight: inherit;
    color: inherit;
    font-size: inherit;
}
body.chinese .zh { display: inline; }
body.english .en { display: inline; }
body.japanese .ja { display: inline; }
body.russian .ru { display: inline; }
body.french .fr { display: inline; }

/* 页眉 Header */
header {
    background: var(--bg-card);
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: var(--shadow-soft);
}

/* 语言切换按钮 */
.lang-switch {
    display: flex;
    padding: 8px;
    background: rgba(255, 182, 193, 0.08);
    border-radius: 24px;
    position: relative;
    border: none;
    backdrop-filter: blur(4px);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
    justify-content: center;
}

.selection-indicator {
    position: absolute;
    height: calc(100% - 12px);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.65);
    box-shadow: 0 4px 20px rgba(255, 182, 193, 0.25), 0 0 15px rgba(69, 224, 224, 0.15);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    left: 0;
    top: 6px;
    border: none;
    backdrop-filter: blur(8px);
    transform: translateX(6px);
    will-change: transform;
}

.lang-btn {
    border: none;
    background: transparent;
    padding: 10px 18px;
    border-radius: 20px;
    cursor: pointer;
    color: var(--text-light);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: unset;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    outline: none;
    user-select: none;
}

.lang-btn:focus {
    outline: none;
    box-shadow: none;
}

.lang-btn.active {
    color: var(--primary-color);
    font-weight: 600;
    text-shadow: none;
}

.lang-btn:hover:not(.active) {
    color: var(--secondary-color);
    transform: translateY(0);
    box-shadow: none;
}

/* Logo 和标题 */
.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-container img {
    width: 50px;
    height: auto;
    transition: transform 0.3s ease;
}

.logo-container img:hover {
    transform: scale(1.1);
}

.brand-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-dark);
}

.header-content h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-left: 15px;
}

/* 登录容器布局 */
.container {
    max-width: 480px;
    margin: 50px auto;
    padding: 0 20px;
}

.login-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 25px;
    text-align: center;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 40px 30px;
    box-shadow: var(--shadow-medium);
    border-top: 3px solid var(--primary-color);
    animation: fadeInUp 0.6s ease forwards;
}

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

/* 表单元素样式 */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 1rem;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    background: var(--bg-light);
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(106, 90, 205, 0.15);
}

/* 忘记密码链接 */
.forgot-password {
    text-align: right;
    margin-top: 8px;
}

.forgot-password a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 登录按钮 */
.login-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 10px rgba(255, 59, 48, 0.2);
}

.login-btn:hover {
    background-color: #e62e27; /* 稍深的红色 */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 59, 48, 0.3);
}

/* 消息样式统一 */
.error-message, .success-message, .info-message {
    padding: 12px 15px;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
    font-size: 0.95rem;
    text-align: center;
}

.error-message {
    color: #d63031;
    background-color: rgba(255, 59, 48, 0.08);
    border-left: 3px solid #d63031;
    display: none;
}

.success-message {
    color: #27ae60;
    background-color: rgba(39, 174, 96, 0.08);
    border-left: 3px solid #27ae60;
    display: none;
}

.info-message {
    color: #0984e3;
    background-color: rgba(9, 132, 227, 0.08);
    border-left: 3px solid #0984e3;
    display: none;
    transition: opacity 0.5s ease;
}

.info-message strong.email-placeholder {
    font-weight: 600;
}

/* 模态框样式 */
.pwd-popup {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.pwd-popup.show {
    display: flex;
    opacity: 1;
}

.pwd-popup-content {
    background-color: var(--bg-card);
    padding: 30px 35px;
    border: none;
    width: 90%;
    max-width: 500px;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.pwd-popup.show .pwd-popup-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    font-weight: 300;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
    width: 30px;
    height: 30px;
}

.close-btn:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.pwd-popup h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
}

/* 页脚样式 */
footer {
    background: #f0f0f0;
    color: var(--text-light);
    padding: 20px;
    text-align: center;
    margin-top: 40px;
    font-size: 0.9rem;
}

/* Lottie 动画容器 */
#email-lottie-container {
    margin: 20px auto;
    max-width: 200px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
    
    .form-label {
        font-size: 0.95rem;
    }
    
    .form-input {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
    
    .login-btn {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .pwd-popup-content {
        padding: 25px 20px;
    }
    
    .lang-switch {
        flex-wrap: nowrap;
        justify-content: center;
        padding: 8px;
        gap: 4px;
        background: rgba(255, 182, 193, 0.08);
        box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.5);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 0 10px 10px 10px;
        width: calc(100% - 20px);
        white-space: nowrap;
        position: relative;
    }
    
    .lang-switch::-webkit-scrollbar {
        display: none;
    }
    
    .lang-btn {
        margin: 0;
        padding: 8px 10px;
        background: transparent;
        font-size: 14px;
        white-space: nowrap;
        min-width: fit-content;
        flex: 0 0 auto;
    }
    
    .selection-indicator {
        display: block;
        height: calc(100% - 10px);
        top: 5px;
        box-shadow: 0 2px 8px rgba(255, 182, 193, 0.2);
        backdrop-filter: none;
        background: rgba(255, 255, 255, 0.8);
        transition: transform 0.3s ease-out;
    }
    
    .lang-btn.active {
        background: transparent;
        color: var(--primary-color);
    }

    .lang-switch::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 30px auto;
    }
    
    .login-card {
        padding: 25px 15px;
    }
    
    .header-content h1 {
        font-size: 1.4rem;
    }
    
    .logo-container img {
        width: 40px;
    }
    
    .lang-btn {
        padding: 6px 8px;
        font-size: 13px;
        margin: 0 2px;
    }
    
    .selection-indicator {
        height: calc(100% - 8px);
        top: 4px;
    }
    
    .login-btn {
        padding: 10px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .pwd-popup-content {
        width: 95%;
        padding: 20px 15px;
    }
    
    .close-btn {
        right: 15px;
        top: 15px;
    }
    
    .captcha-input-container {
        max-width: 100%;
        overflow: hidden;
    }
    .captcha-input {
        min-width: 0;
    }
    .refresh-btn {
        flex-shrink: 0;
        max-width: 40px;
        min-width: 36px;
        padding: 8px;
    }
}

/* 添加注册提示样式 */
.register-prompt {
    text-align: center;
    margin-top: 25px;
    color: var(--text-light);
    font-size: 0.95rem;
}

.register-prompt a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    margin-left: 5px;
}

.register-prompt a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* 页脚内容样式 */
.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.footer-logo img {
    width: 40px;
    height: auto;
}

.footer-logo span {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-dark);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.copyright {
    font-size: 0.85rem;
    color: #aaa;
}

/* 密码输入容器和切换按钮样式 */
.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.password-toggle-btn:hover {
    opacity: 0.7;
}

.password-toggle-btn:focus {
    outline: none;
}

.password-container .form-input {
    width: 100%;
    padding-right: 40px; /* 为按钮留出空间 */
}

/* 可爱的眼睛动画效果 */
.password-toggle-btn svg {
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.password-toggle-btn:active svg {
    transform: scale(0.9);
}

@keyframes blink {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.1); }
}

/* reCAPTCHA验证样式 */
/* 删除所有reCAPTCHA相关样式 */

/* 数学验证码样式 - 清理后的版本 */
.math-captcha {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 8px 20px rgba(255, 123, 146, 0.10);
    border: 1px solid rgba(255, 209, 220, 0.5);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.captcha-title {
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    color: #FF7B92;
    margin-bottom: 15px;
    position: relative;
}

.captcha-title:after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: linear-gradient(to right, #FFD1DC, #FF7B92);
    margin: 8px auto 0;
    border-radius: 2px;
}

.math-expression {
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    letter-spacing: 1px;
    position: relative;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 20px); /* 设置宽度，与输入框容器相同 */
    margin-left: auto;
    margin-right: auto;
}

.captcha-text {
    background: linear-gradient(135deg, #FFD1DC, #ff91a4);
    padding: 15px 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(255, 123, 146, 0.25);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
    position: relative;
    z-index: 1;
    transform-style: preserve-3d;
    transition: all 0.3s ease;
    width: 100%; /* 让验证码文本填充整个容器 */
    display: flex;
    justify-content: center;
}

/* 多语言占位符处理 */
.captcha-input-wrapper {
    margin-bottom: 12px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.captcha-input-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: calc(100% - 20px); /* 与math-expression相同的宽度 */
    margin: 0 auto;
}

.captcha-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #FFD1DC;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    color: #555;
    background: rgba(255, 250, 250, 0.8);
}

.captcha-input:focus {
    outline: none;
    border-color: #FF7B92;
    box-shadow: 0 0 0 4px rgba(255, 123, 146, 0.15);
    background: #fff;
}

.captcha-placeholder {
    position: absolute;
    left: 50px;
    right: 50px;
    text-align: center;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.captcha-input:focus ~ .captcha-placeholder,
.captcha-input:not(:placeholder-shown) ~ .captcha-placeholder {
    opacity: 0;
}

.refresh-btn {
    background: rgba(255, 209, 220, 0.2);
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(.4,0,.2,1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 123, 146, 0.1);
    position: relative;
    overflow: visible;
}

.refresh-btn.animating {
    animation: refresh-rotate 0.5s cubic-bezier(.4,0,.2,1);
}

@keyframes refresh-rotate {
    0% {
        transform: scale(0.92) rotate(0deg);
    }
    60% {
        transform: scale(1.05) rotate(300deg);
    }
    80% {
        transform: scale(1.02) rotate(350deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
    }
}

.refresh-btn .highlight {
    content: '';
    position: absolute;
    left: -30%;
    top: 0;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, rgba(255,255,255,0.0) 0%, rgba(255,255,255,0.7) 50%, rgba(255,255,255,0.0) 100%);
    pointer-events: none;
    opacity: 0;
    transition: none;
    border-radius: 50%;
    z-index: 2;
}

.refresh-btn.animating .highlight {
    animation: highlight-move 0.5s linear;
}

@keyframes highlight-move {
    0% { left: -60%; opacity: 0; }
    20% { opacity: 0.7; }
    60% { left: 60%; opacity: 0.7; }
    100% { left: 100%; opacity: 0; }
}

.captcha-message {
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
    min-height: 20px;
    color: #FF3B30;
    font-weight: 500;
    transition: all 0.3s ease;
}

.captcha-hint {
    font-size: 14px;
    color: #888;
    text-align: center;
    margin-bottom: 10px;
    font-style: italic;
}

/* 验证码动画效果 */
@keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
    100% { transform: translateX(0); }
}

.shake-effect {
    animation: shake 0.3s ease-in-out;
}

/* 验证码canvas元素样式 */
.math-expression canvas {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}

@media (max-width: 480px) {
    .math-expression {
        height: 60px;
    }
    
    .captcha-text {
        padding: 12px 20px;
    }
    
    .captcha-input-container {
        max-width: 100%;
        overflow: hidden;
    }
    
    .captcha-input {
        min-width: 0;
    }
    
    .refresh-btn {
        flex-shrink: 0;
        max-width: 40px;
        min-width: 36px;
        padding: 8px;
    }
}







