/**
 * Zaltek Cookie Control — banner, preferences panel, reopen widget.
 * Self-contained: scoped under .zcc-root, themed via --zcc-* custom
 * properties so it works on any theme. Defaults match the PEP ICD tokens.
 */

.zcc-root {
	--zcc-accent: #4db69b;
	--zcc-bg: #1f1f1f;
	--zcc-fg: #f5f5f4;
	--zcc-fg-dim: #a3a3a1;
	--zcc-line: rgba(245, 245, 244, 0.14);
	--zcc-radius: 8px;
	--zcc-font: 'Open Sans', 'Segoe UI', sans-serif;
	--zcc-font-display: 'Ubuntu', 'Trebuchet MS', sans-serif;
	font-family: var(--zcc-font);
	font-size: 15px;
	line-height: 1.5;
}

.zcc-theme-light {
	--zcc-bg: #ffffff;
	--zcc-fg: rgba(23, 23, 23, 0.9);
	--zcc-fg-dim: rgba(23, 23, 23, 0.64);
	--zcc-line: rgba(23, 23, 23, 0.12);
}

.zcc-root * {
	box-sizing: border-box;
	margin: 0;
}

/* ---- Overlay -------------------------------------------------------- */

.zcc-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 99997;
}

/* ---- Banner --------------------------------------------------------- */

.zcc-banner {
	position: fixed;
	z-index: 99998;
	background: var(--zcc-bg);
	color: var(--zcc-fg);
	border-top: 1px solid var(--zcc-line);
	padding: 20px clamp(16px, 4vw, 48px);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 32px;
	box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.35);
	animation: zcc-rise 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.zcc-pos-bar {
	left: 0;
	right: 0;
	bottom: 0;
}

.zcc-pos-box-left,
.zcc-pos-box-right {
	bottom: 16px;
	max-width: 420px;
	border: 1px solid var(--zcc-line);
	border-radius: var(--zcc-radius);
	display: block;
}

.zcc-pos-box-left { left: 16px; }
.zcc-pos-box-right { right: 16px; }

.zcc-banner-copy { flex: 1 1 320px; }

.zcc-title {
	font-family: var(--zcc-font-display);
	font-size: 17px;
	font-weight: 600;
	margin-bottom: 6px;
}

.zcc-desc {
	color: var(--zcc-fg-dim);
	max-width: 68ch;
}

.zcc-banner-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.zcc-pos-box-left .zcc-banner-actions,
.zcc-pos-box-right .zcc-banner-actions {
	margin-top: 16px;
}

/* ---- Buttons -------------------------------------------------------- */

.zcc-btn {
	font: 600 14px/1 var(--zcc-font);
	border-radius: 999px;
	padding: 12px 22px;
	cursor: pointer;
	border: 1px solid transparent;
	transition: filter 0.15s ease, background 0.15s ease;
}

.zcc-btn-primary {
	background: var(--zcc-accent);
	border-color: var(--zcc-accent);
	color: #10201b;
}

.zcc-btn-primary:hover { filter: brightness(1.1); }

.zcc-btn-secondary {
	background: transparent;
	border-color: var(--zcc-line);
	color: var(--zcc-fg);
}

.zcc-btn-secondary:hover { border-color: var(--zcc-fg-dim); }

.zcc-btn-link {
	background: none;
	border: none;
	color: var(--zcc-fg-dim);
	text-decoration: underline;
	text-underline-offset: 3px;
	padding: 12px 6px;
}

.zcc-btn-link:hover { color: var(--zcc-fg); }

.zcc-root a.zcc-statement {
	color: var(--zcc-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.zcc-root :focus-visible {
	outline: 2px solid var(--zcc-accent);
	outline-offset: 2px;
}

/* ---- Preferences panel ---------------------------------------------- */

.zcc-panel {
	position: fixed;
	z-index: 99999;
	inset: 0;
	margin: auto;
	width: min(560px, calc(100vw - 32px));
	height: fit-content;
	max-height: min(85vh, 720px);
	display: flex;
	flex-direction: column;
	background: var(--zcc-bg);
	color: var(--zcc-fg);
	border: 1px solid var(--zcc-line);
	border-radius: var(--zcc-radius);
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
	animation: zcc-rise 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.zcc-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid var(--zcc-line);
}

.zcc-panel-head .zcc-title {
	font-size: 19px;
	margin: 0;
}

.zcc-close {
	background: none;
	border: none;
	color: var(--zcc-fg-dim);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 8px;
	border-radius: 4px;
}

.zcc-close:hover { color: var(--zcc-fg); }

.zcc-panel-body {
	overflow-y: auto;
	padding: 8px 24px;
}

.zcc-panel-statement {
	padding: 14px 0 18px;
	font-size: 14px;
}

.zcc-panel-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding: 16px 24px;
	border-top: 1px solid var(--zcc-line);
}

/* ---- Category rows --------------------------------------------------- */

.zcc-cat {
	padding: 16px 0;
	border-bottom: 1px solid var(--zcc-line);
}

.zcc-cat:last-of-type { border-bottom: none; }

.zcc-cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.zcc-cat-label {
	font-family: var(--zcc-font-display);
	font-weight: 600;
	font-size: 15px;
	cursor: pointer;
}

.zcc-cat-locked .zcc-cat-label { cursor: default; }

.zcc-cat-desc {
	color: var(--zcc-fg-dim);
	font-size: 14px;
	margin-top: 6px;
	max-width: 60ch;
}

/* ---- Toggle switch ---------------------------------------------------- */

.zcc-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	flex: none;
}

.zcc-toggle-input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0.0001;
	cursor: pointer;
}

.zcc-toggle-input:disabled { cursor: default; }

.zcc-slider {
	position: absolute;
	inset: 0;
	background: var(--zcc-line);
	border-radius: 999px;
	transition: background 0.2s ease;
	pointer-events: none;
}

.zcc-slider::before {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--zcc-fg);
	transition: transform 0.2s ease;
}

.zcc-toggle-input:checked + .zcc-slider { background: var(--zcc-accent); }
.zcc-toggle-input:checked + .zcc-slider::before { transform: translateX(20px); }
.zcc-toggle-input:disabled + .zcc-slider { opacity: 0.55; }

.zcc-toggle-input:focus-visible + .zcc-slider {
	outline: 2px solid var(--zcc-accent);
	outline-offset: 2px;
}

/* ---- Reopen widget ---------------------------------------------------- */

.zcc-widget {
	position: fixed;
	bottom: 16px;
	z-index: 99996;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid var(--zcc-line);
	background: var(--zcc-bg);
	color: var(--zcc-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
	transition: transform 0.15s ease;
}

.zcc-widget:hover { transform: scale(1.08); }

.zcc-widget-left { left: 16px; }
.zcc-widget-right { right: 16px; }

/* ---- Motion ----------------------------------------------------------- */

@keyframes zcc-rise {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.zcc-root *,
	.zcc-banner,
	.zcc-panel {
		animation: none !important;
		transition: none !important;
	}
}
