/* Auth Page Styles */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-color);
    padding: 20px;
    transition: background 0.3s ease;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.auth-header {
    text-align: center;
    padding: 30px 30px 20px;
}

.auth-header h1 {
    font-size: 1.8em;
    color: var(--text-color);
    margin-bottom: 8px;
    font-weight: 700;
}

.auth-header .subtitle {
    color: #666;
    font-size: 0.95em;
}

.auth-tabs {
    display: flex;
    padding: 0 30px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    border: none;
    background: none;
    font-size: 1.1em;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    position: relative;
}

.auth-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    transition: background 0.3s ease;
}

.auth-tab:hover {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.auth-tab.active {
    color: var(--primary-color);
    font-weight: 600;
}

.auth-tab.active::after {
    background: var(--primary-color);
}

/* 表单样式 */
.auth-form {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.auth-form.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95em;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--bg-color);
    color: var(--text-color);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: #999;
}

.form-input.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

.error-message {
    color: var(--error-color);
    font-size: 0.9em;
    margin-top: 6px;
    display: none;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.input-wrapper {
    position: relative;
}

.send-code-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    z-index: 10;
}

.send-code-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-50%);
}

.send-code-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.countdown {
    font-size: 0.8em;
    color: #666;
    margin-left: 10px;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.local-toast-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    width: max-content;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    pointer-events: none;
}

.toast-message {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    max-width: 80vw;
    backdrop-filter: blur(10px);
}

.toast-message.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-message.success {
    background: rgba(46, 204, 113, 0.95);
}

.toast-message.error {
    background: rgba(231, 76, 60, 0.95);
}

.toast-message.info {
    background: rgba(52, 152, 219, 0.95);
}

/* 按钮样式 */
.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-primary::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 ease;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-secondary {
    width: 100%;
    padding: 16px;
    background: transparent;
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 12px;
}

.btn-secondary:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 切换链接 */
.switch-link {
    text-align: center;
    margin-top: 24px;
    color: #666;
    font-size: 0.95em;
}

.switch-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.switch-link a:hover {
    text-decoration: underline;
}

/* 登录方式切换 */
.login-method-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.method-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9em;
    color: var(--text-color);
}

.method-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.method-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Social Login */
.social-login {
    margin-top: 25px;
    text-align: center;
}

.social-login p {
    color: #999;
    font-size: 0.85em;
    margin-bottom: 15px;
    position: relative;
}

.social-login p::before,
.social-login p::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 1px;
    background: #ddd;
    vertical-align: middle;
    margin: 0 10px;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
    border: 1px solid transparent;
}

.social-icon:hover {
    background: white;
    border-color: var(--border-color);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85em;
    color: #999;
}

.auth-footer a {
    color: #666;
    text-decoration: none;
    margin: 0 5px;
}

.auth-footer a:hover {
    color: var(--primary-color);
}

/* Media Queries */
@media (max-width: 480px) {
    .auth-wrapper {
        padding: 10px;
    }
    
    .auth-card {
        padding: 25px 15px;
        border-radius: 12px;
    }
    
    .auth-header h1 {
        font-size: 1.3em;
    }
}

/* 深色主题适配 */
[data-theme="dark"] .auth-card {
    background: #2c2e33;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .auth-header h1,
[data-theme="dark"] .form-label {
    color: #e8e8e8;
}

[data-theme="dark"] .form-input {
    background: #3a3a3a;
    border-color: #4a4a4a;
    color: #e8e8e8;
}

[data-theme="dark"] .form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .btn-secondary {
    background: transparent;
    border-color: #4a4a4a;
    color: #e8e8e8;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #3a3a3a;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

[data-theme="dark"] .auth-footer a,
[data-theme="dark"] .switch-link,
[data-theme="dark"] .auth-header .subtitle {
    color: #b8b8b8;
}

[data-theme="dark"] .method-btn {
    background: #3a3a3a;
    border-color: #4a4a4a;
    color: #e8e8e8;
}

[data-theme="dark"] .method-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

[data-theme="dark"] .method-btn:hover:not(.active) {
    background: #4a4a4a;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* My Fixes for Tab visibility */
[data-theme="dark"] .auth-tab {
    color: #b8b8b8;
}

[data-theme="dark"] .auth-tab:hover {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

[data-theme="dark"] .auth-tab.active {
    color: var(--primary-color);
}
