/* ==================== 认证页面样式 ==================== */

/* 模态框容器 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* 模态框内容 */
.modal-content {
    position: relative;
    background-color: #ffffff;
    margin: 10% auto;
    padding: 0;
    width: 90%;
    max-width: 450px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease-out;
}

/* 模态框动画 */
@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 模态框头部 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid #e8e8e8;
}

.modal-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #95a5a6;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #f5f5f5;
    color: #2c3e50;
}

/* 模态框主体 */
.modal-body {
    padding: 32px;
}

/* 模态框底部 */
.modal-footer {
    padding: 16px 32px;
    border-top: 1px solid #e8e8e8;
    text-align: right;
}

/* 认证表单 */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 隐藏状态 */
.auth-form.hidden {
    display: none !important;
}

/* 可见状态 */
.auth-form.visible {
    display: flex !important;
}

/* 表单组 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: #5a6c7d;
}

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

.form-group .input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.form-group .input:hover {
    border-color: #40a9ff;
}

/* 表单操作区 */
.form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

/* 表单底部 */
.form-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.form-footer-text {
    font-size: 14px;
    color: #8c8c8c;
}

/* 链接按钮 */
.btn-link {
    background: none;
    border: none;
    color: #1890ff;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-link:hover {
    background-color: rgba(24, 144, 255, 0.1);
}

/* Toast 提示 */
.toast {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 50%;
    top: 80px;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: toastSlideIn 0.3s ease-out;
    min-width: 200px;
    text-align: center;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
                opacity: 1;
    }
}

.toast-success {
    background-color: #52c41a;
    color: #ffffff;
}

.toast-error {
    background-color: #ff4d4f;
    color: #ffffff;
}

.toast-warning {
    background-color: #faad14;
    color: #ffffff;
}

.toast-info {
    background-color: #1890ff;
    color: #ffffff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        margin: 5% auto;
        width: 95%;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 24px;
        padding-right: 24px;
    }

    .modal-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .toast {
        top: 60px;
        width: 90%;
    }
}

/* 输入验证状态 */
.input:invalid {
    border-color: #ff4d4f;
}

.input:valid {
    border-color: #52c41a;
}

/* 密码重置成功消息 */
.reset-success-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    color: white;
    animation: fadeIn 0.3s ease-in;
}

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

.success-icon {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.success-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
}

.success-content p {
    margin: 8px 0;
    opacity: 0.95;
}

.new-password-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 16px 0;
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 16px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.new-password-display code {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
    background: white;
    color: #667eea;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    user-select: all;
    -webkit-user-select: all;
    -moz-user-select: all;
}

.btn-copy {
    background: white;
    color: #667eea;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.password-tip {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 12px;
}

/* 加载状态 */
.btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

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