/* Clever — поп-ап курсу. Ізольовані стилі (префікс .ccp-), щоб тема їх не ламала. */

.ccp-root {
	--ccp-green: #9fd36e;
	--ccp-green-dark: #89ba5b;
	--ccp-green-soft: #f1f9e9;
	--ccp-text: #344147;
	--ccp-muted: rgba(52, 65, 71, 0.72);

	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: Geologica, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	/* Жести всередині вікна не прокручують сторінку під ним */
	overscroll-behavior: contain;
	touch-action: none;
}

/* Поки вікно відкрите, сторінка під ним не прокручується (клас ставить popup.js) */
html.ccp-scroll-locked,
html.ccp-scroll-locked body {
	overflow: hidden !important;
	overscroll-behavior: none;
}

.ccp-root *,
.ccp-root *::before,
.ccp-root *::after {
	box-sizing: border-box;
}

.ccp-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(24, 33, 37, 0.45);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.ccp-dialog {
	position: relative;
	width: 100%;
	max-width: 420px;
	padding: 32px 28px 22px;
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
	color: var(--ccp-text);
	text-align: center;
	max-height: calc(100% - 16px);
	overflow-y: auto;
	overscroll-behavior: contain;
	touch-action: pan-y; /* якщо вікно вище за екран (телефон боком) — його можна прокрутити */
	opacity: 0;
	transform: translateY(12px) scale(0.98);
	transition: opacity 0.25s ease, transform 0.25s ease;
	outline: none;
}

.ccp-root.is-open .ccp-backdrop {
	opacity: 1;
}

.ccp-root.is-open .ccp-dialog {
	opacity: 1;
	transform: none;
}

/* Декор: конюшинки Clever. Лежать під текстом, усі — всередині вікна з відступом від країв. */
.ccp-root .ccp-decor {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	border-radius: inherit;
	pointer-events: none;
}

.ccp-root .ccp-defs {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

.ccp-root .ccp-clover {
	position: absolute;
	display: block;
}

/* великий, лівий верхній кут — з відступом від країв */
.ccp-root .ccp-clover--1 {
	width: 40px;
	height: 40px;
	top: 14px;
	left: 14px;
	transform: rotate(-14deg);
}

/* дрібний, ліворуч біля заголовка */
.ccp-root .ccp-clover--2 {
	width: 28px;
	height: 28px;
	top: 66px;
	left: 30px;
	transform: rotate(24deg);
}

/* дрібний, праворуч біля другого рядка заголовка */
.ccp-root .ccp-clover--3 {
	width: 24px;
	height: 24px;
	top: 72px;
	right: 34px;
	transform: rotate(-32deg);
}

/* великий, правий нижній кут — з відступом від країв, нижче кнопки */
.ccp-root .ccp-clover--4 {
	width: 46px;
	height: 46px;
	right: 16px;
	bottom: 12px;
	transform: rotate(18deg);
}

/* дрібний, ліворуч від «Не зараз» */
.ccp-root .ccp-clover--5 {
	width: 30px;
	height: 30px;
	left: 26px;
	bottom: 18px;
	transform: rotate(-38deg);
}

/* Вміст — над декором */
.ccp-root .ccp-dialog > :not(.ccp-decor):not(.ccp-close) {
	position: relative;
	z-index: 1;
}

.ccp-root .ccp-close {
	z-index: 2;
}

/* Тексти */
.ccp-root .ccp-title {
	margin: 0 0 10px;
	padding: 0 24px; /* щоб довгий заголовок не заходив під хрестик */
	color: var(--ccp-text);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.25;
}

.ccp-root .ccp-text {
	margin: 0 0 22px;
	color: var(--ccp-muted);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.55;
}

/* Назви тем — просто жирним у реченні */
.ccp-root .ccp-text strong {
	color: var(--ccp-text);
	font-weight: 600;
}

/* Кнопка: без тіні й зсуву, при наведенні лише темнішає */
.ccp-root .ccp-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 52px;
	padding: 14px 20px;
	border: 0;
	border-radius: 12px;
	background: var(--ccp-green);
	box-shadow: none;
	color: #fff !important;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none !important;
	transition: background 0.15s ease;
}

.ccp-root .ccp-cta:hover,
.ccp-root .ccp-cta:focus-visible {
	background: var(--ccp-green-dark);
	box-shadow: none;
	color: #fff !important;
}

/* «Не зараз» */
.ccp-root .ccp-dismiss {
	display: inline-block;
	margin: 12px 0 0;
	padding: 6px 10px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	box-shadow: none;
	color: var(--ccp-muted);
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.3;
	text-transform: none;
	cursor: pointer;
}

/* «Не зараз»: при наведенні змінюється лише колір тексту */
.ccp-root .ccp-dismiss:hover,
.ccp-root .ccp-dismiss:focus,
.ccp-root .ccp-dismiss:active {
	background: transparent;
	box-shadow: none;
	color: var(--ccp-text);
}

/* Хрестик */
.ccp-root .ccp-close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: rgba(52, 65, 71, 0.55);
	cursor: pointer;
}

.ccp-root .ccp-close:hover,
.ccp-root .ccp-close:focus-visible {
	background: rgba(0, 0, 0, 0.05);
	color: var(--ccp-text);
}

.ccp-root .ccp-cta:focus:not(:focus-visible),
.ccp-root .ccp-dismiss:focus:not(:focus-visible),
.ccp-root .ccp-close:focus:not(:focus-visible) {
	outline: none;
}

/* Рамка фокусу лише для клавіатури (Tab) — мишею її не видно */
.ccp-root .ccp-cta:focus-visible,
.ccp-root .ccp-dismiss:focus-visible,
.ccp-root .ccp-close:focus-visible {
	outline: 2px solid var(--ccp-text);
	outline-offset: 2px;
}

/* Телефон: аркуш знизу, не закриває весь екран */
@media (max-width: 600px) {
	.ccp-root {
		align-items: flex-end;
		padding: 0;
	}

	.ccp-dialog {
		max-width: none;
		padding: 28px 20px calc(18px + env(safe-area-inset-bottom, 0px));
		border-radius: 20px 20px 0 0;
		transform: translateY(100%);
	}

	.ccp-root .ccp-title {
		padding: 0 30px;
		font-size: 20px;
	}

	.ccp-root .ccp-text {
		font-size: 14px;
	}

	/* заголовок на телефоні нижчий — дрібні конюшинки трохи вище, щоб не торкались тексту */
	.ccp-root .ccp-clover--2 {
		top: 52px;
		left: 22px;
	}

	.ccp-root .ccp-clover--3 {
		top: 56px;
		right: 26px;
	}

	/* на телефоні заголовок ширший відносно вікна — кутова конюшинка менша */
	.ccp-root .ccp-clover--1 {
		width: 34px;
		height: 34px;
		top: 12px;
		left: 12px;
	}

	.ccp-root .ccp-clover--2 {
		top: 58px;
		left: 14px;
	}

	.ccp-root .ccp-clover--4 {
		width: 40px;
		height: 40px;
		right: 14px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	}

	.ccp-root .ccp-clover--5 {
		left: 18px;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	}
}

@media (prefers-reduced-motion: reduce) {
	.ccp-backdrop,
	.ccp-dialog {
		transition: none;
	}
}
