/**
 * 公共样式库
 * 用于封装各页面重复使用的 CSS 样式
 */

/* ==================== 全局重置 ==================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ==================== 基础布局 ==================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f6f8;
    color: #333;
    line-height: 1.6;
}

/* ==================== 表单元素 ==================== */

/* 表单组 */
.form-group {
    margin-bottom: 20px;
}

/* 标签 */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

/* 输入框 */
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
    background-color: #fff;
}

.form-control:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-control:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.form-control.error {
    border-color: #e74c3c;
}

/* ==================== 消息提示 ==================== */

/* 消息盒子 */
.message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    display: none;
    text-align: center;
    font-size: 14px;
}

.message.show {
    display: block;
}

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

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

.message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Toast 消息（浮动提示） */
.toast-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    background-color: #333;
    color: white;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.toast-success {
    background-color: #2ecc71;
}

.toast-error {
    background-color: #e74c3c;
}

.toast-warning {
    background-color: #f39c12;
}

.toast-info {
    background-color: #3498db;
}

/* ==================== 按钮样式 ==================== */

/* 主按钮 */
.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.btn-primary:hover {
    background-color: #357abd;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 发送验证码按钮 */
.btn-send-code {
    width: 100%;
    padding: 10px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-send-code:hover:not(:disabled) {
    background-color: #357abd;
}

.btn-send-code:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* ==================== 密码输入框 ==================== */

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .form-control {
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #888;
    font-size: 16px;
    line-height: 1;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: #4a90e2;
}

/* 眼睛图标 - 显示状态 */
.toggle-password .icon-eye {
    display: inline-block;
}

.toggle-password .icon-eye-off {
    display: none;
}

.toggle-password.showing .icon-eye {
    display: none;
}

.toggle-password.showing .icon-eye-off {
    display: inline-block;
}

/* ==================== 容器样式 ==================== */

/* 表单容器 */
.form-container {
    background-color: #fff;
    width: 100%;
    max-width: 500px;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 通用容器 */
.container {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: 0 auto;
}

/* ==================== 隐藏元素 ==================== */
.hidden {
    display: none !important;
}

/* ==================== 链接样式 ==================== */
.link {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.link a {
    color: #4a90e2;
    text-decoration: none;
}

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

/* ==================== 步骤指示器 ==================== */

.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    background-color: #f0f0f0;
    transition: all 0.3s ease;
}

.step.active {
    background-color: #4a90e2;
    color: white;
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* ==================== 响应式布局 ==================== */

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .form-container,
    .container {
        padding: 20px;
    }
    
    .steps {
        flex-direction: column;
        gap: 5px;
    }
}