/*
 * Contact Form 7 on the Reach theme.
 * Form templates reuse the theme's Gravity Forms class names (gform_wrapper, gfield, gfield_label,
 * ginput_container, gform_footer, gform_button) so the existing theme/customizer styles apply.
 * These rules only cover markup that is specific to CF7.
 */

.cf7-gf .wpcf7-form-control-wrap {
	display: block;
}

.cf7-gf .gform_validation_container {
	display: none !important;
}

.cf7-gf .gfield_required {
	margin-left: 2px;
}

/*
 * Compact variant (homepage hero): [contact-form-7 ... html_class="cf7-gf--compact"].
 * Same fields as everywhere else; labels are visually hidden (still read by screen
 * readers) and the gf_left/right_half columns collapse to full-width stacked inputs.
 */
form.cf7-gf--compact .gfield_label {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute;
	height: 1px;
	width: 1px;
	overflow: hidden;
}

form.cf7-gf--compact .gf_left_half,
form.cf7-gf--compact .gf_right_half {
	display: block;
	max-width: none;
	padding: 0;
}

/* Address sub-fields */
.cf7-gf .ginput_container_address > span {
	display: block;
	margin-bottom: 0.5rem;
}

.cf7-gf .ginput_container_address label {
	display: block;
	margin-top: 0.25rem;
}

/* Checkboxes / consent */
.cf7-gf .wpcf7-list-item {
	margin: 0;
}

.cf7-gf .ginput_container_checkbox label {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	cursor: pointer;
}

.cf7-gf .ginput_container_checkbox input[type="checkbox"] {
	flex: 0 0 auto;
	margin-top: 0.2em;
}

/* Validation + response (brand: gold #b49f67 success, red #be1e24 errors — Reach theme options) */
.cf7-gf .wpcf7-not-valid-tip {
	display: block;
	margin: 4px 0 2px;
	color: #be1e24;
	font-size: 0.8125rem;
	font-weight: 600;
}

.cf7-gf .wpcf7-not-valid {
	border-color: #be1e24 !important;
}

.wpcf7 form.cf7-gf-form .wpcf7-response-output {
	margin: 1rem 0 0;
	padding: 0.875rem 1rem 0.875rem 1.125rem;
	border: 0;
	border-left: 4px solid #b49f67;
	border-radius: 3px;
	background: #f7f5ef;
	color: #222;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.5;
	text-align: left;
}

.wpcf7 form.cf7-gf-form.invalid .wpcf7-response-output,
.wpcf7 form.cf7-gf-form.unaccepted .wpcf7-response-output,
.wpcf7 form.cf7-gf-form.failed .wpcf7-response-output,
.wpcf7 form.cf7-gf-form.aborted .wpcf7-response-output,
.wpcf7 form.cf7-gf-form.spam .wpcf7-response-output {
	border-left-color: #be1e24;
	background: #fdf1f1;
}

.cf7-gf .gform_footer {
	position: relative;
}

/* Customizer CSS pads "#gform_7 input" (homepage form); the CF7 submit is an <input>, GF's was a <button>. */
#gform_7 input.gform_button[type="submit"] {
	padding: 15px 30px;
}

.cf7-gf .wpcf7-spinner {
	position: absolute;
	margin: 0;
	top: 50%;
	transform: translate(0.75rem, -25%);
}
