/* 表单校验样式 */
.form-field {
    position: relative;
}

/* 保持原有的margin-bottom，不覆盖现有样式 */
.form-field:not(.form-group):not(.field) {
    margin-bottom: 20px;
}

.form-field input,
.form-field textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* 确保不破坏现有的输入框样式 */
.form-group.form-field input,
.form-group.form-field textarea,
.field.form-field input,
.field.form-field textarea {
    width: 100%;
    box-sizing: border-box;
}

/* 错误状态的输入框 */
.form-field.error input,
.form-field.error textarea {
    border: 2px solid #0B85E6 !important;
    box-shadow: 0 0 0 3px rgba(11, 133, 230, 0.1) !important;
    background-color: #f0f7ff !important;
}

/* 聚焦状态的输入框 */
.form-field.error input:focus,
.form-field.error textarea:focus {
    border: 2px solid #0B85E6 !important;
    box-shadow: 0 0 0 3px rgba(11, 133, 230, 0.2) !important;
    outline: none !important;
}

/* 错误提示文案 */
.error-message {
    color: #0B85E6;
    font-size: 14px;
    margin-top: 5px;
    text-align: left;
    font-weight: 400;
    line-height: 1.4;
    padding-left: 2px;
    display: block;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* 成功状态的输入框 */
.form-field.success input,
.form-field.success textarea {
    border: 2px solid #2ed573 !important;
    box-shadow: 0 0 0 3px rgba(46, 213, 115, 0.1) !important;
}

/* 清除错误状态 */
.form-field.success .error-message {
    display: none;
}

/* 确保错误消息不影响布局 */
.form-field .error-message {
    position: relative;
    width: 100%;
    min-height: 20px;
}

/* 针对不同类型的表单进行特定样式调整 */

/* 悬浮弹窗表单 */
.contact-modal .form-field {
    margin-bottom: 25px;
}

.contact-modal .error-message {
    font-size: 13px;
    margin-top: 6px;
}

/* 首页表单 */
.inquiry-section .form-field {
    margin-bottom: 20px;
}

.inquiry-section .error-message {
    font-size: 14px;
    margin-top: 5px;
}

/* About页面表单 */
.contact-form .form-field {
    margin-bottom: 22px;
}

.contact-form .error-message {
    font-size: 14px;
    margin-top: 6px;
}

/* Contact页面表单 */
.contact-content .form-field {
    margin-bottom: 20px;
}

.contact-content .error-message {
    font-size: 14px;
    margin-top: 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .error-message {
        font-size: 13px;
        margin-top: 4px;
    }
    
    .form-field {
        margin-bottom: 18px;
    }
}

@media (max-width: 480px) {
    .error-message {
        font-size: 12px;
        margin-top: 3px;
    }
    
    .form-field {
        margin-bottom: 16px;
    }
}

/* 动画效果 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.form-field.error input.shake,
.form-field.error textarea.shake {
    animation: shake 0.5s ease-in-out;
}

/* 确保错误状态有足够的视觉反馈 */
.form-field.error input::placeholder,
.form-field.error textarea::placeholder {
    color: #0B85E6 !important;
    opacity: 0.7 !important;
}
