/* Snowy Table's late Gravity Forms integration layer.
 *
 * Gravity Forms discovers footer shortcodes after the main WordPress style
 * queue has been printed. Loading this focused layer from its form hook keeps
 * the plugin's reset/foundation/framework stack intact, then applies the
 * Snowy Table presentation after it without duplicating the full site CSS.
 */

.st-contact-form > .gform_wrapper {
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

body :is(.gform_wrapper.gform-theme, [data-parent-form]) {
	--gf-color-primary: var(--st-evergreen) !important;
	--gf-color-primary-rgb: 36, 91, 69 !important;
	--gf-color-primary-darker: var(--st-evergreen-dark) !important;
	--gf-color-primary-lighter: #507c6b !important;
	--gf-color-in-ctrl-primary: var(--st-evergreen) !important;
	--gf-color-in-ctrl-primary-rgb: 36, 91, 69 !important;
	--gf-color-in-ctrl-primary-darker: var(--st-evergreen-dark) !important;
	--gf-color-in-ctrl-primary-lighter: #507c6b !important;
	--gf-ctrl-border-radius: 10px !important;
	--gf-ctrl-border-color: var(--st-field-border) !important;
	--gf-ctrl-color: var(--st-ink) !important;
	--gf-ctrl-label-color-primary: var(--st-ink) !important;
	--gf-ctrl-label-color-secondary: var(--st-ink-soft) !important;
}

body .gform_wrapper :where(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]), select, textarea) {
	min-height: 48px !important;
	padding: 11px 13px !important;
	color: var(--st-ink) !important;
	background: #fff !important;
	border: 1px solid var(--st-field-border) !important;
	border-radius: 10px !important;
	box-shadow: none !important;
}

body .gform_wrapper :where(input, textarea)::placeholder {
	color: var(--st-muted) !important;
	opacity: 1 !important;
}

body .gform_wrapper :where(.gfield_description, .gform-field-label--type-sub, .gfield_required_text) {
	color: var(--st-muted) !important;
	font-size: 0.84rem !important;
	line-height: 1.5 !important;
}

body .gform_wrapper :where(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]), select, textarea):focus {
	border-color: var(--st-evergreen) !important;
	box-shadow: 0 0 0 3px rgba(36, 91, 69, 0.2) !important;
}

body .gform_wrapper :where(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]), select, textarea)[aria-invalid="true"],
body .gform_wrapper .gfield_error :where(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]), select, textarea) {
	color: var(--st-ink) !important;
	background: #fff7f5 !important;
	border-color: #9a3a2d !important;
	box-shadow: 0 0 0 2px rgba(154, 58, 45, 0.16) !important;
}

body .gform_wrapper .gfield_error :where(.gfield_label, .gfield_validation_message) {
	color: #7b2318 !important;
}

body .gform_wrapper :where(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]), select, textarea):disabled {
	color: #52615a !important;
	background: #eef2ef !important;
	border-color: #89968f !important;
	cursor: not-allowed;
	opacity: 1 !important;
}

body .gform_wrapper :where(.gform_button, input[type="submit"], button[type="submit"]) {
	min-height: 48px !important;
	padding: 12px 21px !important;
	color: #fff !important;
	background: var(--st-evergreen) !important;
	border: 1px solid var(--st-evergreen) !important;
	border-radius: 999px !important;
	box-shadow: none !important;
	font-weight: 800 !important;
}

body .gform_wrapper :where(.gform_button, input[type="submit"], button[type="submit"]):hover {
	background: var(--st-evergreen-dark) !important;
	border-color: var(--st-evergreen-dark) !important;
}
