/**
 * TimeVibe Popup — frontend overlay.
 * The chrome stays neutral on purpose: the popup content itself is
 * designed in Flatsome's UX Builder, so the plugin only provides the
 * centered overlay, backdrop, close button and dismiss checkbox.
 */

.tvp-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.tvp-overlay.tvp-visible {
	opacity: 1;
}

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

.tvp-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	cursor: pointer;
}

.tvp-modal {
	position: relative;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
	max-width: 640px;
	width: 100%;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	transform: translateY(12px);
	transition: transform 0.25s ease;
}

.tvp-overlay.tvp-visible .tvp-modal {
	transform: translateY(0);
}

.tvp-close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.06);
	color: #333;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease;
}

.tvp-close:hover {
	background: rgba(0, 0, 0, 0.15);
}

.tvp-close:focus {
	outline: none;
}

/* Highlight the X only when reached via keyboard, never on open/click. */
.tvp-close:focus-visible {
	outline: 2px solid #333;
	outline-offset: 2px;
	background: rgba(0, 0, 0, 0.15);
}

/* The modal wrapper receives programmatic focus on open — no ring. */
.tvp-modal:focus {
	outline: none;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.tvp-test-banner {
	background: #f5a623;
	color: #1a1a1a;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-align: center;
	padding: 6px 40px;
	border-radius: 6px 6px 0 0;
}

.tvp-content {
	padding: 0;
}

/* UX Builder sections often carry their own padding; avoid double gaps. */
.tvp-content > *:first-child {
	margin-top: 0;
}

.tvp-dismiss {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px 14px;
	font-size: 13px;
	color: #666;
	cursor: pointer;
	user-select: none;
}

.tvp-dismiss input[type="checkbox"] {
	margin: 0;
}

body.tvp-popup-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.tvp-overlay,
	.tvp-modal {
		transition: none;
	}
}

@media (max-width: 549px) {
	.tvp-overlay {
		padding: 12px;
	}
	.tvp-modal {
		max-height: calc(100vh - 24px);
	}
}
