/* 弹窗触发按钮样式 */
.modal-trigger-buttons {
    display: inline-flex;
    gap: 12px;
    margin: 0 -10px;
}

.modal-trigger-buttons.style-default .modal-trigger {
    padding: 0px 10px;
    border: 0px solid #007cba;
    background: transparent;
    color: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 5px;
    text-align: center;
}

.modal-trigger-buttons.style-default .modal-trigger:hover {
    background: #007cba;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.modal-trigger-buttons.style-primary .modal-trigger {
    padding: 12px 24px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    min-width: 100px;
    text-align: center;
}

.modal-trigger-buttons.style-primary .modal-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.modal-trigger-buttons.style-primary .login-trigger {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.modal-trigger-buttons.style-primary .register-trigger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* 弹窗基础样式 */
.modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-wrapper.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 420px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    overflow: hidden;
}

.modal-wrapper.active .modal-container {
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.modal-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

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

.modal-close:hover {
    background: #e2e8f0;
    color: #4a5568;
}

.modal-body {
    padding: 24px;
}

/* 表单样式 */
.modal-form {
    width: 100%;
}

.form-group {
    position: relative;
    margin-bottom: 20px;
}

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

.form-group input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #f7fafc;
    padding: 0 0 0 40px !important;
}

.form-group input:focus {
    outline: none;
    border-color: #4299e1;
    background: white;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.form-group input.error {
    border-color: #e53e3e;
    background: #fed7d7;
}

.form-group input.error:focus {
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 44px;
    color: #a0aec0;
    transition: color 0.3s ease;
}

.form-group input:focus + .input-icon {
    color: #4299e1;
}

.form-group input.error + .input-icon {
    color: #e53e3e;
}

/* 提交按钮 */
.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.3);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.register-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.register-btn:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.3);
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* 加载动画 */
.spinner {
    animation: rotate 2s linear infinite;
}

.spinner circle {
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* 表单底部链接 */
.form-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.switch-form {
    color: #4299e1;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.switch-form:hover {
    color: #3182ce;
    text-decoration: underline;
}

/* 消息提示 */
.modal-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-message.show {
    opacity: 1;
    transform: translateX(0);
}

.modal-message.success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.modal-message.error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

/* 阻止背景滚动 */
body.modal-open {
    overflow: hidden;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .modal-container {
        width: 95%;
        margin: 20px auto;
        max-width: none;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-trigger-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .modal-trigger-buttons .modal-trigger {
        width: 100%;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
}

/* 原有的简单表单样式（保持兼容） */
.mobile-login-form,
.mobile-register-form {
    max-width: 400px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f7fafc;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-login-form p,
.mobile-register-form p {
    margin-bottom: 15px;
}

.mobile-login-form label,
.mobile-register-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #4a5568;
}

.mobile-login-form input,
.mobile-register-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
}

.mobile-login-form input:focus,
.mobile-register-form input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.1);
}

.mobile-login-form button,
.mobile-register-form button {
    width: 100%;
    padding: 12px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.mobile-login-form button:hover,
.mobile-register-form button:hover {
    background: #3182ce;
}

.success {
    color: #22543d;
    padding: 10px;
    background: #c6f6d5;
    border: 1px solid #9ae6b4;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 14px;
}

.error {
    color: #742a2a;
    padding: 10px;
    background: #fed7d7;
    border: 1px solid #feb2b2;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 14px;
}