/* GPL-2.0-or-later. Native FazlX styling for the ACCM-derived cookie notice. */
.fxd-cookie-notice[hidden],
.fxd-cookie-notice__reopen[hidden],
.fxd-cookie-notice__options[hidden],
.fxd-cookie-notice__warning[hidden] {
	display: none !important;
}

.fxd-cookie-notice {
	position: fixed;
	z-index: 44;
	left: 16px;
	right: 16px;
	bottom: 16px;
	max-height: min( 55vh, 440px );
	overflow: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px 20px;
	width: min( 100% - 32px, 920px );
	margin-inline: auto;
	padding: 14px 18px 14px 22px;
	border: 1px solid var(--edge2, #c8d8cf);
	border-radius: 18px;
	background: var(--bg, #fcfbf9);
	color: var(--txt, #293d39);
	box-shadow: 0 14px 42px rgba(32, 83, 78, .24);
	font: 500 15px/1.5 var(--body, 'Hanken Grotesk', system-ui, sans-serif);
	/* Calm entrance each time the notice is revealed. */
	animation: fxd-cookie-in 220ms cubic-bezier(.2, .8, .2, 1) both;
}

/* Faster exit, added by cookie-notice.js just before the notice is hidden. */
.fxd-cookie-notice.is-leaving {
	animation: fxd-cookie-out 140ms cubic-bezier(.4, 0, 1, 1) both;
	pointer-events: none;
}

@keyframes fxd-cookie-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

@keyframes fxd-cookie-out {
	from { opacity: 1; transform: none; }
	to { opacity: 0; transform: translateY(8px); }
}

@media (prefers-reduced-motion: reduce) {
	.fxd-cookie-notice,
	.fxd-cookie-notice.is-leaving { animation: none; }
}

.fxd-motion-paused .fxd-cookie-notice,
.fxd-motion-paused .fxd-cookie-notice.is-leaving { animation: none; }

.fxd-cookie-notice__copy {
	flex: 1 1 0;
	min-width: min( 100%, 260px );
}

.fxd-cookie-notice__actions {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

.fxd-cookie-notice__options {
	flex: 1 0 100%;
	border-top: 1px solid var(--edge2, #c8d8cf);
	padding-top: 12px;
}

.fxd-cookie-notice__options p { margin: 0 0 8px; }
.fxd-cookie-notice__options label { display: inline-flex; align-items: center; gap: 6px; margin: 0 18px 12px 0; }
.fxd-cookie-notice__options input { width: 20px; height: 20px; accent-color: var(--accent-03-ink, #20534e); }
.fxd-cookie-notice__warning { flex: 1 0 100%; margin: 0; font-weight: 700; }

.fxd-cookie-notice__fallback {
	max-width: 920px;
	margin: 16px auto;
	padding: 14px 18px;
	border: 1px solid var(--edge2, #c8d8cf);
	border-radius: 16px;
	background: var(--bg, #fcfbf9);
	color: var(--txt, #293d39);
	font: 500 14px/1.5 var(--body, 'Hanken Grotesk', system-ui, sans-serif);
}

.fxd-cookie-notice__policy {
	color: var(--accent-03-ink, #20534e);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Accept and Reject carry equal weight in the theme teal. Copper stays reserved for the enquiry action. */
.fxd-cookie-notice__accept,
.fxd-cookie-notice__reject,
.fxd-cookie-notice__options button,
.fxd-cookie-notice__reopen {
	min-height: 44px;
	border: 1px solid var(--accent-03-ink, #20534e);
	border-radius: 100px;
	background: var(--accent-03-ink, #20534e);
	color: #fff;
	font: 700 15px/1.2 var(--body, 'Hanken Grotesk', system-ui, sans-serif);
	white-space: nowrap;
	cursor: pointer;
}

.fxd-cookie-notice__accept,
.fxd-cookie-notice__reject,
.fxd-cookie-notice__options button { padding: 10px 18px; }

.fxd-cookie-notice__reject { background: transparent; color: var(--accent-03-ink, #20534e); }

/* Preferences is a quiet text control, not a third button. */
.fxd-cookie-notice__preferences {
	min-height: 44px;
	padding: 6px 4px;
	border: 0;
	background: transparent;
	color: var(--accent-03-ink, #20534e);
	font: 600 15px/1.2 var(--body, 'Hanken Grotesk', system-ui, sans-serif);
	text-decoration: underline;
	text-underline-offset: 3px;
	white-space: nowrap;
	cursor: pointer;
}

.fxd-cookie-notice__accept:hover,
.fxd-cookie-notice__options button:hover,
.fxd-cookie-notice__reopen:hover {
	background: #173f3b;
	border-color: #173f3b;
}

.fxd-cookie-notice__reject:hover { background: var(--mint, #e6f0e9); }
.fxd-cookie-notice__preferences:hover { text-decoration-thickness: 2px; }

.fxd-cookie-notice__accept:focus-visible,
.fxd-cookie-notice__reject:focus-visible,
.fxd-cookie-notice__preferences:focus-visible,
.fxd-cookie-notice__options button:focus-visible,
.fxd-cookie-notice__options input:focus-visible,
.fxd-cookie-notice__reopen:focus-visible,
.fxd-cookie-notice__policy:focus-visible {
	outline: 3px solid var(--accent-02, #c8793f);
	outline-offset: 3px;
}

.fxd-cookie-notice__reopen {
	position: static;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 12px 20px 20px;
	padding: 10px 18px;
}

/*
 * While the notice is open, cookie-notice.js publishes its height as
 * --fxd-cookie-notice-h on <html>. Scrolling a focused control into view then
 * keeps it clear of the notice (WCAG 2.4.11).
 */
html.fxd-cookie-open {
	scroll-padding-bottom: calc( var(--fxd-cookie-notice-h, 0px) + 32px );
}

@media (max-width: 980px) {
	/* The open mobile menu sits under the notice; hide the notice while the menu is open. */
	.fxd-nav-open .fxd-cookie-notice { visibility: hidden; }
}

@media (max-width: 760px) {
	.fxd-cookie-notice {
		left: 12px;
		right: 12px;
		bottom: calc( 116px + env(safe-area-inset-bottom) );
		width: auto;
		max-height: calc( 100dvh - 132px - env(safe-area-inset-bottom) );
		gap: 10px;
		padding: 12px 14px;
		border-radius: 16px;
		font-size: 14px;
		line-height: 1.45;
	}

	.fxd-cookie-notice__copy { flex: 1 1 100%; min-width: 0; }

	/* One row: Reject optional and Accept all, with Preferences as a compact link at the end. */
	.fxd-cookie-notice__actions {
		display: grid;
		grid-template-columns: 1fr 1fr auto;
		align-items: center;
		gap: 8px;
		width: 100%;
	}

	.fxd-cookie-notice__accept,
	.fxd-cookie-notice__reject { width: 100%; padding: 10px 12px; font-size: 15px; }

	.fxd-cookie-notice__preferences {
		grid-column: auto;
		justify-self: end;
		min-height: 44px;
		padding: 4px 2px;
		font-size: 14px;
	}

	.fxd-cookie-notice__reopen {
		max-width: calc( 100vw - 24px );
	}

	/* The fixed contact bar (about 116px) also sits below the notice on phones. */
	html.fxd-cookie-open {
		scroll-padding-bottom: calc( var(--fxd-cookie-notice-h, 0px) + 132px + env(safe-area-inset-bottom) );
	}
}
