/* =========================================================
   My B2B CRM — 前台表单样式
   ========================================================= */

/* 容器 */
.my-b2b-crm-form-wrap {
    max-width: 720px;
    margin: 0 auto;
}

/* 字段网格：两列布局 */
.my-b2b-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}

/* 全宽字段（textarea、select、checkbox、radio、country） */
.my-b2b-field-full {
    grid-column: 1 / -1;
}

/* 字段容器 */
.my-b2b-field-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 标签 */
.my-b2b-field-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.my-b2b-required {
    color: #d63638;
    margin-left: 2px;
}

.my-b2b-field-help {
    margin: 4px 0 0;
    font-size: 12px;
    color: #72777c;
    line-height: 1.5;
}

/* 输入框 / 下拉框 */
.my-b2b-input,
.my-b2b-select,
.my-b2b-textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 14px;
    color: #1d2327;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
    line-height: 1.5;
    outline: none;
}

.my-b2b-input:focus,
.my-b2b-select:focus,
.my-b2b-textarea:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, .12);
}

.my-b2b-textarea {
    resize: vertical;
    min-height: 120px;
}

/* 复选框组 / 单选按钮组 */
.my-b2b-checkbox-group,
.my-b2b-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.my-b2b-group-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    display: block;
}

.my-b2b-checkbox-label,
.my-b2b-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    line-height: 1.4;
}

.my-b2b-checkbox-label input,
.my-b2b-radio-label input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #0073aa;
    flex-shrink: 0;
}

/* Select 自定义箭头 */
.my-b2b-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2370777f' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* 提交区域 */
.my-b2b-submit-wrap {
    margin-top: 20px;
}

.my-b2b-submit-btn {
    display: inline-block;
    padding: 12px 32px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.4;
    transition: background .15s, opacity .15s;
    position: relative;
}

.my-b2b-submit-btn:hover {
    background: #005a87;
}

.my-b2b-submit-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* 按钮尺寸变体 */
.my-b2b-btn--small  { padding: 8px 20px;  font-size: 13px; }
.my-b2b-btn--medium { padding: 12px 32px; font-size: 15px; }
.my-b2b-btn--large  { padding: 16px 44px; font-size: 17px; }

/* 提交中 Spinner 动画 */
@keyframes my-b2b-spin {
    to { transform: rotate(360deg); }
}
.my-b2b-submit-btn .my-b2b-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: my-b2b-spin .7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* 消息提示 */
.my-b2b-form-message {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
}

.my-b2b-form-message.success {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.my-b2b-form-message.error {
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* 错误文本（shortcode 报错） */
.my-b2b-crm-error {
    color: #d63638;
    font-size: 14px;
    padding: 10px 14px;
    background: #fdf0f0;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* 响应式 */
@media ( max-width: 600px ) {
    .my-b2b-fields-grid {
        grid-template-columns: 1fr;
    }
    .my-b2b-field-full {
        grid-column: 1;
    }
    .my-b2b-submit-btn {
        width: 100%;
        text-align: center;
    }
}
