﻿/* Root Variables */
:root {
    --primary: #2C3E50;
    --accent: #E8B4B8;
    --accent-hover: #D89296;
    --light-accent: #FFF0F1;
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --background: #FFFFFF;
    --background-light: #FAFAFA;
    --border: #E5E7EB;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background: var(--background-light);
    line-height: 1.6;
}

/* Header */
.auth-header {
    position: fixed;
    top: 0;
    width: 100%;
    background: white;
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.auth-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    text-decoration: none;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
}

/* Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    padding-top: 100px;
}

.auth-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
}

/* Tabs */
.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 1.25rem;
    border: none;
    background: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
}

/* Form */
.auth-form {
    padding: 2rem;
}

.auth-form h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(232, 180, 184, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Login Method Toggle */
.login-method-toggle {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: var(--background-light);
    padding: 0.5rem;
    border-radius: 8px;
}

.method-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Verification Code Input */
.verification-input {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin: 2rem 0;
}

.code-input {
    width: 50px;
    height: 50px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.code-input:focus {
    border-color: var(--accent);
    outline: none;
}

/* Phone Input */
.phone-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.phone-prefix {
    padding: 0.75rem 1rem;
    background: var(--background-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 500;
}

/* Send Code Button */
.send-code-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.send-code-btn:hover:not(:disabled) {
    background: var(--accent-hover);
}

.send-code-btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
}

.input-with-button {
    position: relative;
}

.input-with-button input {
    padding-right: 120px;
}

/* Buttons */
.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: #1A252F;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    width: 100%;
}

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

.forgot-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    float: right;
    margin-top: 0.5rem;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Password Strength */
.password-strength {
    margin-top: 0.5rem;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
}

.strength-bar.weak {
    width: 33%;
    background: var(--error);
}

.strength-bar.medium {
    width: 66%;
    background: var(--warning);
}

.strength-bar.strong {
    width: 100%;
    background: var(--success);
}

/* Terms */
.terms-section {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.terms-section a {
    color: var(--accent);
    text-decoration: none;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 3000;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1rem;
    min-width: 300px;
    animation: slideIn 0.3s ease;
    transition: all 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

/* 添加缺失的 slideOut 动画 */
@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Success Modal */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.success-content {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 1.5rem;
}

/* SMS Icon */
.sms-icon {
    display: inline-block;
    margin-right: 0.5rem;
}

/* Verification Header */
.verification-header {
    text-align: center;
    margin-bottom: 2rem;
}

.verification-header h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.verification-header p {
    color: var(--text-secondary);
}

/* Resend Section */
.resend-section {
    text-align: center;
    margin: 1.5rem 0;
}

.resend-section p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.resend-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
}

.resend-btn:hover:not(:disabled) {
    color: var(--accent-hover);
}

.resend-btn:disabled {
    color: var(--text-secondary);
    cursor: not-allowed;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-nav {
        padding: 1rem 1.5rem;
    }

    .auth-container {
        padding: 1rem;
    }

    .auth-form {
        padding: 1.5rem;
    }

    .code-input {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .verification-input {
        gap: 0.5rem;
    }

    .send-code-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }
    
    .toast {
        min-width: 250px;
    }
}