/*
 * Exit-intent popup for anonymous visitors who have completed at least one
 * tutorial step. Built on the site's own token system (--cw-*, with hardcoded
 * fallbacks — see lucidprogress-step-toggle for why) so it reads as part of
 * the same design language, not a one-off overlay.
 */

.lucidprogress-exit-popup__overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(26, 28, 32, 0.6);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	animation: lucidprogress-exit-popup-fade 200ms ease;
	box-sizing: border-box;
}

@keyframes lucidprogress-exit-popup-fade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes lucidprogress-exit-popup-pop {
	from {
		opacity: 0;
		transform: translateY(10px) scale(0.97);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.lucidprogress-exit-popup {
	position: relative;
	width: 100%;
	max-width: 420px;
	padding: 44px 32px 32px;
	background: var(--cw-white, #fff);
	border-radius: var(--cw-radius-card, 16px);
	box-shadow: var(--cw-shadow-raised, 0 8px 32px rgba(45, 45, 53, 0.12)), 0 1px 0 rgba(255, 255, 255, 0.4) inset;
	text-align: center;
	box-sizing: border-box;
	overflow: hidden;
	animation: lucidprogress-exit-popup-pop 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lucidprogress-exit-popup::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--cw-teal, #4a9494), var(--cw-clay, #c67560));
}

.lucidprogress-exit-popup__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin: 0 0 18px;
	border-radius: 50%;
	background: var(--cw-clay-tint, rgba(198, 117, 96, 0.08));
	color: var(--cw-clay, #c67560);
}

.lucidprogress-exit-popup__icon svg {
	width: 26px;
	height: 26px;
	display: block;
}

.lucidprogress-exit-popup__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	appearance: none;
	-webkit-appearance: none;
	border: none;
	border-radius: 50%;
	background: transparent;
	color: var(--cw-quiet, #6f7979);
	cursor: pointer;
	transition: background 150ms ease, color 150ms ease;
}

.lucidprogress-exit-popup__close svg {
	width: 16px;
	height: 16px;
	display: block;
}

.lucidprogress-exit-popup__close:hover,
.lucidprogress-exit-popup__close:focus {
	background: var(--cw-fog, #f0f0f6);
	color: var(--cw-ink, #1a1c20);
}

.lucidprogress-exit-popup__close:focus-visible {
	outline: 2px solid var(--cw-teal, #4a9494);
	outline-offset: 2px;
}

.lucidprogress-exit-popup__title {
	margin: 0 0 12px;
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 28px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--cw-ink, #1a1c20);
}

.lucidprogress-exit-popup__text {
	margin: 0 0 28px;
	font-size: 15px;
	line-height: 1.6;
	color: var(--cw-ink-light, #3f4948);
}

.lucidprogress-exit-popup__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	box-sizing: border-box;
	padding: 14px 24px;
	border-radius: 9999px;
	background: var(--cw-clay, #c67560);
	color: var(--cw-white, #fff);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	box-shadow: 0 2px 10px rgba(198, 117, 96, 0.35);
	transition: background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.lucidprogress-exit-popup__button:hover,
.lucidprogress-exit-popup__button:focus {
	background: var(--cw-clay-dark, #914a38);
	color: var(--cw-white, #fff);
	box-shadow: 0 4px 14px rgba(145, 74, 56, 0.4);
	transform: translateY(-1px);
}

.lucidprogress-exit-popup__button:active {
	transform: translateY(0);
}

.lucidprogress-exit-popup__button:focus-visible {
	outline: 2px solid var(--cw-clay-dark, #914a38);
	outline-offset: 3px;
}

@media (max-width: 480px) {
	.lucidprogress-exit-popup {
		padding: 36px 24px 24px;
	}

	.lucidprogress-exit-popup__title {
		font-size: 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lucidprogress-exit-popup__overlay,
	.lucidprogress-exit-popup {
		animation: none;
	}
}
