/**
 * Fixu Consent: banner, preferences panel and permanent link.
 *
 * Neutral and theme independent. Override the custom properties below on
 * :root (or on .fixu-consent-banner / .fixu-consent-overlay) to restyle.
 *
 * Contrast ratios (WCAG 2.x, computed):
 *   fg  #1a1a1a on bg  #ffffff  17.40:1  (text)
 *   muted #4a4a4a on #ffffff     8.86:1  (secondary text)
 *   accent #0b4a9e on #ffffff    8.44:1  (links)
 *   error #a30000 on #ffffff     8.21:1  (error text)
 *   button fg #1a1a1a on #ffffff 17.40:1; hover bg #f0f0f0 15.27:1
 *   floating button #ffffff on #1a1a1a 17.40:1
 *   focus ring #0b57d0 on #ffffff 6.39:1 (non-text, needs 3:1)
 */
:root {
	--fixu-consent-bg: #ffffff;
	--fixu-consent-fg: #1a1a1a;
	--fixu-consent-muted: #4a4a4a;
	--fixu-consent-accent: #0b4a9e;
	--fixu-consent-border: #1a1a1a;
	--fixu-consent-hover: #f0f0f0;
	--fixu-consent-focus: #0b57d0;
	--fixu-consent-error: #a30000;
	--fixu-consent-backdrop: rgba(0, 0, 0, 0.6);
	--fixu-consent-radius: 8px;
	--fixu-consent-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--fixu-consent-z: 2147483000;
}

.fixu-consent-banner,
.fixu-consent-overlay,
.fixu-consent-floating {
	font-family: var(--fixu-consent-font);
	font-size: 16px;
	line-height: 1.5;
	color: var(--fixu-consent-fg);
	box-sizing: border-box;
}

.fixu-consent-banner *,
.fixu-consent-overlay *,
.fixu-consent-floating {
	box-sizing: border-box;
}

.fixu-consent-banner[hidden],
.fixu-consent-overlay[hidden],
.fixu-consent-floating[hidden],
.fixu-consent-error[hidden] {
	display: none !important;
}

/* Banner: bottom of the viewport. */
.fixu-consent-banner {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: var(--fixu-consent-z);
	max-height: 90vh;
	overflow-y: auto;
	background: var(--fixu-consent-bg);
	border-top: 3px solid var(--fixu-consent-border);
	box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
}

.fixu-consent-banner-inner {
	max-width: 960px;
	margin: 0 auto;
	padding: 16px;
}

.fixu-consent-title {
	margin: 0 0 8px;
	font-size: 1.25rem;
	line-height: 1.3;
	font-weight: 700;
	color: var(--fixu-consent-fg);
}

.fixu-consent-body,
.fixu-consent-row-desc {
	margin: 0 0 12px;
	color: var(--fixu-consent-fg);
}

.fixu-consent-row-desc {
	color: var(--fixu-consent-muted);
	font-size: 0.9375rem;
}

.fixu-consent-policy-link {
	display: inline-block;
	margin: 0 0 12px;
	padding: 10px 0;
	color: var(--fixu-consent-accent);
	text-decoration: underline;
}

.fixu-consent-inventory .fixu-consent-policy-link {
	margin: 0;
	padding: 0;
}

.fixu-consent-error {
	margin: 0 0 12px;
	padding: 8px 12px;
	border: 2px solid var(--fixu-consent-error);
	border-radius: var(--fixu-consent-radius);
	color: var(--fixu-consent-error);
	font-weight: 600;
}

/* Buttons: identical size, weight and colors on purpose (no primary). */
.fixu-consent-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.fixu-consent-btn,
.fixu-consent-floating {
	appearance: none;
	min-height: 44px;
	min-width: 44px;
	padding: 10px 20px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	border-radius: var(--fixu-consent-radius);
	text-align: center;
}

.fixu-consent-btn {
	flex: 1 1 0;
	background: var(--fixu-consent-bg);
	color: var(--fixu-consent-fg);
	border: 2px solid var(--fixu-consent-border);
}

.fixu-consent-btn:hover {
	background: var(--fixu-consent-hover);
}

.fixu-consent-banner a:focus-visible,
.fixu-consent-overlay a:focus-visible,
.fixu-consent-btn:focus-visible,
.fixu-consent-checkbox:focus-visible,
.fixu-consent-floating:focus-visible,
.fixu-consent-link:focus-visible {
	outline: 3px solid var(--fixu-consent-focus);
	outline-offset: 2px;
}

/* Panel: modal with scrollable content, usable at 320px. The overlay dims the
   page; the panel itself keeps its own opaque background and contrast. */
div.fixu-consent-overlay {
	position: fixed;
	inset: 0;
	z-index: calc(var(--fixu-consent-z) + 1);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	background-color: rgba(0, 0, 0, 0.6);
	background-color: var(--fixu-consent-backdrop, rgba(0, 0, 0, 0.6));
}

.fixu-consent-panel {
	width: 100%;
	max-width: 640px;
	max-height: calc(100vh - 16px);
	max-height: calc(100dvh - 16px);
	overflow-y: auto;
	padding: 16px;
	background: var(--fixu-consent-bg);
	border-radius: var(--fixu-consent-radius);
	overscroll-behavior: contain;
}

.fixu-consent-row {
	margin: 0 0 12px;
	padding: 12px;
	border: 1px solid var(--fixu-consent-muted);
	border-radius: var(--fixu-consent-radius);
}

.fixu-consent-row-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 4px;
}

.fixu-consent-checkbox {
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	margin: 0;
	accent-color: var(--fixu-consent-accent);
}

.fixu-consent-row-label {
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	min-height: 44px;
	font-weight: 700;
	cursor: pointer;
}

.fixu-consent-row-locked .fixu-consent-row-label {
	cursor: default;
}

.fixu-consent-inventory {
	margin: 0;
	padding: 0 0 0 20px;
	font-size: 0.875rem;
	color: var(--fixu-consent-muted);
}

.fixu-consent-inventory-item {
	margin: 4px 0;
}

.fixu-consent-tool {
	color: var(--fixu-consent-fg);
}

/* Permanent "Privacy preferences" entry points. */
.fixu-consent-floating {
	position: fixed;
	left: 12px;
	bottom: 12px;
	z-index: calc(var(--fixu-consent-z) - 1);
	background: var(--fixu-consent-fg);
	color: var(--fixu-consent-bg);
	border: 2px solid var(--fixu-consent-fg);
	padding: 8px 14px;
	font-size: 0.875rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.fixu-consent-link {
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
}

@media (max-width: 600px) {
	.fixu-consent-actions {
		flex-direction: column;
	}

	.fixu-consent-btn {
		flex: 0 0 auto;
		width: 100%;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.fixu-consent-btn,
	.fixu-consent-floating {
		transition: background-color 0.15s ease;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fixu-consent-banner *,
	.fixu-consent-overlay *,
	.fixu-consent-floating {
		transition: none !important;
		animation: none !important;
		scroll-behavior: auto !important;
	}
}
