/**
 * BiiTest Promo Popup — modal styles.
 *
 * Theme colors (override-able per-popup via --popup-accent):
 *   gradient: #1a0b30 → #261246 → #3d1d6e
 *   accent:   #d4006c (brand pink)
 *
 * Layout: overlay + centered card. Mobile-first; 100% responsive.
 */

.biitest-popup {
	--popup-accent: #d4006c;
	position: fixed;
	inset: 0;
	z-index: 9998;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: 'Archivo', 'Inter', -apple-system, sans-serif;
}
.biitest-popup.is-open { display: flex; animation: bii-popup-in 0.32s cubic-bezier(.16,1,.3,1); }

html.biitest-popup-open { overflow: hidden; }
html.biitest-popup-open body { overflow: hidden; }

@keyframes bii-popup-in {
	from { opacity: 0; }
	to { opacity: 1; }
}
@keyframes bii-popup-card-in {
	from { transform: translateY(24px) scale(.96); opacity: 0; }
	to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* Overlay */
.biitest-popup__overlay {
	position: absolute; inset: 0;
	background: radial-gradient(ellipse at center, rgba(26, 11, 48, 0.85), rgba(0, 0, 0, 0.78));
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

/* Card */
.biitest-popup__card {
	position: relative;
	z-index: 1;
	width: min(540px, 100%);
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	background: linear-gradient(135deg, #1a0b30 0%, #261246 45%, #3d1d6e 100%);
	color: #fff;
	border-radius: 20px;
	border: 1px solid rgba(255,255,255,0.10);
	box-shadow: 0 30px 80px -20px rgba(0,0,0,0.55), 0 0 0 1px rgba(212,0,108,0.18);
	animation: bii-popup-card-in 0.4s cubic-bezier(.16,1,.3,1);
}

/* Decorative glow */
.biitest-popup__card::before {
	content: "";
	position: absolute; inset: 0;
	border-radius: inherit;
	background:
		radial-gradient(circle at 15% 20%, rgba(212, 0, 108, 0.30), transparent 45%),
		radial-gradient(circle at 85% 80%, rgba(47, 163, 242, 0.22), transparent 50%);
	pointer-events: none;
	z-index: 0;
}

/* Close button */
.biitest-popup__close {
	position: absolute;
	top: 12px; right: 12px;
	width: 36px; height: 36px;
	border-radius: 50%;
	background: rgba(255,255,255,0.08);
	border: 1px solid rgba(255,255,255,0.14);
	color: #fff;
	cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center;
	z-index: 3;
	transition: background 0.18s ease, transform 0.18s ease;
}
.biitest-popup__close:hover { background: rgba(255,255,255,0.16); transform: rotate(90deg); }
.biitest-popup__close:focus-visible { outline: 2px solid var(--popup-accent); outline-offset: 2px; }

/* Media (optional image) */
.biitest-popup__media {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 20px 20px 0 0;
	background: rgba(0,0,0,0.25);
	z-index: 1;
}
.biitest-popup__media img {
	width: 100%; height: 100%;
	object-fit: cover;
	display: block;
}
.biitest-popup__media::after {
	content: "";
	position: absolute; inset: 0;
	background: linear-gradient(to bottom, transparent 55%, rgba(26, 11, 48, 0.85) 100%);
}

/* Body */
.biitest-popup__body {
	position: relative;
	z-index: 2;
	padding: 28px 28px 24px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	text-align: center;
}

/* Badge */
.biitest-popup__badge {
	align-self: center;
	display: inline-flex;
	align-items: center;
	padding: 6px 14px;
	background: rgba(212, 0, 108, 0.20);
	border: 1px solid rgba(212, 0, 108, 0.40);
	border-radius: 999px;
	color: #ffd0e6;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

/* Title */
.biitest-popup__title {
	font-size: clamp(1.5rem, 4vw, 1.9rem);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.15;
	margin: 0;
	color: #fff;
	text-shadow: 0 2px 14px rgba(0,0,0,0.3);
}

/* Subtitle */
.biitest-popup__subtitle {
	margin: 0;
	font-size: 0.97rem;
	line-height: 1.5;
	color: rgba(255,255,255,0.85);
	max-width: 420px;
	margin-left: auto;
	margin-right: auto;
}

/* Countdown */
.biitest-popup__timer {
	background: rgba(255,255,255,0.06);
	border: 1px solid rgba(255,255,255,0.10);
	border-radius: 14px;
	padding: 14px 18px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}
.biitest-popup__timer-label {
	font-size: 0.78rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(255,255,255,0.6);
	font-weight: 700;
}
.biitest-popup__timer-display {
	font-family: 'JetBrains Mono', 'Archivo Narrow', ui-monospace, monospace;
	font-size: clamp(1.8rem, 5.5vw, 2.4rem);
	font-weight: 800;
	color: var(--popup-accent);
	letter-spacing: 0.04em;
	font-variant-numeric: tabular-nums;
	text-shadow: 0 0 24px rgba(212, 0, 108, 0.45);
}
.biitest-popup__timer-sep {
	display: inline-block;
	animation: bii-popup-blink 1s steps(2, end) infinite;
	margin: 0 2px;
}
@keyframes bii-popup-blink {
	50% { opacity: 0.35; }
}
.biitest-popup__expired {
	font-size: 0.95rem;
	color: #ffb800;
	font-weight: 700;
}

/* Coupon */
.biitest-popup__coupon {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	background: rgba(255,255,255,0.92);
	color: #1a0b30;
	border: 2px dashed var(--popup-accent);
	border-radius: 12px;
	cursor: pointer;
	font-family: inherit;
	width: 100%;
	transition: background 0.18s ease, transform 0.18s ease;
}
.biitest-popup__coupon:hover { background: #fff; transform: translateY(-1px); }
.biitest-popup__coupon.is-copied {
	background: #d1fae5;
	border-color: #10b981;
}
.biitest-popup__coupon-label {
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #50575e;
	font-weight: 700;
	flex: 0 0 auto;
}
.biitest-popup__coupon-code {
	font-family: 'JetBrains Mono', monospace;
	font-size: 1.15rem;
	font-weight: 800;
	color: var(--popup-accent);
	letter-spacing: 0.06em;
	flex: 1;
	text-align: center;
}
.biitest-popup__coupon-action {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.82rem;
	font-weight: 700;
	color: #1a0b30;
	flex: 0 0 auto;
	white-space: nowrap;
}

/* CTA button */
.biitest-popup__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 16px 24px;
	background: linear-gradient(135deg, var(--popup-accent), #ff4d9d);
	color: #fff !important;
	font-weight: 800;
	font-size: 1.02rem;
	letter-spacing: 0.01em;
	border-radius: 12px;
	text-decoration: none !important;
	border: 0;
	cursor: pointer;
	box-shadow: 0 8px 24px -8px rgba(212, 0, 108, 0.65);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.biitest-popup__cta:hover {
	transform: translateY(-1px);
	box-shadow: 0 14px 32px -10px rgba(212, 0, 108, 0.75);
}
.biitest-popup__cta:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Dismiss (subtle close text-link) */
.biitest-popup__dismiss {
	background: none;
	border: 0;
	color: rgba(255,255,255,0.55);
	font-size: 0.85rem;
	cursor: pointer;
	padding: 6px 0;
	font-family: inherit;
	transition: color 0.18s ease;
}
.biitest-popup__dismiss:hover { color: rgba(255,255,255,0.85); }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
	.biitest-popup { padding: 10px; }
	.biitest-popup__card { border-radius: 16px; }
	.biitest-popup__media { aspect-ratio: 16 / 10; border-radius: 16px 16px 0 0; }
	.biitest-popup__body { padding: 22px 20px 20px; gap: 12px; }
	.biitest-popup__title { font-size: clamp(1.3rem, 6vw, 1.6rem); }
	.biitest-popup__subtitle { font-size: 0.9rem; }
	.biitest-popup__timer { padding: 12px 14px; }
	.biitest-popup__timer-display { font-size: clamp(1.6rem, 8vw, 2rem); }
	.biitest-popup__coupon { flex-wrap: wrap; padding: 12px 14px; gap: 8px; text-align: center; }
	.biitest-popup__coupon-label,
	.biitest-popup__coupon-action { flex: 1 1 100%; justify-content: center; }
	.biitest-popup__coupon-code { flex: 1 1 100%; font-size: 1.25rem; }
	.biitest-popup__cta { padding: 14px 20px; font-size: 0.98rem; }
}

@media (max-width: 380px) {
	.biitest-popup__title { font-size: 1.2rem; }
	.biitest-popup__close { top: 8px; right: 8px; width: 32px; height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
	.biitest-popup.is-open,
	.biitest-popup__card { animation: none; }
	.biitest-popup__timer-sep { animation: none; }
}
