/* FC-049 — global privacy consent and optional embed preferences. */

.fcsu-consent[hidden],
.fcsu-consent-modal[hidden] {
	display: none !important;
}

.fcsu-consent {
	position: fixed;
	z-index: 9998;
	right: max(var(--fc-space-2), env(safe-area-inset-right));
	bottom: max(var(--fc-space-2), env(safe-area-inset-bottom));
	left: max(var(--fc-space-2), env(safe-area-inset-left));
	max-width: 74rem;
	margin-inline: auto;
	border: 1px solid var(--fc-border);
	border-radius: var(--fc-radius-lg);
	background: var(--fc-surface);
	box-shadow: 0 0.6rem 2rem rgb(32 35 31 / 12%);
	color: var(--fc-text);
}

.fcsu-consent__content {
	display: flex;
	gap: var(--fc-space-3);
	align-items: center;
	justify-content: space-between;
	padding: var(--fc-space-3);
}

.fcsu-consent__copy {
	min-width: 0;
	max-width: 47rem;
}

.fcsu-consent__title {
	display: block;
	margin-bottom: 0.2rem;
	color: var(--fc-brand-primary);
	font-size: 1rem;
	line-height: 1.35;
}

.fcsu-consent__copy p {
	margin: 0;
	color: var(--fc-text-muted);
	font-size: 0.88rem;
	line-height: 1.55;
}

.fcsu-consent__links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--fc-space-2);
	margin-top: 0.35rem !important;
}

.fcsu-consent__links a,
.site-footer__legal .fcsu-consent-footer-button {
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 0.18em;
	cursor: pointer;
}

.fcsu-consent__links a:hover,
.site-footer__legal .fcsu-consent-footer-button:hover {
	color: var(--fc-brand-primary);
}

.fcsu-consent__actions,
.fcsu-consent-modal__actions {
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	gap: var(--fc-space-1);
	align-items: center;
}

.fcsu-consent__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: 0.65rem 1rem;
	border: 1px solid var(--fc-border);
	border-radius: var(--fc-radius-pill);
	background: var(--fc-surface);
	color: var(--fc-text);
	font: inherit;
	font-size: 0.88rem;
	font-weight: 750;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
}

.fcsu-consent__button:hover {
	border-color: var(--fc-brand-primary);
}

.fcsu-consent__button--strong {
	border-color: var(--fc-brand-primary);
	background: var(--fc-brand-primary);
	color: var(--fc-surface);
}

.fcsu-consent__button--strong:hover {
	background: var(--fc-surface);
	color: var(--fc-brand-primary);
}

.fcsu-consent__button:focus-visible,
.fcsu-consent-modal__close:focus-visible,
.fcsu-consent-switch input:focus-visible + span,
.site-footer__legal .fcsu-consent-footer-button:focus-visible {
	outline: 3px solid var(--fc-brand-accent);
	outline-offset: 3px;
}

.fcsu-consent-modal {
	position: fixed;
	z-index: 9999;
	inset: 0;
	display: grid;
	place-items: center;
	padding: max(var(--fc-space-2), env(safe-area-inset-top)) max(var(--fc-space-2), env(safe-area-inset-right)) max(var(--fc-space-2), env(safe-area-inset-bottom)) max(var(--fc-space-2), env(safe-area-inset-left));
}

.fcsu-consent-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgb(32 35 31 / 44%);
}

.fcsu-consent-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: var(--fc-space-3);
	width: min(100%, 38rem);
	max-height: min(44rem, calc(100dvh - (2 * var(--fc-space-2))));
	padding: var(--fc-space-4);
	overflow: auto;
	border: 1px solid var(--fc-border);
	border-radius: var(--fc-radius-lg);
	background: var(--fc-surface);
	box-shadow: 0 1.2rem 3rem rgb(32 35 31 / 20%);
	color: var(--fc-text);
}

.fcsu-consent-modal__dialog:focus {
	outline: 0;
}

.fcsu-consent-modal__head {
	display: flex;
	gap: var(--fc-space-2);
	align-items: flex-start;
	justify-content: space-between;
}

.fcsu-consent-modal__eyebrow {
	margin: 0 0 0.2rem;
	color: var(--fc-brand-accent);
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	line-height: 1.4;
	text-transform: uppercase;
}

.fcsu-consent-modal__head h2 {
	margin: 0;
	color: var(--fc-brand-primary);
	font-size: 1.55rem;
	line-height: 1.2;
}

.fcsu-consent-modal__close {
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	width: 2.6rem;
	height: 2.6rem;
	padding: 0;
	border: 1px solid var(--fc-border);
	border-radius: var(--fc-radius-pill);
	background: var(--fc-surface);
	color: var(--fc-text);
	font: inherit;
	font-size: 1.45rem;
	line-height: 1;
	cursor: pointer;
}

.fcsu-consent-modal__categories {
	display: flex;
	flex-direction: column;
	border-top: 1px solid var(--fc-border);
}

.fcsu-consent-category {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: var(--fc-space-3);
	align-items: center;
	padding-block: var(--fc-space-3);
	border-bottom: 1px solid var(--fc-border);
}

.fcsu-consent-category strong {
	display: block;
	margin-bottom: 0.2rem;
	font-size: 0.98rem;
	line-height: 1.4;
}

.fcsu-consent-category p {
	margin: 0;
	color: var(--fc-text-muted);
	font-size: 0.86rem;
	line-height: 1.55;
}

.fcsu-consent-switch {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
}

.fcsu-consent-switch input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.fcsu-consent-switch > span[aria-hidden="true"] {
	position: relative;
	display: block;
	width: 2.9rem;
	height: 1.65rem;
	border: 1px solid var(--fc-border);
	border-radius: var(--fc-radius-pill);
	background: var(--fc-background);
	cursor: pointer;
}

.fcsu-consent-switch > span[aria-hidden="true"]::after {
	position: absolute;
	top: 0.18rem;
	left: 0.18rem;
	width: 1.15rem;
	height: 1.15rem;
	border-radius: var(--fc-radius-pill);
	background: var(--fc-text-muted);
	content: "";
	transition: transform 140ms ease, background-color 140ms ease;
}

.fcsu-consent-switch input:checked + span[aria-hidden="true"] {
	border-color: var(--fc-brand-primary);
	background: var(--fc-brand-primary);
}

.fcsu-consent-switch input:checked + span[aria-hidden="true"]::after {
	background: var(--fc-surface);
	transform: translateX(1.22rem);
}

.fcsu-consent-switch input:disabled + span[aria-hidden="true"] {
	cursor: not-allowed;
	opacity: 0.72;
}

body.fcsu-consent-open {
	overflow: hidden;
}

/* Optional contact-map gate: same geometry as the existing iframe surface. */
.fcsu-consent-map {
	display: flex;
	flex-direction: column;
	gap: var(--fc-space-2);
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-height: 16rem;
	padding: var(--fc-space-4);
	background: var(--fc-background);
	text-align: center;
}

.fcsu-consent-map__title {
	max-width: 28rem;
	color: var(--fc-brand-primary);
	font-size: 1rem;
	line-height: 1.4;
}

.fcsu-consent-map__copy {
	max-width: 32rem;
	margin: 0;
	color: var(--fc-text-muted);
	font-size: 0.88rem;
	line-height: 1.55;
}

.site-footer__legal .fcsu-consent-footer-button {
	padding: 0;
}

@media (max-width: 860px) {
	.fcsu-consent__content {
		align-items: stretch;
		flex-direction: column;
		gap: var(--fc-space-2);
	}

	.fcsu-consent__actions {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		width: 100%;
	}

	.fcsu-consent__button {
		min-width: 0;
		white-space: normal;
	}
}

@media (max-width: 560px) {
	.fcsu-consent {
		right: max(var(--fc-space-1), env(safe-area-inset-right));
		bottom: max(var(--fc-space-1), env(safe-area-inset-bottom));
		left: max(var(--fc-space-1), env(safe-area-inset-left));
	}

	.fcsu-consent__content {
		padding: var(--fc-space-2);
	}

	.fcsu-consent__actions {
		grid-template-columns: 1fr;
	}

	.fcsu-consent__button {
		width: 100%;
		min-height: 2.65rem;
	}

	.fcsu-consent-modal__dialog {
		padding: var(--fc-space-3);
	}

	.fcsu-consent-category {
		gap: var(--fc-space-2);
	}

	.fcsu-consent-modal__actions {
		display: grid;
		grid-template-columns: 1fr;
	}
}

@media (max-width: 359px) {
	.fcsu-consent__copy p,
	.fcsu-consent-category p,
	.fcsu-consent-map__copy {
		font-size: 0.82rem;
	}

	.fcsu-consent-modal__dialog {
		padding: var(--fc-space-2);
	}

	.fcsu-consent-category {
		grid-template-columns: minmax(0, 1fr) auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fcsu-consent-switch > span[aria-hidden="true"]::after {
		transition: none;
	}
}
