/**
 * Authentication Pages Styles
 * 认证页面样式 - 登录、注册、找回密码、重置密码等
 */

/* ==========================================================================
   Auth Container - 认证页面容器
   ========================================================================== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
}

/* Background animation */
.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    animation: backgroundScroll 20s linear infinite;
}

@keyframes backgroundScroll {
    0% { background-position: 0 0; }
    100% { background-position: 100px 100px; }
}

/* ==========================================================================
   Auth Card - 认证卡片
   ========================================================================== */

.auth-card {
    background: white;
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease-out;
}

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

/* ==========================================================================
   Auth Header - 认证页面头部
   ========================================================================== */

.auth-header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
}

.auth-header .back-button {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
}

.auth-header .back-button:hover {
    background: #e9ecef;
    transform: translateY(-50%) scale(1.05);
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 14px;
    color: #666;
    margin: 8px 0 0 0;
}

/* ==========================================================================
   Auth Icon - 认证页面图标
   ========================================================================== */

.auth-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 32px rgba(102, 126, 234, 0.6);
    }
}

.auth-icon svg {
    color: white;
}

/* ==========================================================================
   Auth Description - 认证页面描述
   ========================================================================== */

.auth-description {
    text-align: center;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 32px;
}

/* ==========================================================================
   Auth Form - 认证表单
   ========================================================================== */

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form .form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.auth-form .form-label svg {
    flex-shrink: 0;
}

.auth-form .form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.2s;
    background: #f8f9fa;
}

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

.auth-form .form-input.error {
    border-color: #ff4444;
    background: #fff5f5;
}

.auth-form .form-input::placeholder {
    color: #adb5bd;
}

/* Password Input with Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-input {
    padding-right: 48px;
    flex: 1;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    z-index: 1;
}

.toggle-password:hover {
    color: #333;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

.toggle-password svg:last-child {
    display: none;
}

.toggle-password.show-password svg:first-child {
    display: none;
}

.toggle-password.show-password svg:last-child {
    display: block;
}

/* ==========================================================================
   Password Strength Indicator - 密码强度指示器
   ========================================================================== */

.password-strength-wrapper {
    margin-top: 12px;
}

.password-strength-bar {
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

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

.password-strength-fill[data-strength="0"] {
    width: 0;
    background: transparent;
}

.password-strength-fill[data-strength="1"] {
    width: 25%;
    background: #ff4444;
}

.password-strength-fill[data-strength="2"] {
    width: 50%;
    background: #ff9800;
}

.password-strength-fill[data-strength="3"] {
    width: 75%;
    background: #4caf50;
}

.password-strength-fill[data-strength="4"] {
    width: 100%;
    background: #11998e;
}

.password-strength-text {
    font-size: 12px;
    color: #666;
    text-align: right;
    font-weight: 500;
}

.password-strength-text.weak { color: #ff4444; }
.password-strength-text.fair { color: #ff9800; }
.password-strength-text.good { color: #4caf50; }
.password-strength-text.strong { color: #11998e; }

/* ==========================================================================
   Form Actions - 表单操作按钮
   ========================================================================== */

.auth-form .form-actions {
    margin-top: 28px;
}

.auth-form .btn-block {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-form .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

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

/* ==========================================================================
   Auth Footer - 认证页面底部
   ========================================================================== */

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e9ecef;
}

.auth-footer .link-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.auth-footer .link-text:hover {
    color: #764ba2;
    gap: 8px;
}

.auth-footer .link-text svg {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Success/Error Messages - 成功/错误消息
   ========================================================================== */

.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    margin-bottom: 24px;
    padding: 16px;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.woocommerce-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.woocommerce-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.woocommerce-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ==========================================================================
   Responsive Design - 响应式设计
   ========================================================================== */

@media (max-width: 480px) {
    .auth-container {
        padding: 16px;
    }

    .auth-card {
        padding: 32px 24px;
        border-radius: 16px;
    }

    .auth-title {
        font-size: 24px;
    }

    .auth-icon {
        width: 64px;
        height: 64px;
    }

    .auth-icon svg {
        width: 32px;
        height: 32px;
    }
}

/* ==========================================================================
   Loading State - 加载状态
   ========================================================================== */

.auth-form.loading {
    position: relative;
    pointer-events: none;
}

.auth-form.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

/* ==========================================================================
   Dark Mode Support - 暗色模式支持
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .auth-card {
        background: #1a1a1a;
        color: #fff;
    }

    .auth-title {
        color: #fff;
    }

    .auth-form .form-input {
        background: #2a2a2a;
        border-color: #3a3a3a;
        color: #fff;
    }

    .auth-form .form-input:focus {
        background: #2a2a2a;
    }

    .auth-footer {
        border-top-color: #3a3a3a;
    }
}
