/* WordPress联系表单插件 - 前端样式（多设备优化） */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 容器 */
.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* 表单区 */
.contact-section,
.cfp-contact-section {
    max-width: 600px;
    width: 100%;
    text-align: center;
}

/* 标题 */
.title,
.cfp-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.cfp-title {
    margin-bottom: 6px !important;
    text-align: left;
}

/* 表单 */
.contact-form,
.cfp-contact-form {
    width: 100%;
}

/* 输入组 */
.input-group,
.cfp-input-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 输入框 */
.input-field,
.cfp-input-field {
    flex: 1;
    padding: 16px 22px;
    font-size: 15px;
    border: 2px solid #e8e8e8;
    border-radius: 50px;
    outline: none;
    color: #555;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-field::placeholder,
.cfp-input-field::placeholder {
    color: #aaa;
}

.input-field:focus,
.cfp-input-field:focus {
    border-color: #fd7546;
    box-shadow: 0 0 0 3px rgba(253, 117, 70, 0.12);
}

/* 提交按钮 */
.submit-btn,
.cfp-submit-btn {
    min-width: 110px;
    height: 48px;
    padding: 0 22px;
    border-radius: 50px;
    border: none;
    background: linear-gradient(135deg, #fd7546 0%, #fd7546 100%);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.submit-btn:hover,
.cfp-submit-btn:hover {
    opacity: 0.9;
}

.submit-btn:active,
.cfp-submit-btn:active {
    transform: scale(0.98);
}

.submit-btn:disabled,
.cfp-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 提示信息 */
.message,
.cfp-message {
    margin-top: 16px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.message.success,
.cfp-message.cfp-success {
    display: block;
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.message.error,
.cfp-message.cfp-error {
    display: block;
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* =====================
   平板（≤768px）
===================== */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .title,
    .cfp-title {
        font-size: 17px;
    }

    .input-field,
    .cfp-input-field {
        padding: 15px 20px;
        font-size: 14px;
    }

    .submit-btn,
    .cfp-submit-btn {
        height: 46px;
        font-size: 13px;
    }
}

/* =====================
   手机（≤600px）
===================== */
@media (max-width: 600px) {
    .contact-section,
    .cfp-contact-section {
        max-width: 100%;
    }

    .title,
    .cfp-title {
        font-size: 16px;
    }

    /* 核心优化：纵向布局 */
    .input-group,
    .cfp-input-group {
        flex-direction: column;
        gap: 10px;
    }

    .input-field,
    .cfp-input-field {
        width: 100%;
        padding: 14px 18px;
        font-size: 14px;
    }

    .submit-btn,
    .cfp-submit-btn {
        width: 100%;
        height: 44px;
    }
}

/* =====================
   超小屏（≤360px）
===================== */
@media (max-width: 360px) {
    .input-field,
    .cfp-input-field {
        padding: 12px 16px;
        font-size: 13px;
    }

    .submit-btn,
    .cfp-submit-btn {
        height: 42px;
        font-size: 12px;
    }
}

/* =====================
   验证码弹窗样式
===================== */
.cfp-captcha-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.cfp-captcha-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: cfp-modal-appear 0.3s ease-out;
}

@keyframes cfp-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.cfp-captcha-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e8e8e8;
}

.cfp-captcha-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.cfp-captcha-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.cfp-captcha-close:hover {
    background-color: #f5f5f5;
    color: #666;
}

.cfp-captcha-body {
    padding: 24px;
    text-align: center;
}

.cfp-captcha-body > p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

#cfp-turnstile-widget {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.cfp-captcha-placeholder {
    padding: 40px 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.cfp-captcha-placeholder p {
    margin: 0;
    color: #999;
    font-size: 14px;
}

.cfp-captcha-footer {
    padding: 16px 24px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    justify-content: flex-end;
}

.cfp-captcha-submit {
    padding: 10px 24px;
    background: linear-gradient(135deg, #fd7546 0%, #fd7546 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.cfp-captcha-submit:hover {
    opacity: 0.9;
}

.cfp-captcha-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .cfp-captcha-content {
        max-width: 100%;
        margin: 0 10px;
    }
    
    .cfp-captcha-header {
        padding: 16px 20px;
    }
    
    .cfp-captcha-body {
        padding: 20px;
    }
    
    .cfp-captcha-footer {
        padding: 12px 20px;
    }
}
