/* -------------------------------------------------------------------------
 * Methodist Contact Form 7 Styles
 * Simple grid, no input borders
 * ------------------------------------------------------------------------- */

.wpcf7 {
	width: 100%;
	margin: 24px 0;
}

/* 12-column grid */
.wpcf7 form {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	column-gap: 24px;
	row-gap: 18px;
}

/* Default field = half width / 2-column layout */
.wpcf7 form > p,
.wpcf7 form > div {
	grid-column: span 6;
	margin: 0;
}

/* Grid helper classes */
.wpcf7 form > .mh-form-full {
	grid-column: 1 / -1;
}

.wpcf7 form > .mh-form-half {
	grid-column: span 6;
}

.wpcf7 form > .mh-form-third {
	grid-column: span 4;
}

.wpcf7 form > .mh-form-quarter {
	grid-column: span 3;
}

/* Labels */
.wpcf7 label {
	display: block;
	margin: 0;
	color: var(--global-palette3, #1d2733);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
}

/* Inputs — no border box */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="number"],
.wpcf7 input[type="url"],
.wpcf7 input[type="date"],
.wpcf7 select,
.wpcf7 textarea {
	width: 100%;
	min-height: 46px;
	margin-top: 6px;
	padding: 11px 12px;
	background: #f4f6f8;
	border: 0;
	border-radius: 0;
	color: var(--global-palette3, #1d2733);
	font-size: 16px;
	line-height: 1.4;
	box-shadow: none;
}

.wpcf7 textarea {
	min-height: 130px;
	resize: vertical;
}

/* Focus — clean underline instead of full border */
.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
	outline: none;
	background: #eef3f8;
	box-shadow: inset 0 -3px 0 var(--global-palette1, #004990);
}

/* Checkbox / radio rows should usually be full width */
.wpcf7 form > p:has(.wpcf7-checkbox),
.wpcf7 form > p:has(.wpcf7-radio),
.wpcf7 form > div:has(.wpcf7-checkbox),
.wpcf7 form > div:has(.wpcf7-radio) {
	grid-column: 1 / -1;
}

.wpcf7 .wpcf7-list-item {
	display: inline-flex;
	align-items: center;
	margin: 8px 24px 0 0;
}

.wpcf7 input[type="checkbox"],
.wpcf7 input[type="radio"] {
	width: 18px;
	height: 18px;
	margin: 0 8px 0 0;
	accent-color: var(--global-palette1, #004990);
}

.wpcf7 .wpcf7-list-item-label {
	color: var(--global-palette3, #1d2733);
	font-weight: 400;
}

/* Submit row */
.wpcf7 form > p:has(.wpcf7-submit),
.wpcf7 form > div:has(.wpcf7-submit) {
	grid-column: 1 / -1;
}

.wpcf7 input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 12px 28px;
	background: var(--global-palette1, #004990);
	border: 0;
	border-radius: 0;
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
}

.wpcf7 input[type="submit"]:hover,
.wpcf7 input[type="submit"]:focus {
	background: var(--global-palette2, #003870);
	color: #fff;
}

/* Validation */
.wpcf7 .wpcf7-not-valid-tip {
	margin-top: 6px;
	color: #c20f2f;
	font-size: 14px;
	font-weight: 600;
}

.wpcf7 .wpcf7-response-output {
	grid-column: 1 / -1;
	margin: 8px 0 0;
	padding: 12px 14px;
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.payment-required .wpcf7-response-output {
	border: 1px solid #c20f2f;
	color: #c20f2f;
}

.wpcf7 form.sent .wpcf7-response-output {
	border: 1px solid var(--global-palette1, #004990);
	color: var(--global-palette1, #004990);
}

/* Mobile */
@media (max-width: 767px) {
	.wpcf7 form {
		grid-template-columns: 1fr;
		row-gap: 16px;
	}

	.wpcf7 form > p,
	.wpcf7 form > div,
	.wpcf7 form > .mh-form-full,
	.wpcf7 form > .mh-form-half,
	.wpcf7 form > .mh-form-third,
	.wpcf7 form > .mh-form-quarter {
		grid-column: auto;
	}

	.wpcf7 input[type="submit"] {
		width: 100%;
	}
}


/* -------------------------------------------------------------------------
 * CF7 nested 3-column rows
 * Only affects existing rows that contain md:w-1/3 columns.
 * No form markup changes needed.
 * ------------------------------------------------------------------------- */

/* Make the outer wrapper full width only when it contains a 3-column nested row */
.wpcf7 form > div:has(> .grid-row-sm > .col.md\:w-1\/3),
.wpcf7 form > p:has(> .grid-row-sm > .col.md\:w-1\/3) {
	grid-column: 1 / -1;
}

/* Only nested rows with md:w-1/3 children become 3 columns */
.wpcf7 .grid-row-sm:has(> .col.md\:w-1\/3) {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: 24px;
	row-gap: 18px;
}

/* Prevent w-full/md width classes from fighting the grid */
.wpcf7 .grid-row-sm:has(> .col.md\:w-1\/3) > .col.md\:w-1\/3 {
	width: auto !important;
	max-width: none !important;
	margin: 0;
}

/* Mobile stack */
@media (max-width: 767px) {
	.wpcf7 .grid-row-sm:has(> .col.md\:w-1\/3) {
		grid-template-columns: 1fr;
	}
}