/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.popup-login-active {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    overflow: hidden;
}

/* 弹窗遮罩层 */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: none;
    z-index: 999;
    animation: fadeIn 0.3s ease;
}

.popup-overlay.show {
    display: block;
}

/* 弹窗容器 */
.popup-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
    display: none;
    z-index: 1000;
    animation: popupShow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popup-container.show {
    display: block;
    transform: translate(-50%, -50%) scale(1);
}

/* 弹窗头部 */
.popup-header {
    position: relative;
    padding: 24px 24px 16px;
    text-align: center;
    border-bottom: 1px solid #f5f5f5;
}

.popup-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 28px;
    height: 28px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #999;
    transition: all 0.3s ease;
    border: none;
}

.close-btn:hover {
    background: #ff2442;
    color: white;
}

/* 弹窗主体 */
.popup-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

/* 表单样式 */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    z-index: 2;
}

.input-group input {
    width: 100%;
    height: 48px;
    padding: 0 48px 0 48px;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    font-size: 16px;
    color: #333;
    background: #fafafa;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #ff2442;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 36, 66, 0.1);
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    color: #ff2442;
}

/* 表单选项 */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0;
    font-size: 14px;
}

/* 自定义复选框 */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
    background: #ff2442;
    border-color: #ff2442;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-link, .link {
    color: #ff2442;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.forgot-link:hover, .link:hover {
    color: #d91e36;
    text-decoration: underline;
}

/* 提交按钮 */
.submit-btn {
    width: 100%;
    height: 48px;
    background: #ff2442;
    border: none;
    border-radius: 24px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(255, 36, 66, 0.3);
    letter-spacing: 0.5px;
}

.submit-btn:hover {
    background: #d91e36;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 36, 66, 0.4);
}


/* 分割线 */
.divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
    color: #999;
    font-size: 14px;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #eee;
}

.divider span {
    background: white;
    padding: 0 16px;
    position: relative;
    z-index: 1;
}

/* 切换表单 */
.switch-form {
    text-align: center;
    color: #666;
    font-size: 14px;
}

.switch-form a {
    color: #ff2442;
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
    transition: all 0.3s ease;
}

.switch-form a:hover {
    color: #d91e36;
    text-decoration: underline;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes popupShow {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes popupHide {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

.popup-container.hide {
    animation: popupHide 0.3s ease forwards;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .popup-container {
        width: 95%;
        max-width: none;
        margin: 0;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }
    
    .popup-header {
        padding: 20px 20px 12px;
    }
    
    .popup-header h2 {
        font-size: 20px;
    }
    
    .popup-body {
        padding: 20px;
    }
    
    .input-group input {
        height: 44px;
        font-size: 15px;
    }
    
    .submit-btn {
        height: 44px;
        font-size: 15px;
    }
    
    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 成功/错误提示样式 */
.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

.message.success {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
}

.message.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.message.info {
    background: #fef3f2;
    border: 1px solid #fecaca;
    color: #b45309;
}

.message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 输入验证样式 */
.input-group.error input {
    border-color: #dc2626;
    background: #fef2f2;
}

.input-group.success input {
    border-color: #059669;
    background: #f0fdf4;
}

.input-error {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.input-group.error .input-error {
    display: block;
}

/* 按钮禁用状态 */
.submit-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.submit-btn:disabled:hover {
    background: #d1d5db;
    transform: none;
    box-shadow: none;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .popup-container {
        border: 2px solid #333;
    }
    
    .input-group input {
        border-color: #666;
    }
    
    .input-group input:focus {
        border-color: #000;
        box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .popup-container {
        animation: none;
    }
    
    .popup-overlay {
        animation: none;
    }
    
    * {
        transition: none !important;
    }
}

/* emlog后台样式兼容 */
.popup-container .form-control {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 48px 0 48px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: #333;
    background-color: #fafafa;
    background-clip: padding-box;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.popup-container .form-control:focus {
    color: #333;
    background-color: #fff;
    border-color: #ff2442;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(255, 36, 66, 0.1);
}

.popup-container .btn {
    display: inline-block;
    font-weight: 600;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    background-color: #ff2442;
    border: none;
    padding: 12px 16px;
    font-size: 16px;
    line-height: 1.5;
    border-radius: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 36, 66, 0.3);
    letter-spacing: 0.5px;
}

.popup-container .btn:hover {
    background-color: #d91e36;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 36, 66, 0.4);
}

.popup-container .btn:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(255, 36, 66, 0.25);
}

.popup-container .btn:disabled {
    opacity: 0.65;
    background-color: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.popup-container .btn:disabled:hover {
    background-color: #d1d5db;
}
