/**
 * Consentkeep front-end styles.
 *
 * Colours, radii and width come from CSS custom properties written inline by
 * PHP from the plugin settings, so the whole look is configurable without a
 * stylesheet edit.
 */

:root {
	--ck-bg: #111827;
	--ck-text: #e5e7eb;
	--ck-accent: #2563eb;
	--ck-accent-text: #ffffff;
	--ck-surface: #ffffff;
	--ck-surface-text: #111827;
	--ck-radius: 8px;
	--ck-btn-radius: 6px;
	--ck-max-width: 1200px;
	--ck-font: inherit;
	--ck-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
	--ck-z: 2147483000;
}

.ck-banner,
.ck-modal,
.ck-float {
	box-sizing: border-box;
	font-family: var(--ck-font);
	font-size: 15px;
	line-height: 1.55;
}

.ck-banner *,
.ck-modal *,
.ck-float * {
	box-sizing: border-box;
}

/* ------------------------------------------------------------------ banner */

.ck-banner {
	position: fixed;
	z-index: var(--ck-z);
	left: 0;
	right: 0;
	background: var(--ck-bg);
	color: var(--ck-text);
	box-shadow: var(--ck-shadow);
	opacity: 0;
	transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.ck-banner[hidden] {
	display: none;
}

.ck-banner.ck-pos-bottom {
	bottom: 0;
	transform: translateY(110%);
}

.ck-banner.ck-pos-top {
	top: 0;
	transform: translateY(-110%);
}

.ck-banner.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.ck-banner__inner {
	display: flex;
	align-items: center;
	gap: 28px;
	max-width: var(--ck-max-width);
	margin: 0 auto;
	padding: 20px clamp(16px, 4vw, 32px);
}

.ck-banner__copy {
	flex: 1 1 auto;
	min-width: 0;
}

.ck-banner__title {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	color: inherit;
}

.ck-banner__message {
	margin: 0;
	font-size: 14px;
	opacity: 0.92;
}

.ck-banner__message p {
	margin: 0 0 6px;
}

.ck-banner__message p:last-child {
	margin-bottom: 0;
}

.ck-banner__actions {
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

/* Box and centred layouts reuse the same markup. */

.ck-banner.ck-layout-box,
.ck-banner.ck-layout-center {
	left: auto;
	right: clamp(12px, 3vw, 28px);
	bottom: clamp(12px, 3vw, 28px);
	max-width: 420px;
	border-radius: var(--ck-radius);
}

.ck-banner.ck-layout-box .ck-banner__inner,
.ck-banner.ck-layout-center .ck-banner__inner {
	display: block;
	padding: 22px;
}

.ck-banner.ck-layout-box .ck-banner__actions,
.ck-banner.ck-layout-center .ck-banner__actions {
	margin-top: 18px;
}

.ck-banner.ck-layout-center {
	left: 50%;
	right: auto;
	top: 50%;
	bottom: auto;
	transform: translate(-50%, -46%);
	max-width: 480px;
}

.ck-banner.ck-layout-center.is-visible {
	transform: translate(-50%, -50%);
}

.ck-banner.ck-pos-bottom-left {
	left: clamp(12px, 3vw, 28px);
	right: auto;
}

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

.ck-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 11px 20px;
	border: 1px solid transparent;
	border-radius: var(--ck-btn-radius);
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.ck-btn--primary {
	background: var(--ck-accent);
	border-color: var(--ck-accent);
	color: var(--ck-accent-text);
}

.ck-btn--primary:hover,
.ck-btn--primary:focus-visible {
	opacity: 0.9;
}

.ck-btn--secondary {
	border-color: currentColor;
	opacity: 0.85;
}

.ck-btn--secondary:hover,
.ck-btn--secondary:focus-visible {
	opacity: 1;
}

.ck-btn--ghost {
	text-decoration: underline;
	text-underline-offset: 3px;
	padding-inline: 8px;
	opacity: 0.85;
}

.ck-btn--ghost:hover,
.ck-btn--ghost:focus-visible {
	opacity: 1;
}

.ck-btn:focus-visible,
.ck-modal__close:focus-visible,
.ck-float:focus-visible,
.ck-switch__input:focus-visible + .ck-switch__track {
	outline: 2px solid var(--ck-accent);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------- links */

.ck-links {
	margin: 8px 0 0;
	font-size: 13px;
}

.ck-link {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ck-links__sep {
	margin: 0 8px;
	opacity: 0.5;
}

/* ------------------------------------------------------------------ modal */

.ck-modal {
	position: fixed;
	inset: 0;
	z-index: calc(var(--ck-z) + 10);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(12px, 4vw, 40px);
	opacity: 0;
	transition: opacity 0.24s ease;
}

.ck-modal[hidden] {
	display: none;
}

.ck-modal.is-visible {
	opacity: 1;
}

.ck-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.62);
}

.ck-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 560px;
	max-height: 88vh;
	background: var(--ck-surface);
	color: var(--ck-surface-text);
	border-radius: var(--ck-radius);
	box-shadow: var(--ck-shadow);
	transform: translateY(12px);
	transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.ck-modal.is-visible .ck-modal__dialog {
	transform: translateY(0);
}

.ck-modal__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 24px 12px;
}

.ck-modal__title {
	margin: 0;
	font-size: 19px;
	font-weight: 600;
	color: inherit;
}

.ck-modal__close {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.6;
}

.ck-modal__close:hover {
	opacity: 1;
}

.ck-modal__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 0 24px 8px;
}

.ck-modal__intro {
	margin-bottom: 18px;
	font-size: 14px;
	opacity: 0.85;
}

.ck-modal__intro p {
	margin: 0 0 8px;
}

.ck-modal__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	padding: 16px 24px 22px;
	border-top: 1px solid rgba(127, 127, 127, 0.22);
}

.ck-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-left: auto;
}

.ck-modal__foot .ck-links {
	margin: 0;
}

/* -------------------------------------------------------------- categories */

.ck-cats {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ck-cat {
	padding: 16px 0;
	border-top: 1px solid rgba(127, 127, 127, 0.18);
}

.ck-cat:first-child {
	border-top: 0;
}

.ck-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.ck-cat__label {
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

.ck-cat.is-locked .ck-cat__label {
	cursor: default;
}

.ck-cat__desc {
	margin: 6px 0 0;
	font-size: 13.5px;
	line-height: 1.5;
	opacity: 0.78;
}

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

.ck-switch {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
}

.ck-switch__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.ck-switch__track {
	position: relative;
	display: block;
	width: 46px;
	height: 26px;
	border-radius: 999px;
	background: rgba(127, 127, 127, 0.38);
	transition: background-color 0.2s ease;
	cursor: pointer;
}

.ck-switch__thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.ck-switch__input:checked + .ck-switch__track {
	background: var(--ck-accent);
}

.ck-switch__input:checked + .ck-switch__track .ck-switch__thumb {
	transform: translateX(20px);
}

.ck-switch__input:disabled + .ck-switch__track {
	opacity: 0.55;
	cursor: not-allowed;
}

.ck-switch__note {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	opacity: 0.6;
}

/* ------------------------------------------------------------- placeholder */

.ck-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	min-height: 180px;
	padding: 28px 20px;
	border: 1px dashed rgba(127, 127, 127, 0.45);
	border-radius: var(--ck-radius);
	background: rgba(127, 127, 127, 0.07);
	text-align: center;
}

.ck-placeholder__text {
	margin: 0;
	max-width: 44ch;
	font-size: 14px;
	line-height: 1.5;
}

/* ---------------------------------------------------------------- floating */

.ck-float {
	position: fixed;
	left: clamp(12px, 2vw, 22px);
	bottom: clamp(12px, 2vw, 22px);
	z-index: calc(var(--ck-z) - 10);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border: 0;
	border-radius: 999px;
	background: var(--ck-bg);
	color: var(--ck-text);
	font: inherit;
	font-size: 13px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
	cursor: pointer;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.ck-float[hidden] {
	display: none;
}

.ck-float.is-visible {
	opacity: 0.92;
	transform: translateY(0);
}

.ck-float:hover {
	opacity: 1;
}

.ck-float__icon {
	display: inline-flex;
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 782px) {
	.ck-banner__inner {
		display: block;
		padding: 18px 18px 20px;
	}

	.ck-banner__actions {
		margin-top: 16px;
	}

	.ck-banner__actions .ck-btn {
		flex: 1 1 auto;
		justify-content: center;
	}

	.ck-banner.ck-layout-box,
	.ck-banner.ck-layout-center {
		left: 8px;
		right: 8px;
		bottom: 8px;
		top: auto;
		max-width: none;
		transform: translateY(110%);
	}

	.ck-banner.ck-layout-center.is-visible,
	.ck-banner.ck-layout-box.is-visible {
		transform: translateY(0);
	}

	.ck-modal__actions {
		width: 100%;
	}

	.ck-modal__actions .ck-btn {
		flex: 1 1 auto;
	}

	.ck-float__label {
		display: none;
	}
}

html.ck-modal-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.ck-banner,
	.ck-modal,
	.ck-modal__dialog,
	.ck-float,
	.ck-switch__thumb {
		transition: none !important;
	}
}

@media (prefers-contrast: more) {
	.ck-banner,
	.ck-modal__dialog {
		border: 2px solid currentColor;
	}
}
