/**
 * 认证页面样式文件 (login.php, logout.php)
 */

/* ========== 通用认证样式 ========== */

/* 页面基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
}

/* 登录容器 */
.auth-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 50px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

/* 标题区域 */
.auth-logo {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}

.auth-title {
    font-size: 20px;
    color: #333;
    margin-bottom: 8px;
}

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

/* 徽章样式 */
.auth-badge {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 30px;
}

/* 错误消息样式 */
.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #fcc;
    font-size: 14px;
}

/* 隐藏空的错误消息 */
.error-message:empty {
    display: none;
    margin: 0;
    padding: 0;
}

/* 成功消息样式 */
.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #a7f3d0;
    font-size: 14px;
}

/* 表单样式 */
.auth-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 500;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

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

.form-input::placeholder {
    color: #9ca3af;
}

/* 密码输入框容器 */
.password-input-container {
    position: relative;
    display: block;
    width: 100%;
}

.password-input-container .form-input {
    padding-right: 45px;
    width: 100%;
    box-sizing: border-box;
}

/* 密码显示/隐藏按钮 */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
}

.password-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
}

.password-toggle:focus {
    outline: 2px solid #667eea;
    outline-offset: 1px;
}

.eye-icon {
    font-size: 16px;
    line-height: 1;
    user-select: none;
}

/* 登录按钮样式 */
.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 返回链接样式 */
.back-link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 25px;
}

.back-link:hover {
    background: rgba(102, 126, 234, 0.1);
    text-decoration: none;
}

/* 演示信息样式 */
.demo-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 12px;
    color: #666;
    border-left: 4px solid #667eea;
}

.demo-info strong {
    color: #333;
}

/* 加载状态样式 */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

/* ========== 登录页面特定样式 ========== */

/* 记住我选项 */
.remember-me {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.remember-checkbox {
    margin-right: 8px;
    transform: scale(1.2);
}

/* 忘记密码链接 */
.forgot-password {
    display: block;
    text-align: right;
    margin-bottom: 20px;
}

.forgot-password a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/* 注册提示 */
.register-hint {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.register-hint p {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.register-hint a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.register-hint a:hover {
    text-decoration: underline;
}

/* ========== 退出页面特定样式 ========== */

/* 退出成功消息 */
.logout-message {
    text-align: center;
    padding: 40px 20px;
}

.logout-icon {
    font-size: 64px;
    margin-bottom: 20px;
    color: #28a745;
}

.logout-text {
    font-size: 18px;
    color: #333;
    margin-bottom: 30px;
}

.logout-countdown {
    font-size: 14px;
    color: #666;
    margin-bottom: 25px;
}

/* ========== 响应式设计 ========== */

/* 移动端适配 */
@media (max-width: 480px) {
    .auth-container {
        padding: 30px 20px;
        margin: 10px;
    }

    .auth-logo {
        font-size: 28px;
    }

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

    .auth-subtitle {
        font-size: 13px;
    }

    .form-label {
        font-size: 13px;
    }

    .form-input {
        padding: 10px 14px;
        font-size: 16px;
    }

    .login-btn {
        padding: 12px;
        font-size: 16px;
    }

    .back-link {
        font-size: 13px;
        padding: 6px 12px;
    }

    .demo-info {
        font-size: 11px;
        padding: 12px;
    }
}

/* 超小屏幕适配 */
@media (max-width: 360px) {
    .auth-container {
        padding: 25px 15px;
    }

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

    .form-input {
        padding: 8px 12px;
        font-size: 14px;
    }

    .login-btn {
        padding: 10px;
        font-size: 14px;
    }
}

/* ========== 高对比度和无障碍样式 ========== */

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .auth-container {
        background: white;
        border: 2px solid #000;
    }

    .form-input {
        border: 2px solid #000;
    }

    .login-btn {
        background: #000;
        color: #fff;
    }
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    .auth-container,
    .form-input,
    .login-btn,
    .back-link {
        transition: none;
    }

    .login-btn:hover {
        transform: none;
        box-shadow: none;
    }

    .loading-spinner {
        animation: none;
    }
}

/* 焦点指示器 */
.form-input:focus,
.login-btn:focus,
.back-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ========== 打印样式 ========== */

@media print {
    body {
        background: white;
    }

    .auth-container {
        box-shadow: none;
        border: 1px solid #000;
    }
}