/* Auth Modal Styles */

.auth-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.auth-modal-overlay.active {
    display: flex;
}

.auth-modal {
    background: white;
    border-radius: 1rem;
    width: 90%;
    max-width: 28rem;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.auth-modal-close:hover {
    background: #f3f4f6;
    color: #4b5563;
}

.auth-modal-content {
    padding: 2rem;
}

.auth-modal-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-modal-logo img {
    width: 3rem;
    height: 3rem;
    margin: 0 auto;
}

.auth-modal-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.5rem;
}

.auth-modal-subtitle {
    text-align: center;
    color: #718096;
    margin-bottom: 2rem;
}

.auth-form-group {
    margin-bottom: 1.25rem;
}

.auth-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.auth-form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.auth-form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-form-hint {
    font-size: 0.75rem;
    color: #718096;
    margin-top: 0.25rem;
}

.auth-username-validation {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.auth-username-validation.checking {
    color: #718096;
}

.auth-username-validation.available {
    color: #22543d;
}

.auth-username-validation.unavailable {
    color: #742a2a;
}

.auth-password-strength {
    margin-top: 0.5rem;
    display: none;
}

.auth-strength-bar {
    height: 0.25rem;
    background: #e2e8f0;
    border-radius: 0.125rem;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.auth-strength-fill {
    height: 100%;
    transition: all 0.3s;
    border-radius: 0.125rem;
}

.auth-strength-text {
    font-size: 0.75rem;
    color: #718096;
}

.auth-password-strength.strength-weak .auth-strength-fill {
    width: 33%;
    background: #fc8181;
}

.auth-password-strength.strength-medium .auth-strength-fill {
    width: 66%;
    background: #f6ad55;
}

.auth-password-strength.strength-strong .auth-strength-fill {
    width: 100%;
    background: #68d391;
}

.auth-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-btn-primary {
    background: #667eea;
    color: white;
}

.auth-btn-primary:hover:not(:disabled) {
    background: #5a67d8;
}

.auth-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-btn-google {
    background: white;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    margin-top: 0.75rem;
}

.auth-btn-google:hover:not(:disabled) {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.auth-google-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.auth-divider {
    margin: 1.5rem 0;
    text-align: center;
    position: relative;
    color: #718096;
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: #e2e8f0;
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

.auth-footer-links {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #718096;
}

.auth-footer-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.auth-footer-links a:hover {
    text-decoration: underline;
}

.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.auth-alert-error {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.auth-alert-success {
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.auth-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* 隐藏视图 */
.auth-view {
    display: none;
}

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