/**
 * Gravity Forms — Activ Surgical theme styles.
 *
 * Matches Figma contact form: underline fields, top labels, black submit.
 * Roots: form cssClass → `.activ-gform_wrapper`, or contact page layout.
 */

.activ-gform_wrapper,
.activ-content-block--contact .gform_wrapper {
	margin: 0;
	max-width: none;
	width: 100%;
}

.activ-gform_wrapper .gform-body,
.activ-gform_wrapper .gform_body,
.activ-content-block--contact .gform_wrapper .gform-body,
.activ-content-block--contact .gform_wrapper .gform_body {
	margin: 0;
}

.activ-gform_wrapper .gform_fields,
.activ-content-block--contact .gform_wrapper .gform_fields {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--8);
	grid-row-gap: var(--wp--preset--spacing--8) !important;
	list-style: none;
	margin: 0;
	padding: 0;
}

.activ-gform_wrapper .gfield,
.activ-content-block--contact .gform_wrapper .gfield {
	margin: 0 !important;
	padding: 0 !important;
}

.activ-gform_wrapper .gfield_label,
.activ-content-block--contact .gform_wrapper .gfield_label {
	color: var(--wp--preset--color--contrast) !important;
	display: flex;
	font-family: var(--wp--preset--font-family--albert-sans, "Albert Sans", system-ui, sans-serif);
	font-size: var(--wp--preset--font-size--sm) !important;
	font-weight: 500 !important;
	gap: var(--wp--preset--spacing--1);
	letter-spacing: -0.5px;
	line-height: 1.2;
	margin: 0 !important;
	padding: 0 !important;
}

.activ-gform_wrapper .gfield_required,
.activ-content-block--contact .gform_wrapper .gfield_required {
	color: var(--wp--preset--color--accent-crimson) !important;
	font-weight: 500;
	padding-left: 0 !important;
}

.activ-gform_wrapper .gfield_required_text,
.activ-gform_wrapper .gform_required_legend,
.activ-content-block--contact .gform_wrapper .gfield_required_text,
.activ-content-block--contact .gform_wrapper .gform_required_legend {
	display: none !important;
}

.activ-gform_wrapper .ginput_container,
.activ-content-block--contact .gform_wrapper .ginput_container {
	margin: 0 !important;
}

.activ-gform_wrapper .ginput_container_text input,
.activ-gform_wrapper .ginput_container_email input,
.activ-gform_wrapper .ginput_container_phone input,
.activ-gform_wrapper .ginput_container_select select,
.activ-gform_wrapper .ginput_container_textarea textarea,
.activ-content-block--contact .gform_wrapper .ginput_container_text input,
.activ-content-block--contact .gform_wrapper .ginput_container_email input,
.activ-content-block--contact .gform_wrapper .ginput_container_phone input,
.activ-content-block--contact .gform_wrapper .ginput_container_select select,
.activ-content-block--contact .gform_wrapper .ginput_container_textarea textarea {
	background-color: transparent !important;
	border: 0 !important;
	border-bottom: 1px solid var(--wp--preset--color--neutral-300) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	box-sizing: border-box !important;
	color: var(--wp--preset--color--contrast) !important;
	font-family: var(--wp--preset--font-family--albert-sans, "Albert Sans", system-ui, sans-serif) !important;
	font-size: var(--wp--preset--font-size--md) !important;
	font-weight: 400 !important;
	letter-spacing: -0.5px;
	line-height: 1.4 !important;
	margin: 0 !important;
	padding: var(--wp--preset--spacing--4) 0 !important;
	transition: border-color 0.15s ease;
	width: 100% !important;
}

.activ-gform_wrapper .ginput_container_text input:focus,
.activ-gform_wrapper .ginput_container_email input:focus,
.activ-gform_wrapper .ginput_container_phone input:focus,
.activ-gform_wrapper .ginput_container_select select:focus,
.activ-gform_wrapper .ginput_container_textarea textarea:focus,
.activ-content-block--contact .gform_wrapper .ginput_container_text input:focus,
.activ-content-block--contact .gform_wrapper .ginput_container_email input:focus,
.activ-content-block--contact .gform_wrapper .ginput_container_phone input:focus,
.activ-content-block--contact .gform_wrapper .ginput_container_select select:focus,
.activ-content-block--contact .gform_wrapper .ginput_container_textarea textarea:focus {
	border-bottom-color: var(--wp--preset--color--contrast) !important;
	border-bottom-width: 2px !important;
	outline: none !important;
	padding-bottom: calc(var(--wp--preset--spacing--4) - 1px) !important;
}

.activ-gform_wrapper .ginput_container_text input::placeholder,
.activ-gform_wrapper .ginput_container_email input::placeholder,
.activ-gform_wrapper .ginput_container_phone input::placeholder,
.activ-gform_wrapper .ginput_container_textarea textarea::placeholder,
.activ-content-block--contact .gform_wrapper .ginput_container_text input::placeholder,
.activ-content-block--contact .gform_wrapper .ginput_container_email input::placeholder,
.activ-content-block--contact .gform_wrapper .ginput_container_phone input::placeholder,
.activ-content-block--contact .gform_wrapper .ginput_container_textarea textarea::placeholder {
	color: var(--wp--preset--color--neutral-500);
	opacity: 1;
}

/* Safari clips native/select text when height is forced to 0 — keep an explicit box. */
.activ-gform_wrapper .ginput_container_select select,
.activ-content-block--contact .gform_wrapper .ginput_container_select select {
	-moz-appearance: none;
	-webkit-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%236C6D70' stroke-linecap='round'/%3E%3C/svg%3E") !important;
	background-position: right 0 center !important;
	background-repeat: no-repeat !important;
	background-size: 12px 12px !important;
	cursor: pointer;
	height: 3.25rem !important;
	min-height: 3.25rem !important;
	padding-right: 1.25rem !important;
	text-overflow: ellipsis;
}

.activ-gform_wrapper .ginput_container_textarea textarea,
.activ-content-block--contact .gform_wrapper .ginput_container_textarea textarea {
	/* ~4 rows at md / 1.4 line-height + vertical padding (overrides GF rows attr). */
	height: calc( (var(--wp--preset--font-size--md, 1.125rem) * 1.4 * 4) + (var(--wp--preset--spacing--4) * 2) ) !important;
	min-height: calc( (var(--wp--preset--font-size--md, 1.125rem) * 1.4 * 4) + (var(--wp--preset--spacing--4) * 2) ) !important;
	resize: vertical;
}

/* Consent checkbox */
.activ-gform_wrapper .gfield--type-checkbox .gfield_checkbox,
.activ-gform_wrapper .gfield--type-checkbox .gchoice,
.activ-content-block--contact .gform_wrapper .gfield--type-checkbox .gfield_checkbox,
.activ-content-block--contact .gform_wrapper .gfield--type-checkbox .gchoice {
	align-items: flex-start;
	display: flex;
	gap: 8px;
	margin: 0;
	padding: 0;
}

.activ-gform_wrapper .gfield--type-checkbox .gfield_checkbox,
.activ-content-block--contact .gform_wrapper .gfield--type-checkbox .gfield_checkbox {
	flex-direction: column;
	list-style: none;
}

.activ-gform_wrapper .gfield--type-checkbox input[type="checkbox"],
.activ-content-block--contact .gform_wrapper .gfield--type-checkbox input[type="checkbox"] {
	-webkit-appearance: none;
	appearance: none;
	background: transparent !important;
	border: 1.33px solid var(--wp--preset--color--contrast) !important;
	border-radius: 2px !important;
	box-shadow: none !important;
	cursor: pointer;
	flex-shrink: 0;
	height: 20px !important;
	margin: 1px 0 0 !important;
	position: relative;
	width: 20px !important;
}

.activ-gform_wrapper .gfield--type-checkbox input[type="checkbox"]:checked,
.activ-content-block--contact .gform_wrapper .gfield--type-checkbox input[type="checkbox"]:checked {
	background: var(--wp--preset--color--contrast) !important;
}

.activ-gform_wrapper .gfield--type-checkbox input[type="checkbox"]:checked::after,
.activ-content-block--contact .gform_wrapper .gfield--type-checkbox input[type="checkbox"]:checked::after {
	border: solid var(--wp--preset--color--base);
	border-width: 0 2px 2px 0;
	content: "";
	height: 10px;
	left: 6px;
	position: absolute;
	top: 2px;
	transform: rotate(45deg);
	width: 5px;
}

.activ-gform_wrapper .gfield--type-checkbox .gchoice label,
.activ-content-block--contact .gform_wrapper .gfield--type-checkbox .gchoice label {
	color: var(--wp--preset--color--contrast) !important;
	font-family: var(--wp--preset--font-family--albert-sans, "Albert Sans", system-ui, sans-serif);
	font-size: var(--wp--preset--font-size--md) !important;
	font-weight: 400 !important;
	letter-spacing: -0.5px;
	line-height: 1.4;
	margin: 0 !important;
	max-width: none;
	padding: 0 !important;
}

.activ-gform_wrapper .gfield--type-checkbox .gchoice label a,
.activ-content-block--contact .gform_wrapper .gfield--type-checkbox .gchoice label a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.activ-gform_wrapper .gfield--type-checkbox > .gfield_label,
.activ-content-block--contact .gform_wrapper .gfield--type-checkbox > .gfield_label {
	clip: rect(0, 0, 0, 0);
	border: 0;
	height: 1px;
	margin: -1px !important;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
}

/* Submit — space above after consent checkbox */
.activ-gform_wrapper .gform_footer,
.activ-gform_wrapper .gform_page_footer,
.activ-content-block--contact .gform_wrapper .gform_footer,
.activ-content-block--contact .gform_wrapper .gform_page_footer {
	margin: var(--wp--preset--spacing--8) 0 0 !important;
	padding: 0 !important;
}

.activ-gform_wrapper .gform_button,
.activ-gform_wrapper input[type="submit"].gform_button,
.activ-content-block--contact .gform_wrapper .gform_button,
.activ-content-block--contact .gform_wrapper input[type="submit"].gform_button {
	background: var(--wp--preset--color--contrast) !important;
	border: 0 !important;
	border-radius: 5px !important;
	box-shadow: none !important;
	color: var(--wp--preset--color--base) !important;
	cursor: pointer;
	font-family: var(--wp--preset--font-family--albert-sans, "Albert Sans", system-ui, sans-serif);
	font-size: var(--wp--preset--font-size--xs) !important;
	font-weight: 500 !important;
	letter-spacing: 0.5px;
	line-height: 1.2;
	margin: 0 !important;
	padding: var(--wp--preset--spacing--4) var(--wp--preset--spacing--5) !important;
	transition:
		background-color 0.2s ease,
		color 0.2s ease,
		border-color 0.2s ease,
		filter 0.2s ease,
		opacity 0.2s ease;
	width: auto !important;
}

.activ-gform_wrapper .gform_button:hover,
.activ-gform_wrapper .gform_button:focus-visible,
.activ-gform_wrapper input[type="submit"].gform_button:hover,
.activ-gform_wrapper input[type="submit"].gform_button:focus-visible,
.activ-content-block--contact .gform_wrapper .gform_button:hover,
.activ-content-block--contact .gform_wrapper .gform_button:focus-visible,
.activ-content-block--contact .gform_wrapper input[type="submit"].gform_button:hover,
.activ-content-block--contact .gform_wrapper input[type="submit"].gform_button:focus-visible {
	opacity: 0.85;
}

/* Validation — strip GF pink panels / rules; red label + underline only. */
.activ-gform_wrapper .gfield.gfield_error,
.activ-gform_wrapper li.gfield.gfield_error,
.activ-content-block--contact .gform_wrapper .gfield.gfield_error,
.activ-content-block--contact .gform_wrapper li.gfield.gfield_error {
	background: transparent !important;
	background-color: transparent !important;
	border: 0 !important;
	border-top: 0 !important;
	border-bottom: 0 !important;
	box-shadow: none !important;
	margin: 0 !important;
	max-width: none !important;
	padding: 0 !important;
}

.activ-gform_wrapper .gfield_error .gfield_label,
.activ-gform_wrapper .gfield_error .gform-field-label,
.activ-content-block--contact .gform_wrapper .gfield_error .gfield_label,
.activ-content-block--contact .gform_wrapper .gfield_error .gform-field-label {
	color: var(--wp--preset--color--accent-crimson) !important;
}

.activ-gform_wrapper .gfield_error .ginput_container_text input,
.activ-gform_wrapper .gfield_error .ginput_container_email input,
.activ-gform_wrapper .gfield_error .ginput_container_phone input,
.activ-gform_wrapper .gfield_error .ginput_container_select select,
.activ-gform_wrapper .gfield_error .ginput_container_textarea textarea,
.activ-gform_wrapper .gfield_error input[aria-invalid="true"],
.activ-gform_wrapper .gfield_error select[aria-invalid="true"],
.activ-gform_wrapper .gfield_error textarea[aria-invalid="true"],
.activ-content-block--contact .gform_wrapper .gfield_error .ginput_container_text input,
.activ-content-block--contact .gform_wrapper .gfield_error .ginput_container_email input,
.activ-content-block--contact .gform_wrapper .gfield_error .ginput_container_phone input,
.activ-content-block--contact .gform_wrapper .gfield_error .ginput_container_select select,
.activ-content-block--contact .gform_wrapper .gfield_error .ginput_container_textarea textarea,
.activ-content-block--contact .gform_wrapper .gfield_error input[aria-invalid="true"],
.activ-content-block--contact .gform_wrapper .gfield_error select[aria-invalid="true"],
.activ-content-block--contact .gform_wrapper .gfield_error textarea[aria-invalid="true"] {
	border: 0 !important;
	border-bottom: 1px solid var(--wp--preset--color--accent-crimson) !important;
	box-shadow: none !important;
}

.activ-gform_wrapper .gfield_error .ginput_container_text input:focus,
.activ-gform_wrapper .gfield_error .ginput_container_email input:focus,
.activ-gform_wrapper .gfield_error .ginput_container_phone input:focus,
.activ-gform_wrapper .gfield_error .ginput_container_select select:focus,
.activ-gform_wrapper .gfield_error .ginput_container_textarea textarea:focus,
.activ-content-block--contact .gform_wrapper .gfield_error .ginput_container_text input:focus,
.activ-content-block--contact .gform_wrapper .gfield_error .ginput_container_email input:focus,
.activ-content-block--contact .gform_wrapper .gfield_error .ginput_container_phone input:focus,
.activ-content-block--contact .gform_wrapper .gfield_error .ginput_container_select select:focus,
.activ-content-block--contact .gform_wrapper .gfield_error .ginput_container_textarea textarea:focus {
	border-bottom-color: var(--wp--preset--color--accent-crimson) !important;
	border-bottom-width: 2px !important;
	padding-bottom: calc(var(--wp--preset--spacing--4) - 1px) !important;
}

.activ-gform_wrapper .gfield_error input[type="checkbox"],
.activ-content-block--contact .gform_wrapper .gfield_error input[type="checkbox"] {
	border-color: var(--wp--preset--color--accent-crimson) !important;
}

.activ-gform_wrapper .gfield_error .gchoice label,
.activ-content-block--contact .gform_wrapper .gfield_error .gchoice label {
	color: var(--wp--preset--color--accent-crimson) !important;
}

.activ-gform_wrapper .gfield_validation_message,
.activ-gform_wrapper .validation_message,
.activ-gform_wrapper .gfield_description.validation_message,
.activ-content-block--contact .gform_wrapper .gfield_validation_message,
.activ-content-block--contact .gform_wrapper .validation_message,
.activ-content-block--contact .gform_wrapper .gfield_description.validation_message {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	color: var(--wp--preset--color--accent-crimson) !important;
	font-family: var(--wp--preset--font-family--albert-sans, "Albert Sans", system-ui, sans-serif);
	font-size: var(--wp--preset--font-size--sm) !important;
	font-weight: 400 !important;
	letter-spacing: -0.5px;
	line-height: 1.3;
	margin: var(--wp--preset--spacing--2) 0 0 !important;
	padding: 0 !important;
}

/* Form-level summary — text only, no alert box / icon. */
.activ-gform_wrapper .gform_validation_errors,
.activ-gform_wrapper div.validation_error,
.activ-content-block--contact .gform_wrapper .gform_validation_errors,
.activ-content-block--contact .gform_wrapper div.validation_error {
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	margin: 0 0 var(--wp--preset--spacing--12) !important;
	outline: none !important;
	padding: 0 0 var(--wp--preset--spacing--4) !important;
	width: 100%;
}

.activ-gform_wrapper .gform_validation_errors > h2,
.activ-gform_wrapper .gform_submission_error,
.activ-content-block--contact .gform_wrapper .gform_validation_errors > h2,
.activ-content-block--contact .gform_wrapper .gform_submission_error {
	color: var(--wp--preset--color--accent-crimson) !important;
	font-family: var(--wp--preset--font-family--albert-sans, "Albert Sans", system-ui, sans-serif);
	font-size: var(--wp--preset--font-size--md) !important;
	font-weight: 500 !important;
	letter-spacing: -0.5px;
	line-height: 1.4;
	margin: 0 !important;
	padding: 0 !important;
	text-align: left !important;
	text-wrap: pretty;
}

.activ-gform_wrapper .gform_validation_errors .gform-icon,
.activ-gform_wrapper .gform_validation_errors > h2::before,
.activ-gform_wrapper .gform_submission_error .gform-icon,
.activ-content-block--contact .gform_wrapper .gform_validation_errors .gform-icon,
.activ-content-block--contact .gform_wrapper .gform_validation_errors > h2::before,
.activ-content-block--contact .gform_wrapper .gform_submission_error .gform-icon {
	display: none !important;
}

.activ-gform_wrapper .gform_validation_errors > ol,
.activ-content-block--contact .gform_wrapper .gform_validation_errors > ol {
	display: none !important;
}

.activ-gform_wrapper .gform_confirmation_message,
.activ-content-block--contact .gform_wrapper .gform_confirmation_message {
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--md);
	letter-spacing: -0.5px;
	line-height: 1.4;
}

/* Contact layout — form sits in the split copy column */
.activ-content-block--split .activ-content-block__copy-inner > .wp-block-gravityforms-form,
.activ-content-block--split .activ-content-block__copy-inner .gform_wrapper {
	max-width: none;
	width: 100%;
}

@media (max-width: 781px) {
	.activ-gform_wrapper .gform_fields,
	.activ-content-block--contact .gform_wrapper .gform_fields {
		gap: var(--wp--preset--spacing--6);
		grid-row-gap: var(--wp--preset--spacing--6) !important;
	}
}
