/* IMPACT Cookies: consent checkboxes in forms (src/Forms/Markup.php). Scoped, inherits the theme. */

.impc-form-consent {
	font: inherit;
	color: inherit;
}

.impc-form-consent--cf7 {
	display: flex;
	flex-direction: column;
	gap: 0.5em;
	margin-block: 0.35em 0;
}

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

.impc-form-consent.impc-form-consent .impc-form-consent__item {
	display: flex !important;
	align-items: center;
	gap: 0.5em;
	margin: 0;
	padding: 0;
	font: inherit;
	line-height: 1.5;
	text-align: start;
	cursor: pointer;
}

/* Centered with the text: form plugins and themes style checkboxes (size, margins, baseline), so
   those are reset here and the row's flex centering does the alignment. */
.impc-form-consent.impc-form-consent .impc-form-consent__input {
	flex: none;
	align-self: center;
	font-size: inherit;
	width: 1em;
	height: 1em;
	margin: 0 !important;
	vertical-align: middle;
	accent-color: currentColor;
	cursor: pointer;
}

.impc-form-consent.impc-form-consent .impc-form-consent__text {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	line-height: inherit;
}

.impc-form-consent--elementor .impc-form-consent__text {
	display: inline;
	cursor: pointer;
}

.impc-form-consent .impc-form-consent__link {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.impc-form-consent .impc-form-consent__link:focus-visible,
.impc-form-consent .impc-form-consent__input:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.impc-form-consent .impc-form-consent__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Error state: CF7 marks the control, Elementor the field group. */
.impc-form-consent .impc-form-consent__input[aria-invalid="true"],
.impc-form-consent.elementor-error .impc-form-consent__input {
	outline: 2px solid #d63638;
	outline-offset: 1px;
}

.impc-form-consent .wpcf7-not-valid-tip,
.impc-form-consent.elementor-error .elementor-message {
	display: block;
	margin-block-start: 0.25em;
	margin-inline-start: 1.6em;
	color: #d63638;
	font-size: 0.9em;
}

/* Placed after the submit button: Elementor's own row gap already separates it. */
.impc-form-consent--elementor {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* Contrast with the form's background (form-consent.js): white on dark, black on light. */
.impc-form-consent.impc-form-consent--on-dark,
.impc-form-consent.impc-form-consent--on-dark .impc-form-consent__text,
.impc-form-consent.impc-form-consent--on-dark .impc-form-consent__link {
	color: #ffffff !important;
}

.impc-form-consent.impc-form-consent--on-light,
.impc-form-consent.impc-form-consent--on-light .impc-form-consent__text,
.impc-form-consent.impc-form-consent--on-light .impc-form-consent__link {
	color: #111111 !important;
}
