/*
 * CE Anunț Studiu — study-ended modal.
 * Uses PixelGrid :root tokens when present, with literal fallbacks.
 * z-index 9800: above theme content/nav (max 1001), below the GDPR Cookie
 * Compliance info bar (9900) and its settings lightbox (9990+), so the cookie
 * banner stays visible and clickable at all times.
 */

.ce-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 9800;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(45, 49, 66, 0.55);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.ce-popup-overlay[hidden] {
	display: none;
}

body.ce-popup-lock {
	overflow: hidden;
}

.ce-popup-dialog {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 520px;
	margin: auto;
	background: #fff;
	border-radius: var(--radius-lg, 16px);
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
	overflow: hidden;
	font-family: var(--font-body, 'Montserrat', sans-serif);
	color: var(--color-text, #3D3D3D);
	text-align: center;
	animation: ce-popup-in 0.25s ease-out both;
}

.ce-popup-dialog *,
.ce-popup-dialog *::before,
.ce-popup-dialog *::after {
	box-sizing: border-box;
}

@keyframes ce-popup-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.ce-popup-band {
	display: block;
	height: 6px;
	background: linear-gradient(90deg,
		var(--color-coral, #FF6B6B),
		var(--color-yellow, #FFD93D),
		var(--color-teal, #4ECDC4),
		var(--color-purple, #9B59B6));
}

.ce-popup-close {
	position: absolute;
	top: 16px;
	right: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--color-dark, #2D3142);
	cursor: pointer;
	transition: background 0.2s ease;
}

.ce-popup-close:hover {
	background: var(--bg-purple-wash, #F9F5FD);
}

.ce-popup-body {
	padding: 40px 40px 36px;
}

.ce-popup-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin-bottom: 20px;
	border-radius: 50%;
	background: rgba(78, 205, 196, 0.18);
	color: var(--color-teal, #4ECDC4);
}

.ce-popup-title {
	margin: 0 0 10px;
	font-family: var(--font-heading, 'Poppins', sans-serif);
	font-size: 28px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--color-dark, #2D3142);
}

.ce-popup-subtitle {
	margin: 0 0 24px;
	font-family: var(--font-body, 'Montserrat', sans-serif);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--color-coral, #FF6B6B);
}

.ce-popup-card {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 0 0 28px;
	padding: 16px 18px;
	border-radius: var(--radius-md, 10px);
	background: var(--bg-purple-wash, #F9F5FD);
	text-align: left;
}

.ce-popup-dl {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	color: var(--color-purple, #9B59B6);
}

.ce-popup-text {
	margin: 0;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.55;
	color: var(--color-text, #3D3D3D);
}

.ce-popup-text strong {
	font-weight: 600;
	color: var(--color-dark, #2D3142);
}

.ce-popup-text a {
	font-weight: 600;
	color: var(--color-coral, #FF6B6B);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ce-popup-text a:hover {
	color: #e85555;
}

/* Mirrors the theme's .btn.btn--coral */
.ce-popup-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 16px 40px;
	border: 0;
	border-radius: var(--radius-sm, 6px);
	background: var(--color-coral, #FF6B6B);
	color: #fff;
	font-family: var(--font-body, 'Montserrat', sans-serif);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.15s ease;
}

.ce-popup-btn:hover,
.ce-popup-btn:visited,
.ce-popup-btn:focus {
	color: #fff;
	text-decoration: none;
}

.ce-popup-btn:hover {
	background: #e85555;
	transform: translateY(-1px);
}

.ce-popup-btn:active {
	transform: translateY(0);
}

.ce-popup-close:focus,
.ce-popup-btn:focus {
	outline: none;
}

.ce-popup-close:focus-visible,
.ce-popup-btn:focus-visible {
	outline: 3px solid var(--color-teal, #4ECDC4);
	outline-offset: 3px;
}

@media (max-width: 479px) {
	.ce-popup-overlay {
		padding: 12px;
	}

	.ce-popup-body {
		padding: 32px 20px 24px;
	}

	.ce-popup-title {
		font-size: 23px;
	}

	.ce-popup-subtitle {
		font-size: 16px;
	}

	.ce-popup-card {
		gap: 12px;
		padding: 14px;
	}

	.ce-popup-btn {
		padding: 15px 20px;
	}
}

/*
 * Short phones: the GDPR cookie bar (~150px tall on mobile, z-index 9900)
 * would cover the bottom of a centred dialog. Pin the dialog to the top and
 * reserve space below so the button stays clear (overlay scrolls if needed).
 */
@media (max-width: 479px) and (max-height: 760px) {
	.ce-popup-overlay {
		align-items: flex-start;
		padding-bottom: 170px;
	}

	.ce-popup-dialog {
		margin: 0 auto;
	}
}

/*
 * Floating button shown after the modal is closed; reopens the modal.
 * z-index 9700: above theme content/nav, below the modal and the GDPR bar.
 */
.ce-popup-fab {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 9700;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 8px 20px 8px 8px;
	border: 0;
	border-radius: 999px;
	background: var(--color-coral, #FF6B6B);
	color: #fff;
	font-family: var(--font-body, 'Montserrat', sans-serif);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: 0 10px 28px rgba(255, 107, 107, 0.45), 0 2px 8px rgba(0, 0, 0, 0.12);
	transition: opacity 0.3s ease, transform 0.2s ease, background 0.2s ease;
}

.ce-popup-fab[hidden] {
	display: none;
}

.ce-popup-fab.is-hidden {
	opacity: 0;
	pointer-events: none;
}

/* Attention ring pulsing around the button */
.ce-popup-fab::before {
	content: '';
	position: absolute;
	inset: 0;
	border: 2px solid var(--color-teal, #4ECDC4);
	border-radius: inherit;
	pointer-events: none;
	animation: ce-popup-fab-ring 2.4s ease-out infinite;
}

.ce-popup-fab:hover {
	background: #e85555;
	transform: translateY(-2px);
}

.ce-popup-fab:focus {
	outline: none;
}

.ce-popup-fab:focus-visible {
	outline: 3px solid var(--color-teal, #4ECDC4);
	outline-offset: 3px;
}

.ce-popup-fab-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #fff;
	color: var(--color-coral, #FF6B6B);
}

.ce-popup-fab-icon svg {
	animation: ce-popup-fab-nudge 2.4s ease-in-out infinite;
}

@keyframes ce-popup-fab-ring {
	0% {
		opacity: 0.9;
		transform: scale(1);
	}
	70%,
	100% {
		opacity: 0;
		transform: scale(1.12, 1.5);
	}
}

@keyframes ce-popup-fab-nudge {
	0%,
	40%,
	100% {
		transform: translateY(0);
	}
	15% {
		transform: translateY(3px);
	}
	28% {
		transform: translateY(-1px);
	}
}


@media (max-width: 479px) {
	.ce-popup-fab {
		right: 16px;
		bottom: 16px;
		padding: 6px 16px 6px 6px;
		font-size: 14px;
	}

	.ce-popup-fab-icon {
		width: 34px;
		height: 34px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ce-popup-dialog {
		animation: none;
	}

	.ce-popup-fab,
	.ce-popup-fab::before,
	.ce-popup-fab-icon svg {
		animation: none;
		transition: none;
	}

	.ce-popup-btn,
	.ce-popup-close {
		transition: none;
	}

	.ce-popup-btn:hover {
		transform: none;
	}
}
