/* -----------------------------------------------------------------------------
 * Nezaboravime — Cookie consent UI
 * On-brand (Fraunces + Inter, cream/paper, forget-me-not blue), readable,
 * with entrance motion and dedicated tablet / mobile (bottom-sheet) layouts.
 * Falls back to literal brand colors where the theme tokens aren't present.
 * -------------------------------------------------------------------------- */

.nzb-cookie,
.nzb-cookie-inline {
	--nzb-c-ink: var(--nv-ink, #2e2a24);
	--nzb-c-muted: var(--nv-muted, #5a5248);
	--nzb-c-faint: var(--nv-faint, #8a8175);
	--nzb-c-line: var(--nv-line, #d9d2c4);
	--nzb-c-soft-line: var(--nv-soft-line, #e6dfd1);
	--nzb-c-cream: var(--nv-cream, #f4f1ea);
	--nzb-c-cream-deep: var(--nv-cream-deep, #efe9dc);
	--nzb-c-paper: var(--nv-paper, #faf7f1);
	--nzb-c-blue: var(--nv-blue, #5d8ab1);
	--nzb-c-blue-strong: #4d769a;
	--nzb-c-serif: var(--nv-serif, "Fraunces", "EB Garamond", Georgia, serif);
	--nzb-c-sans: var(--nv-sans, "Inter", "Segoe UI", Arial, sans-serif);
	--nzb-c-flower: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%235d8ab1'%3E%3Ccircle cx='12' cy='5' r='4'/%3E%3Ccircle cx='19' cy='10' r='4'/%3E%3Ccircle cx='16.2' cy='18' r='4'/%3E%3Ccircle cx='7.8' cy='18' r='4'/%3E%3Ccircle cx='5' cy='10' r='4'/%3E%3C/g%3E%3Ccircle cx='12' cy='12' r='3' fill='%23d9c46b'/%3E%3C/svg%3E");
}

.nzb-cookie[hidden],
.nzb-cookie__dialog[hidden] {
	display: none !important;
}

.nzb-cookie,
.nzb-cookie *,
.nzb-cookie-inline,
.nzb-cookie-inline * {
	box-sizing: border-box;
}

.nzb-cookie,
.nzb-cookie-inline {
	color: var(--nzb-c-ink);
	font-family: var(--nzb-c-sans);
}

.nzb-cookie {
	z-index: 99998;
}

.nzb-cookie--settings .nzb-cookie__banner {
	display: none;
}

/* -------------------------------------------------------------------------- */
/* Banner (bottom-left note card)                                             */
/* -------------------------------------------------------------------------- */

.nzb-cookie__banner {
	align-items: center;
	animation: nzb-cookie-rise 420ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
	background: var(--nzb-c-paper);
	border: 1px solid var(--nzb-c-soft-line);
	border-radius: 16px;
	bottom: 22px;
	box-shadow: 0 22px 55px rgba(46, 42, 36, 0.2);
	display: grid;
	gap: 26px;
	grid-template-columns: 1fr minmax(210px, auto);
	left: 22px;
	max-width: min(860px, calc(100vw - 44px));
	overflow: hidden;
	padding: 26px 28px;
	position: fixed;
	z-index: 99998;
}

/* Soft brand wash + hairline accent along the top edge. */
.nzb-cookie__banner::before {
	background: linear-gradient(90deg, var(--nzb-c-blue), color-mix(in srgb, var(--nzb-c-blue) 55%, var(--nzb-c-cream-deep)));
	content: "";
	height: 3px;
	left: 0;
	position: absolute;
	right: 0;
	top: 0;
}

.nzb-cookie__eyebrow {
	align-items: center;
	color: var(--nzb-c-blue);
	display: flex;
	font-size: 12px;
	font-weight: 700;
	gap: 8px;
	letter-spacing: 0.14em;
	margin: 0 0 10px;
	text-transform: uppercase;
}

.nzb-cookie__eyebrow::before {
	background: var(--nzb-c-flower) center / contain no-repeat;
	content: "";
	flex: none;
	height: 16px;
	width: 16px;
}

.nzb-cookie__title,
.nzb-cookie__dialog-title {
	color: var(--nzb-c-ink);
	font-family: var(--nzb-c-serif);
	font-weight: 400;
	line-height: 1.12;
	margin: 0;
}

.nzb-cookie__title {
	font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.6rem);
	margin-bottom: 8px;
}

.nzb-cookie__dialog-title {
	font-size: clamp(1.5rem, 1.2rem + 1.1vw, 1.9rem);
}

.nzb-cookie__text {
	color: var(--nzb-c-muted);
	font-size: 0.95rem;
	line-height: 1.6;
	margin: 0;
}

.nzb-cookie__links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	margin: 14px 0 0;
}

.nzb-cookie__links a,
.nzb-cookie__linkbtn {
	background: transparent;
	border: 0;
	border-radius: 4px;
	color: var(--nzb-c-blue-strong);
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	padding: 0;
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, var(--nzb-c-blue) 45%, transparent);
	text-underline-offset: 3px;
	transition: text-decoration-color 150ms ease, color 150ms ease;
}

.nzb-cookie__links a:hover,
.nzb-cookie__linkbtn:hover {
	color: var(--nzb-c-ink);
	text-decoration-color: currentColor;
}

/* -------------------------------------------------------------------------- */
/* Actions / buttons                                                          */
/* -------------------------------------------------------------------------- */

.nzb-cookie__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	justify-content: center;
}

.nzb-cookie__dialog-actions {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.nzb-cookie__btn {
	align-items: center;
	background: var(--nzb-c-paper);
	border: 1px solid var(--nzb-c-line);
	border-radius: 999px;
	color: var(--nzb-c-ink);
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-size: 0.94rem;
	font-weight: 700;
	justify-content: center;
	line-height: 1.2;
	min-height: 46px;
	padding: 11px 22px;
	text-align: center;
	transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.nzb-cookie__btn:hover {
	border-color: var(--nzb-c-faint);
	transform: translateY(-1px);
}

/* Primary affirmative action = brand blue pill. */
.nzb-cookie__btn--dark {
	background: var(--nzb-c-blue);
	border-color: var(--nzb-c-blue);
	box-shadow: 0 8px 20px rgba(93, 138, 177, 0.28);
	color: #fff;
}

.nzb-cookie__btn--dark:hover {
	background: var(--nzb-c-blue-strong);
	border-color: var(--nzb-c-blue-strong);
}

.nzb-cookie__btn:focus-visible,
.nzb-cookie__linkbtn:focus-visible,
.nzb-cookie__links a:focus-visible,
.nzb-cookie__close:focus-visible {
	outline: 2px solid color-mix(in srgb, var(--nzb-c-blue) 55%, transparent);
	outline-offset: 3px;
}

/* -------------------------------------------------------------------------- */
/* Permanently visible form on the cookie policy page                         */
/* -------------------------------------------------------------------------- */ 

.nzb-cookie-inline {
	background: var(--nzb-c-paper);
	border: 1px solid var(--nzb-c-soft-line);
	border-radius: 18px;
	box-shadow: 0 18px 45px rgba(46, 42, 36, 0.11);
	margin: 0 0 40px;
	overflow: hidden;
	padding: 30px;
	position: relative;
}

.nzb-cookie-inline::before {
	background: linear-gradient(90deg, var(--nzb-c-blue), color-mix(in srgb, var(--nzb-c-blue) 55%, var(--nzb-c-cream-deep)));
	content: "";
	height: 3px;
	left: 0;
	position: absolute;
	right: 0;
	top: 0;
}

.nzb-cookie-inline .nzb-cookie__dialog-title {
	margin-bottom: 12px;
}

.nzb-cookie-inline__status {
	color: var(--nzb-c-blue-strong);
	font-size: 0.9rem;
	font-weight: 700;
	margin: 16px 0 0;
}

/* -------------------------------------------------------------------------- */
/* Preferences dialog                                                         */
/* -------------------------------------------------------------------------- */

.nzb-cookie__dialog {
	align-items: center;
	animation: nzb-cookie-fade 220ms ease both;
	backdrop-filter: blur(2px);
	background: rgba(46, 42, 36, 0.5);
	display: flex;
	inset: 0;
	justify-content: center;
	padding: 24px;
	position: fixed;
	z-index: 99999;
}

.nzb-cookie-lock {
	overflow: hidden;
}

.nzb-cookie__dialog-panel {
	animation: nzb-cookie-pop 320ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
	background: var(--nzb-c-paper);
	border: 1px solid var(--nzb-c-soft-line);
	border-radius: 18px;
	box-shadow: 0 28px 80px rgba(46, 42, 36, 0.28);
	max-height: min(780px, calc(100vh - 48px));
	max-width: 640px;
	overflow: auto;
	padding: 34px 34px 30px;
	position: relative;
	width: 100%;
}

.nzb-cookie__dialog-head {
	align-items: flex-start;
	display: flex;
	gap: 18px;
	justify-content: space-between;
	margin-bottom: 12px;
}

.nzb-cookie__dialog-head .nzb-cookie__eyebrow {
	margin-bottom: 8px;
}

.nzb-cookie__close {
	align-items: center;
	background: var(--nzb-c-cream);
	border: 1px solid var(--nzb-c-soft-line);
	border-radius: 999px;
	color: var(--nzb-c-muted);
	cursor: pointer;
	display: inline-flex;
	flex: none;
	font: inherit;
	font-size: 22px;
	height: 40px;
	justify-content: center;
	line-height: 1;
	transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
	width: 40px;
}

.nzb-cookie__close:hover {
	background: var(--nzb-c-cream-deep);
	color: var(--nzb-c-ink);
	transform: rotate(90deg);
}

.nzb-cookie__groups {
	display: grid;
	gap: 12px;
	margin: 22px 0;
}

.nzb-cookie__group {
	align-items: center;
	background: var(--nzb-c-cream);
	border: 1px solid var(--nzb-c-soft-line);
	border-radius: 12px;
	display: grid;
	gap: 16px;
	grid-template-columns: 1fr auto;
	padding: 16px 18px;
	transition: border-color 150ms ease, background-color 150ms ease;
}

.nzb-cookie__group:has(input:checked:not(:disabled)) {
	background: color-mix(in srgb, var(--nzb-c-blue) 8%, var(--nzb-c-paper));
	border-color: color-mix(in srgb, var(--nzb-c-blue) 40%, var(--nzb-c-soft-line));
}

.nzb-cookie__group h3 {
	color: var(--nzb-c-ink);
	font-family: var(--nzb-c-serif);
	font-size: 1.12rem;
	font-weight: 400;
	margin: 0 0 5px;
}

.nzb-cookie__group p {
	color: var(--nzb-c-muted);
	font-size: 0.9rem;
	line-height: 1.5;
	margin: 0;
}

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

.nzb-cookie__switch {
	display: inline-flex;
	flex: none;
}

.nzb-cookie__switch input {
	position: absolute;
	visibility: hidden;
}

.nzb-cookie__switch span {
	background: #cfc6b6;
	border-radius: 999px;
	cursor: pointer;
	display: block;
	height: 30px;
	position: relative;
	transition: background-color 180ms ease;
	width: 54px;
}

.nzb-cookie__switch span::after {
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(46, 42, 36, 0.28);
	content: "";
	height: 24px;
	left: 3px;
	position: absolute;
	top: 3px;
	transition: transform 180ms cubic-bezier(0.22, 0.61, 0.36, 1);
	width: 24px;
}

.nzb-cookie__switch input:checked + span {
	background: var(--nzb-c-blue);
}

.nzb-cookie__switch input:checked + span::after {
	transform: translateX(24px);
}

.nzb-cookie__switch input:focus-visible + span {
	outline: 2px solid color-mix(in srgb, var(--nzb-c-blue) 55%, transparent);
	outline-offset: 3px;
}

.nzb-cookie__switch input:disabled + span {
	cursor: default;
	opacity: 0.7;
}

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

@keyframes nzb-cookie-rise {
	from { opacity: 0; transform: translateY(24px); }
	to   { opacity: 1; transform: translateY(0); }
}

@keyframes nzb-cookie-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes nzb-cookie-pop {
	from { opacity: 0; transform: translateY(14px) scale(0.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* -------------------------------------------------------------------------- */
/* Tablet                                                                     */
/* -------------------------------------------------------------------------- */

@media (max-width: 900px) {
	.nzb-cookie__banner {
		bottom: 18px;
		gap: 20px;
		grid-template-columns: 1fr;
		left: 18px;
		max-width: min(560px, calc(100vw - 36px));
		padding: 24px 24px 22px;
		right: 18px;
	}

	.nzb-cookie__actions {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.nzb-cookie__actions .nzb-cookie__btn {
		flex: 1 1 46%;
	}

	.nzb-cookie__actions .nzb-cookie__linkbtn {
		flex: 1 1 100%;
		margin-top: 2px;
		text-align: center;
	}

	.nzb-cookie__dialog-panel {
		padding: 28px 26px 24px;
	}

	.nzb-cookie-inline {
		padding: 26px;
	}
}

/* -------------------------------------------------------------------------- */
/* Mobile — banner full-width, dialog becomes a bottom sheet                  */
/* -------------------------------------------------------------------------- */

@media (max-width: 560px) {
	.nzb-cookie__banner {
		border-radius: 16px 16px 0 0;
		bottom: 0;
		gap: 18px;
		left: 0;
		max-width: 100%;
		padding: 22px 20px calc(20px + env(safe-area-inset-bottom, 0px));
		right: 0;
	}

	.nzb-cookie__actions {
		flex-direction: column;
	}

	.nzb-cookie__actions .nzb-cookie__btn,
	.nzb-cookie__actions .nzb-cookie__linkbtn {
		flex: 1 1 100%;
		width: 100%;
	}

	.nzb-cookie__dialog {
		align-items: flex-end;
		padding: 0;
	}

	.nzb-cookie__dialog-panel {
		animation-name: nzb-cookie-sheet;
		border-bottom: 0;
		border-radius: 20px 20px 0 0;
		max-height: 90vh;
		max-width: 100%;
		padding: 26px 20px calc(24px + env(safe-area-inset-bottom, 0px));
	}

	/* Drag-handle affordance at the top of the sheet. */
	.nzb-cookie__dialog-panel::before {
		background: var(--nzb-c-line);
		border-radius: 999px;
		content: "";
		height: 4px;
		left: 50%;
		position: absolute;
		top: 9px;
		transform: translateX(-50%);
		width: 42px;
	}

	.nzb-cookie__dialog-head {
		margin-top: 8px;
	}

	.nzb-cookie__dialog-title {
		font-size: 1.45rem;
	}

	.nzb-cookie__group {
		align-items: start;
		gap: 12px;
		grid-template-columns: 1fr auto;
	}

	.nzb-cookie__dialog-actions .nzb-cookie__btn {
		flex: 1 1 100%;
		width: 100%;
	}

	.nzb-cookie__dialog-actions .nzb-cookie__linkbtn {
		margin: 2px auto 0;
	}

	.nzb-cookie-inline {
		border-radius: 14px;
		padding: 24px 18px;
	}
}

@keyframes nzb-cookie-sheet {
	from { opacity: 0; transform: translateY(100%); }
	to   { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------------------- */
/* Reduced motion                                                             */
/* -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.nzb-cookie__banner,
	.nzb-cookie__dialog,
	.nzb-cookie__dialog-panel,
	.nzb-cookie__btn,
	.nzb-cookie__close,
	.nzb-cookie__switch span,
	.nzb-cookie__switch span::after {
		animation: none;
		transition: none;
	}
}
