/* Garage contact / marketing consent checkbox - registration form (/registrering/) and the marketing consent popup.
   Registration form: a checkbox like the theme's "remember me" checkbox.
   Popup: a toggle like the ones in Min profil (ACF true/false switches). */

/* Theme My Login 7.3+ turns every checkbox row into a flex row (".tml .tml-field-wrap:has(.tml-checkbox) { display: flex }"),
   which squeezes the heading next to the consent text. Keep this row a normal block - the extra "form" makes this win over that rule. */
.tml form .tml-field-wrap.tml-boza_garage_consent-wrap {
	display: block;
}
.boza_consent_checkbox {
	position: relative;
	text-align: left;
	--boza-consent-indent: 2.00em; /* room for the checkbox - the heading and the consent text start here */
}
.boza_consent_popup .boza_consent_checkbox {
	--boza-consent-indent: calc(46px + 0.75em); /* room for the toggle */
}

/* Real checkbox: visually hidden but still reachable with the keyboard */
:is(.tml, .boza_consent_popup) .boza_consent_checkbox input {
	position: absolute;
	top: 0;
	left: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}
:is(.tml, .boza_consent_popup) .boza_consent_checkbox label {
	display: inline-block !important;
	position: relative;
	padding-left: var(--boza-consent-indent);
	line-height: 1.5;
}
:is(.tml, .boza_consent_popup) .boza_consent_checkbox label:hover {
	cursor: pointer;
}


/* Registration form: checkbox */
.tml .boza_consent_checkbox label:before {
	content: '';
	width: 1.25em;
	height: 1.25em;
	position: absolute;
	top: 0.10em;
	left: 0;
	box-sizing: border-box;
	background: #ffffff;
	border: 1px solid rgba(22, 22, 24, 0.1);
	transition: all 0.15s ease-in-out;
}
.tml .boza_consent_checkbox input:checked + label:before {
	border-color: #00b4ea;
}
.tml .boza_consent_checkbox input:focus-visible + label:before {
	border-color: #00b4ea;
	box-shadow: 0 0 0 3px rgba(0, 180, 234, 0.25);
}
/* Hovering the heading / box highlights the box - hovering the chevron doesn't (it only shows the text) */
.tml .boza_consent_checkbox label:hover:not(:has(.boza_garage_consent_toggle:hover)):before {
	border-color: #00b4ea;
}
.tml .boza_consent_checkbox label:after {
	content: '';
	display: block;
	width: 0.75em;
	height: 0.75em;
	position: absolute;
	top: 0.35em;
	left: 0.25em;
	opacity: 0;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%2300b4ea' d='M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z'%3E%3C/path%3E%3C/svg%3E");
	z-index: 1;
	transition: all 0.15s ease-in-out;
}
.tml .boza_consent_checkbox input:checked + label:after {
	opacity: 1;
}


/* Popup: toggle - same sizes and colours as the Min profil switches (css/screen.css ".acf-form .acf-field .acf-switch") */
.boza_consent_popup .boza_consent_checkbox label:before {
	/* track */
	content: '';
	width: 46px;
	height: 22px;
	position: absolute;
	top: calc((1.5em - 22px) / 2); /* centred on the first line of the heading */
	left: 0;
	box-sizing: border-box;
	background: #E3E3E3;
	border: 1px solid #E3E3E3;
	border-radius: 15px;
	transition: all 0.15s ease-in-out;
}
.boza_consent_popup .boza_consent_checkbox label:after {
	/* knob */
	content: '';
	width: 16px;
	height: 16px;
	position: absolute;
	top: calc((1.5em - 16px) / 2);
	left: 5px; /* 1px border + 4px */
	background: #C7C9C9;
	border-radius: 50%;
	transition: all 0.15s ease-in-out;
}
.boza_consent_popup .boza_consent_checkbox input:checked + label:before {
	background: #cae7ef;
	border-color: #cae7ef;
}
.boza_consent_popup .boza_consent_checkbox input:checked + label:after {
	left: 25px; /* 46px - 5px - 16px */
	background: #00b4ea;
}
/* Hovering the heading / toggle highlights the toggle - hovering the chevron doesn't (it only shows the text) */
.boza_consent_popup .boza_consent_checkbox label:hover:not(:has(.boza_garage_consent_toggle:hover)):before {
	border-color: rgba(0, 180, 234, 0.25);
}
.boza_consent_popup .boza_consent_checkbox input:focus-visible + label:before {
	box-shadow: 0 0 0 3px rgba(0, 180, 234, 0.25);
}


/* Heading */
:is(.tml, .boza_consent_popup) .boza_consent_checkbox .boza_garage_consent_title {
	font-weight: 500;
}

/* Chevron after the heading - toggles the consent text */
:is(.tml, .boza_consent_popup) .boza_consent_checkbox .boza_garage_consent_toggle {
	display: none; /* only shown once the JS is running */
	width: 1.50em;
	height: 1.50em;
	margin-left: 0.15em;
	position: relative;
	top: -0.20em; /* centre the chevron on the heading text */
	vertical-align: middle;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: color 0.15s ease-in-out;
}
:is(.tml, .boza_consent_popup) .boza_consent_checkbox.boza_garage_consent_js .boza_garage_consent_toggle {
	display: inline-flex;
}
:is(.tml, .boza_consent_popup) .boza_consent_checkbox .boza_garage_consent_toggle:hover,
:is(.tml, .boza_consent_popup) .boza_consent_checkbox .boza_garage_consent_toggle:focus-visible {
	color: #00b4ea;
	outline: none;
}
:is(.tml, .boza_consent_popup) .boza_consent_checkbox .boza_garage_consent_toggle svg {
	width: 0.80em;
	height: 0.80em;
	fill: currentColor;
	transition: transform 0.20s ease-in-out;
}
:is(.tml, .boza_consent_popup) .boza_consent_checkbox.is_expanded .boza_garage_consent_toggle svg {
	transform: rotate(180deg);
}

/* Consent text - indented under the heading (TML field description on the registration form) */
:is(.tml, .boza_consent_popup) .boza_consent_checkbox :is(.tml-description, .boza_consent_checkbox_description) {
	display: block;
	font-size: inherit; /* the theme shrinks TML descriptions - keep the label's size so the indent matches the label */
	padding-left: var(--boza-consent-indent);
	margin: 0;
	font-style: normal; /* the theme renders TML descriptions in italics */
}
:is(.tml, .boza_consent_popup) .boza_consent_checkbox .boza_garage_consent_message {
	display: grid;
	grid-template-rows: 1fr;
	font-size: 0.68em;
	line-height: 1.5;
	opacity: 0.80;
	transition: grid-template-rows 0.20s ease-in-out, visibility 0.20s ease-in-out;
}
:is(.tml, .boza_consent_popup) .boza_consent_checkbox .boza_garage_consent_message_inner {
	display: block;
	min-height: 0;
	overflow: hidden;
}
:is(.tml, .boza_consent_popup) .boza_consent_checkbox .boza_garage_consent_message_inner:before {
	content: '';
	display: block;
	height: 0.35em; /* spacing under the heading - inside the clipped area so the collapsed state is 0px */
}
:is(.tml, .boza_consent_popup) .boza_consent_checkbox .boza_garage_consent_message_inner p {
	margin: 0 0 0.50em 0;
	font-size: inherit;
	line-height: inherit;
}
:is(.tml, .boza_consent_popup) .boza_consent_checkbox .boza_garage_consent_message_inner p:last-child {
	margin-bottom: 0;
}
/* Collapsed (JS running, not expanded) */
:is(.tml, .boza_consent_popup) .boza_consent_checkbox.boza_garage_consent_js:not(.is_expanded) .boza_garage_consent_message {
	grid-template-rows: 0fr;
	visibility: hidden;
}


/* Marketing consent popup (Fancybox) */
.fancybox_content.boza_consent_popup {
	max-width: 450px !important;
}
.boza_consent_popup .boza_consent_popup_content {
	margin-bottom: 1.50rem;
}
.boza_consent_popup .boza_consent_popup_content > :last-child {
	margin-bottom: 0;
}
.boza_consent_popup .boza_consent_checkbox {
	margin-bottom: 1.75rem;
}
.boza_consent_popup .buttons_holder {
	justify-content: space-between;
}
.boza_consent_popup .boza_consent_popup_yes.loading {
	cursor: progress;
}
/* "Already given" (opened with ?consent_popup=1) - just the "Luk" button, on the right like "Bekræft" */
.boza_consent_popup.boza_consent_popup_given .buttons_holder {
	justify-content: flex-end;
}
.boza_consent_popup .boza_consent_popup_thanks p {
	margin: 0;
	font-weight: 500;
	text-align: center;
}
