/* Contact Form 7 自定义样式 */

/* 强制归零（覆盖 CF7 默认行容器和提示的间距） */
.wpcf7-form p { margin: 0 !important; }
.wpcf7-form .wpcf7-form-control-wrap { margin: 0 !important; padding: 0 !important; display: block !important; }
.wpcf7-form .wpcf7-not-valid-tip { margin: 0.25rem 0 0 0 !important; }
/* 将模板中的 <br> 去除，避免额外换行造成的视觉间距 */
.wpcf7-form .form-row > p > br { display: none !important; }

/* 移动端弹窗优化 */
@media (max-width: 768px) {
    #inquiry-modal {
        padding: 1rem !important;
    }
    
    .modal-panel {
        max-height: calc(100vh - 2rem) !important;
        margin: 0 !important;
    }
    
    .modal-panel .p-8 {
        padding: 1.5rem !important;
    }
}

/* 移除旧的滚动锁定方案（改用 JS 记录并恢复滚动位置） */

/* 输入框背景色 */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 input[type="password"],
.wpcf7 input[type="search"],
.wpcf7 input[type="number"],
.wpcf7 input[type="date"],
.wpcf7 input[type="time"],
.wpcf7 input[type="datetime-local"],
.wpcf7 input[type="week"],
.wpcf7 input[type="month"],
.wpcf7 textarea,
.wpcf7 select {
    background-color: #f5f5f5 !important; /* neutral-100 */
    border: 1px solid #d4d4d4 !important; /* neutral-300 */
    border-radius: 0.5rem !important; /* rounded-input */
    padding: 0.75rem 1rem !important;
    width: 100% !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    transition: all 0.2s ease-in-out !important;
}

/* 输入框焦点状态 */
.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 input[type="url"]:focus,
.wpcf7 input[type="password"]:focus,
.wpcf7 input[type="search"]:focus,
.wpcf7 input[type="number"]:focus,
.wpcf7 input[type="date"]:focus,
.wpcf7 input[type="time"]:focus,
.wpcf7 input[type="datetime-local"]:focus,
.wpcf7 input[type="week"]:focus,
.wpcf7 input[type="month"]:focus,
.wpcf7 textarea:focus,
.wpcf7 select:focus {
    background-color: #ffffff !important;
    border-color: #f43f5e !important; /* primary-500 */
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1) !important; /* primary-100 with opacity */
}

/* 占位符文本样式 */
.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder {
    color: #a3a3a3 !important; /* neutral-400 */
    opacity: 1 !important;
}

/* 提交按钮样式 - 修复对比度问题 */
.wpcf7 input[type="submit"] {
    background-color: #be123c !important; /* primary-700 - 更深的红色提高对比度 */
    color: #ffffff !important;
    font-weight: 700 !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 0.5rem !important; /* rounded-button */
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease-in-out !important;
    box-shadow: 0 4px 14px 0 rgba(190, 18, 60, 0.25) !important; /* shadow-button */
    width: 100% !important;
}

.wpcf7 input[type="submit"]:hover {
    background-color: #9f1239 !important; /* primary-800 - 更深的悬停色 */
    box-shadow: 0 6px 20px 0 rgba(190, 18, 60, 0.4) !important; /* shadow-button-hover */
    transform: translateY(-1px) !important;
}

.wpcf7 input[type="submit"]:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(190, 18, 60, 0.3) !important;
}

/* 标签样式 */
.wpcf7 label {
    display: block !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #262626 !important; /* neutral-800 */
    margin-bottom: 0.5rem !important;
}

/* 必填字段标记 */
.wpcf7 label span {
    color: #ef4444 !important; /* danger-500 */
}

/* 确保必填字段的星号显示为红色 */
.wpcf7 label .text-danger-500 {
    color: #ef4444 !important; /* danger-500 */
}

/* 错误消息样式 */
.wpcf7 .wpcf7-not-valid-tip {
    color: #ef4444 !important; /* danger-500 */
    font-size: 0.875rem !important;
    margin-top: 0.25rem !important;
}

/* 成功消息样式 */
.wpcf7 .wpcf7-mail-sent-ok {
    background-color: #dcfce7 !important; /* success-100 */
    color: #166534 !important; /* success-800 */
    border: 1px solid #bbf7d0 !important; /* success-200 */
    border-radius: 0.5rem !important;
    padding: 1rem !important;
    margin-bottom: 1rem !important;
}

/* 错误消息样式 */
.wpcf7 .wpcf7-validation-errors {
    background-color: #fef2f2 !important; /* danger-50 */
    color: #991b1b !important; /* danger-800 */
    border: 1px solid #fecaca !important; /* danger-200 */
    border-radius: 0.5rem !important;
    padding: 1rem !important;
    margin-bottom: 1rem !important;
} 