/**
 * DaheCMS Red模板专属 - 会员登录注册弹窗样式
 * 基于全局版本改造，使用Red模板红色主题
 * 响应式设计，支持PC和移动端
 * DaheCMS开发团队维护
 */

/* ========== 遮罩层 ========== */
.dahe-login-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 9998;
    animation: fadeIn 0.3s ease;
}

.dahe-login-overlay.active {
    display: block;
}

/* ========== 弹窗容器 ========== */
.dahe-login-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: slideDown 0.3s ease;
    overflow: hidden;
}

.dahe-login-modal.active {
    display: block;
}

/* ========== 弹窗头部 ========== */
.dahe-modal-header {
    position: relative;
    padding: 30px 30px 20px;
    background: linear-gradient(135deg, rgb(241, 116, 77) 0%, rgb(223, 39, 39) 100%);
    color: #ffffff;
}

.dahe-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dahe-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.dahe-modal-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.dahe-modal-subtitle {
    margin: 5px 0 0;
    font-size: 14px;
    opacity: 0.9;
}

/* ========== 切换标签 ========== */
.dahe-modal-tabs {
    display: flex;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px;
}

.dahe-modal-tab {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.dahe-modal-tab:hover {
    color: #ffffff;
}

.dahe-modal-tab.active {
    background: #ffffff;
    color: rgb(241, 116, 77);
}

/* ========== 弹窗内容 ========== */
.dahe-modal-body {
    padding: 30px;
}

.dahe-tab-content {
    display: none;
}

.dahe-tab-content.active {
    display: block;
    animation: fadeInUp 0.3s ease;
}

/* ========== 表单样式 ========== */
.dahe-form-group {
    margin-bottom: 20px;
}

.dahe-form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333333;
}

.dahe-form-label .required {
    color: #ff4757;
    margin-left: 2px;
}

.dahe-input-wrapper {
    position: relative;
}

.dahe-input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999999;
    font-size: 16px;
}

.dahe-form-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333333;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.dahe-form-input:focus {
    outline: none;
    border-color: rgb(241, 116, 77);
    box-shadow: 0 0 0 3px rgba(223, 39, 39, 0.1);
}

.dahe-form-input::placeholder {
    color: #cccccc;
}

/* 验证码特殊样式 */
.dahe-captcha-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dahe-captcha-input {
    flex: 1;
}

.dahe-captcha-image {
    width: 100px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    transition: border-color 0.3s ease;
}

.dahe-captcha-image:hover {
    border-color: rgb(241, 116, 77);
}

/* ========== 复选框和链接 ========== */
.dahe-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dahe-checkbox-wrapper {
    display: flex;
    align-items: center;
}

.dahe-checkbox {
    margin-right: 8px;
    cursor: pointer;
}

.dahe-checkbox-label {
    font-size: 13px;
    color: #666666;
    cursor: pointer;
    user-select: none;
}

.dahe-link {
    font-size: 13px;
    color: rgb(241, 116, 77);
    text-decoration: none;
    transition: color 0.3s ease;
}

.dahe-link:hover {
    color: rgb(223, 39, 39);
    text-decoration: underline;
}

/* ========== 按钮样式 ========== */
.dahe-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dahe-btn-primary {
    background: linear-gradient(135deg, rgb(241, 116, 77) 0%, rgb(223, 39, 39) 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(223, 39, 39, 0.3);
}

.dahe-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(223, 39, 39, 0.4);
}

.dahe-btn-primary:active {
    transform: translateY(0);
}

.dahe-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ========== 提示信息 ========== */
.dahe-alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    display: none;
    animation: slideDown 0.3s ease;
}

.dahe-alert.show {
    display: block;
}

.dahe-alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.dahe-alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.dahe-alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ========== 底部提示 ========== */
.dahe-modal-footer {
    padding: 0 30px 30px;
    text-align: center;
}

.dahe-footer-text {
    font-size: 13px;
    color: #999999;
}

.dahe-footer-text .dahe-link {
    font-weight: 600;
}

/* ========== 加载动画 ========== */
.dahe-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
}

/* ========== 动画定义 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -55%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== 响应式设计 ========== */
@media (max-width: 480px) {
    .dahe-login-modal {
        width: 95%;
        max-width: none;
        border-radius: 12px;
    }

    .dahe-modal-header,
    .dahe-modal-body,
    .dahe-modal-footer {
        padding: 20px;
    }

    .dahe-modal-title {
        font-size: 20px;
    }

    .dahe-form-input {
        padding: 10px 12px 10px 40px;
        font-size: 16px; /* 防止iOS自动缩放 */
    }

    .dahe-captcha-row {
        flex-direction: column;
        align-items: stretch;
    }

    .dahe-captcha-image {
        width: 100%;
    }
}

/* ========== 暗色模式支持（已禁用，保持与页面风格一致） ========== */
/* 注释掉暗色模式，统一使用亮色主题 */
/*
@media (prefers-color-scheme: dark) {
    .dahe-login-modal {
        background: #1a1a1a;
        color: #ffffff;
    }

    .dahe-form-label {
        color: #e0e0e0;
    }

    .dahe-form-input {
        background: #2a2a2a;
        border-color: #3a3a3a;
        color: #ffffff;
    }

    .dahe-form-input:focus {
        border-color: rgb(241, 116, 77);
        background: #2a2a2a;
    }

    .dahe-checkbox-label,
    .dahe-footer-text {
        color: #b0b0b0;
    }
}
*/
