/* 认证页面专用样式 */
.auth-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 480px;
    width: 100%;
    overflow: hidden;
    animation: slideInUp 0.6s ease-out;
}

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

.auth-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.auth-card-header h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.auth-card-body {
    padding: 2.5rem;
}

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

.auth-form-control {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    position: relative;
}

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

.auth-form-control::placeholder {
    color: #6c757d;
    transition: all 0.3s ease;
}

.auth-form-control:focus::placeholder {
    color: transparent;
}

.auth-form-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1.1rem;
    z-index: 2;
    transition: all 0.3s ease;
}

.auth-form-group:focus-within .auth-form-icon {
    color: #667eea;
    transform: translateY(-50%) scale(1.1);
}

.auth-form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 2;
}

.password-toggle:hover {
    color: #667eea;
    transform: translateY(-50%) scale(1.1);
}

.auth-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

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

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-btn .spinner {
    display: none;
    margin-right: 0.5rem;
}

.auth-btn.loading .spinner {
    display: inline-block;
}

.auth-btn.loading .btn-text {
    opacity: 0.7;
}

.auth-card-footer {
    background: #f8f9fa;
    padding: 1.5rem 2.5rem;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.auth-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.auth-error {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    animation: shake 0.5s ease-in-out;
}

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

.auth-success {
    background: linear-gradient(135deg, #51cf66, #40c057);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    animation: slideInDown 0.5s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.field-error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.field-error i {
    margin-right: 0.25rem;
    font-size: 0.8rem;
}

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

.password-strength {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.password-strength-bar {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin: 0.25rem 0;
}

.password-strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

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

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

.password-strength.strong .password-strength-fill {
    width: 100%;
    background: #28a745;
}

.auth-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.auth-warning i {
    margin-right: 0.75rem;
    margin-top: 0.1rem;
    font-size: 1.1rem;
}

/* 响应式设计 */
@media (max-width: 576px) {
    .auth-container {
        padding: 10px;
    }
    
    .auth-card {
        margin: 0;
        border-radius: 15px;
    }
    
    .auth-card-header {
        padding: 1.5rem;
    }
    
    .auth-card-header h3 {
        font-size: 1.5rem;
    }
    
    .auth-card-body {
        padding: 2rem 1.5rem;
    }
    
    .auth-card-footer {
        padding: 1rem 1.5rem;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .auth-card {
        background: rgba(30, 30, 30, 0.95);
        color: #e9ecef;
    }
    
    .auth-form-control {
        background: #2d3748;
        border-color: #4a5568;
        color: #e9ecef;
    }
    
    .auth-form-control::placeholder {
        color: #a0aec0;
    }
    
    .auth-card-footer {
        background: #2d3748;
        border-top-color: #4a5568;
    }
    
    .auth-form-label {
        color: #e9ecef;
    }
}

/* 输入框焦点和状态样式 */
.auth-form-group.focused .auth-form-icon {
    color: #667eea;
    transform: translateY(-50%) scale(1.1);
}

.auth-form-control.success {
    border-color: #28a745;
    background-color: #f8fff9;
}

.auth-form-control.error {
    border-color: #dc3545;
    background-color: #fff8f8;
    animation: shake 0.3s ease-in-out;
}

.success-icon {
    position: absolute;
    right: 3rem;
    top: 50%;
    transform: translateY(-50%);
    color: #28a745;
    font-size: 1rem;
    opacity: 0;
    transition: all 0.3s ease;
}

/* 加载动画 */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 改进的动画效果 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 输入框标签浮动效果 */
.auth-form-group {
    position: relative;
}

.auth-form-label {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.auth-form-group.focused .auth-form-label {
    color: #667eea;
    transform: scale(0.95);
}

/* 改进的密码强度指示器 */
.password-strength-bar {
    position: relative;
    overflow: visible;
}

.password-strength-fill {
    position: relative;
}

.password-strength-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 2px 2px 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.password-strength.strong .password-strength-fill::after {
    animation: none;
    opacity: 0;
}

/* 工具提示样式 */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* 改进的响应式设计 */
@media (max-width: 768px) {
    .auth-card {
        margin: 10px;
        border-radius: 12px;
    }
    
    .auth-form-control {
        padding: 0.875rem 0.875rem 0.875rem 2.5rem;
    }
    
    .auth-form-icon {
        left: 0.75rem;
        font-size: 1rem;
    }
    
    .password-toggle {
        right: 0.75rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 5px;
    }
    
    .auth-card-header h3 {
        font-size: 1.4rem;
    }
    
    .auth-warning {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .auth-warning i {
        margin-right: 0.5rem;
    }
}

/* 键盘导航增强 */
.auth-form-control:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.auth-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.password-toggle:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 4px;
}

/* 打印样式 */
@media print {
    .auth-container {
        background: white;
        color: black;
    }
    
    .auth-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .auth-card-header {
        background: white !important;
        color: black !important;
    }
    
    .auth-btn, .password-toggle {
        display: none;
    }
}

/* 无障碍访问增强 */
.auth-form-control:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}