/**
 * Maiyees B2B Inquiry Form - front-end styles.
 * Scoped under .mbf-wrap so it cannot break the rest of the theme.
 */

.mbf-wrap {
	--mbf-primary: #0f62fe;
	--mbf-border: #d8dee9;
	--mbf-text: #1f2937;
	--mbf-muted: #6b7280;
	--mbf-error: #d63638;
	--mbf-success: #0f7b3f;

	width: 100%;
	max-width: 860px;
	margin: 0 auto;
	padding: 8px 0 24px;
	box-sizing: border-box;
	color: var(--mbf-text);
	font-size: 15px;
	line-height: 1.5;
}

.mbf-wrap * {
	box-sizing: border-box;
}

.mbf-head {
	margin-bottom: 20px;
}

.mbf-title {
	margin: 0 0 6px;
	font-size: 24px;
	line-height: 1.3;
	color: var(--mbf-text);
}

.mbf-desc {
	margin: 0;
	color: var(--mbf-muted);
	font-size: 14px;
}

.mbf-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px 20px;
}

.mbf-field {
	margin: 0;
	min-width: 0;
}

.mbf-full {
	grid-column: 1 / -1;
}

.mbf-label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--mbf-text);
}

.mbf-req {
	color: var(--mbf-error);
}

.mbf-control {
	width: 100%;
	padding: 11px 12px;
	border: 1px solid var(--mbf-border);
	border-radius: 6px;
	background: #fff;
	color: var(--mbf-text);
	font-size: 15px;
	font-family: inherit;
	line-height: 1.4;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.mbf-control:focus {
	outline: none;
	border-color: var(--mbf-primary);
	box-shadow: 0 0 0 3px rgba(15, 98, 254, .15);
}

textarea.mbf-control {
	resize: vertical;
	min-height: 120px;
}

select.mbf-control {
	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='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 34px;
}

.mbf-file {
	padding: 9px;
	background: #fbfbfc;
}

.mbf-hint {
	margin: 6px 0 0;
	font-size: 12.5px;
	color: var(--mbf-muted);
}

/* Checkbox groups */
.mbf-checkbox-group {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 8px 16px;
}

.mbf-check {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 14px;
	cursor: pointer;
	margin: 0;
}

.mbf-check input[type="checkbox"] {
	width: 16px;
	height: 16px;
	margin: 2px 0 0;
	accent-color: var(--mbf-primary);
	flex: 0 0 auto;
}

.mbf-type-consent .mbf-check {
	font-size: 13.5px;
	color: var(--mbf-muted);
}

/* Actions */
.mbf-actions {
	margin-top: 22px;
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.mbf-submit {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 46px;
	padding: 12px 30px;
	border: none;
	border-radius: 6px;
	background: var(--mbf-primary);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: filter .15s ease, opacity .15s ease;
}

.mbf-submit:hover {
	filter: brightness(.93);
}

.mbf-submit:disabled {
	opacity: .65;
	cursor: not-allowed;
}

.mbf-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: mbf-spin .7s linear infinite;
}

.mbf-submit.mbf-loading .mbf-spinner {
	display: inline-block;
}

@keyframes mbf-spin {
	to { transform: rotate(360deg); }
}

.mbf-status {
	font-size: 14px;
	min-height: 20px;
}

.mbf-status.is-error {
	color: var(--mbf-error);
}

.mbf-status.is-success {
	color: var(--mbf-success);
	font-weight: 600;
}

.mbf-fallback {
	margin: 16px 0 0;
	font-size: 13px;
	color: var(--mbf-muted);
}

.mbf-fallback a {
	color: var(--mbf-primary);
}

/* Validation */
.mbf-control.mbf-invalid {
	border-color: var(--mbf-error);
}

.mbf-error {
	display: block;
	margin: 5px 0 0;
	font-size: 12.5px;
	color: var(--mbf-error);
}

.mbf-type-checkbox.mbf-invalid .mbf-checkbox-group,
.mbf-type-consent.mbf-invalid {
	outline: 1px solid var(--mbf-error);
	outline-offset: 4px;
	border-radius: 4px;
}

/* Honeypot - hidden from humans, readable by bots */
.mbf-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Mobile */
@media (max-width: 640px) {
	.mbf-grid {
		grid-template-columns: 1fr;
	}

	.mbf-title {
		font-size: 20px;
	}

	.mbf-submit {
		width: 100%;
	}
}
