/**
 * Cookie consent (EU / GDPR style) — bottom-centred card + preferences dialog.
 *
 * Namespace: .cispp-cc / .cispp-ccm
 * The card is fixed to the bottom centre of the viewport, never a full-width bar,
 * so it does not hide page content on desktop. On small screens it spans the
 * available width with a 12px gutter.
 */

.cispp-cc {
	position: fixed;
	left: 50%;
	bottom: 20px;
	transform: translate(-50%, 12px);
	z-index: 1000001;
	width: min(880px, calc(100% - 32px));
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s;
}

.cispp-cc.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translate(-50%, 0);
}

.cispp-cc__card {
	display: flex;
	align-items: flex-start;
	gap: 18px;
	padding: 20px 22px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 18px;
	box-shadow: 0 18px 50px -12px rgba(15, 23, 42, 0.28), 0 2px 8px rgba(15, 23, 42, 0.06);
	color: #0f172a;
}

.cispp-cc__icon {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: #fff7ed;
	color: #ea580c;
}

.cispp-cc__icon svg {
	width: 22px;
	height: 22px;
	display: block;
}

.cispp-cc__body {
	flex: 1 1 auto;
	min-width: 0;
}

.cispp-cc__title {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	color: #0f172a;
}

.cispp-cc__text {
	margin: 0;
	font-size: 13px;
	line-height: 1.6;
	color: #475569;
}

.cispp-cc__text a,
.cispp-cc__meta a {
	color: #c2410c;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cispp-cc__meta {
	margin: 8px 0 0;
	font-size: 12px;
	color: #94a3b8;
}

.cispp-cc__actions {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 168px;
}

.cispp-cc__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 9px 16px;
	border-radius: 10px;
	border: 1px solid transparent;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
	font-family: inherit;
	text-decoration: none;
	white-space: nowrap;
}

/* Accept and Reject are styled at the same weight on purpose: GDPR requires
   refusing consent to be as easy as giving it. */
.cispp-cc__btn--primary {
	background: #ea580c;
	border-color: #ea580c;
	color: #ffffff;
}

.cispp-cc__btn--primary:hover {
	background: #c2410c;
	border-color: #c2410c;
}

.cispp-cc__btn--line {
	background: #ffffff;
	border-color: #cbd5e1;
	color: #334155;
}

.cispp-cc__btn--line:hover {
	background: #f8fafc;
	border-color: #94a3b8;
	color: #0f172a;
}

.cispp-cc__btn--ghost {
	background: transparent;
	border-color: transparent;
	color: #64748b;
	font-weight: 500;
	padding: 4px;
}

.cispp-cc__btn--ghost:hover {
	color: #c2410c;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cispp-cc__btn:focus-visible,
.cispp-ccm__btn:focus-visible,
.cispp-ccm__close:focus-visible {
	outline: 2px solid #ea580c;
	outline-offset: 2px;
}

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

.cispp-ccm {
	position: fixed;
	inset: 0;
	z-index: 1000002;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.cispp-ccm[hidden] {
	display: none;
}

.cispp-ccm__overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.cispp-ccm.is-open .cispp-ccm__overlay {
	opacity: 1;
}

.cispp-ccm__panel {
	position: relative;
	width: min(620px, 100%);
	max-height: min(86vh, 720px);
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border-radius: 18px;
	box-shadow: 0 30px 70px -20px rgba(15, 23, 42, 0.45);
	opacity: 0;
	transform: translateY(10px) scale(0.99);
	transition: opacity 0.2s ease, transform 0.2s ease;
	overflow: hidden;
}

.cispp-ccm.is-open .cispp-ccm__panel {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.cispp-ccm__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 24px 16px;
	border-bottom: 1px solid #e2e8f0;
}

.cispp-ccm__head h2 {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	color: #0f172a;
}

.cispp-ccm__head p {
	margin: 6px 0 0;
	font-size: 13px;
	line-height: 1.6;
	color: #64748b;
}

.cispp-ccm__close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 1px solid #e2e8f0;
	border-radius: 9px;
	background: #ffffff;
	color: #64748b;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	font-family: inherit;
}

.cispp-ccm__close:hover {
	background: #f8fafc;
	color: #0f172a;
}

.cispp-ccm__body {
	padding: 6px 24px 4px;
	overflow-y: auto;
}

.cispp-cc__row {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 16px 0;
	border-bottom: 1px solid #f1f5f9;
}

.cispp-cc__row:last-child {
	border-bottom: 0;
}

.cispp-cc__row-main {
	flex: 1 1 auto;
	min-width: 0;
}

.cispp-cc__row-title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 650;
	color: #0f172a;
}

.cispp-cc__tag {
	display: inline-block;
	padding: 2px 7px;
	border-radius: 999px;
	background: #f1f5f9;
	color: #64748b;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.cispp-cc__row-text {
	margin: 0;
	font-size: 12.5px;
	line-height: 1.6;
	color: #64748b;
}

/* Toggle switch */
.cispp-cc__switch {
	position: relative;
	flex: 0 0 auto;
	width: 42px;
	height: 24px;
	margin-top: 2px;
}

.cispp-cc__switch input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 2;
}

.cispp-cc__switch span {
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background: #cbd5e1;
	transition: background-color 0.18s ease;
}

.cispp-cc__switch span::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
	transition: transform 0.18s ease;
}

.cispp-cc__switch input:checked + span {
	background: #ea580c;
}

.cispp-cc__switch input:checked + span::after {
	transform: translateX(18px);
}

.cispp-cc__switch input:disabled + span {
	background: #e2e8f0;
}

.cispp-cc__switch input:disabled + span::after {
	background: #f8fafc;
	box-shadow: none;
}

.cispp-cc__switch input:focus-visible + span {
	outline: 2px solid #ea580c;
	outline-offset: 2px;
}

.cispp-ccm__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 16px 24px;
	border-top: 1px solid #e2e8f0;
	background: #f8fafc;
}

.cispp-ccm__foot-note {
	font-size: 11.5px;
	color: #94a3b8;
	margin: 0;
	max-width: 260px;
	line-height: 1.5;
}

.cispp-ccm__foot-actions {
	display: flex;
	gap: 8px;
	margin-left: auto;
}

.cispp-ccm__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 9px 16px;
	border-radius: 10px;
	border: 1px solid transparent;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.cispp-ccm__btn--primary {
	background: #ea580c;
	border-color: #ea580c;
	color: #ffffff;
}

.cispp-ccm__btn--primary:hover {
	background: #c2410c;
	border-color: #c2410c;
}

.cispp-ccm__btn--line {
	background: #ffffff;
	border-color: #cbd5e1;
	color: #334155;
}

.cispp-ccm__btn--line:hover {
	background: #f1f5f9;
}

/* Inline text link used in the footer to reopen the dialog. */
.cispp-cookie-link {
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
	text-decoration: none;
	transition: color 0.18s ease;
}

.cispp-cookie-link:hover {
	color: #e2e8f0;
	text-decoration: underline;
	text-underline-offset: 3px;
}

footer .cispp-cookie-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

footer .cispp-cookie-link svg {
	width: 14px;
	height: 14px;
	opacity: 0.75;
}

@media (max-width: 760px) {
	.cispp-cc {
		bottom: 12px;
		width: calc(100% - 24px);
	}

	.cispp-cc__card {
		flex-direction: column;
		gap: 12px;
		padding: 16px 16px 14px;
		border-radius: 16px;
	}

	.cispp-cc__icon {
		display: none;
	}

	.cispp-cc__actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
		width: 100%;
		min-width: 0;
		gap: 6px;
	}

	.cispp-cc__btn {
		padding: 11px 12px;
		font-size: 12.5px;
	}

	.cispp-cc__btn--ghost {
		grid-column: 1 / -1;
		order: 3;
		padding: 6px;
	}

	.cispp-ccm {
		padding: 10px;
		align-items: flex-end;
	}

	.cispp-ccm__panel {
		max-height: 88vh;
		border-radius: 16px;
	}

	.cispp-ccm__head,
	.cispp-ccm__body,
	.cispp-ccm__foot {
		padding-left: 16px;
		padding-right: 16px;
	}

	.cispp-ccm__foot {
		flex-direction: column;
		align-items: stretch;
	}

	.cispp-ccm__foot-actions {
		width: 100%;
		margin-left: 0;
	}

	.cispp-ccm__btn {
		flex: 1 1 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cispp-cc,
	.cispp-ccm__overlay,
	.cispp-ccm__panel,
	.cispp-cc__switch span,
	.cispp-cc__switch span::after {
		transition: none;
	}
}
