/* ================================================================
	RetainFlow — Popup UI
	Clean, professional, theme-agnostic
	================================================================ */



/* ── Lock scroll ── */
body.cs-lock { overflow: hidden !important; }

/* ── Overlay ── */
#cs-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 9999999;
	background: rgba(10, 10, 20, 0.72);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: var(--cs-font);
}
#cs-overlay.cs-visible {
	display: flex;
	animation: cs-fade-in 0.2s ease;
}

@keyframes cs-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* ── Popup card ── */
#cs-popup {
	background: var(--cs-surface);
	border-radius: calc(var(--cs-radius) + 6px);
	width: 100%;
	max-width: 460px;
	position: relative;
	box-shadow: var(--cs-shadow-popup);
	overflow: hidden;
	animation: cs-popup-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cs-popup-in {
	from { transform: scale(0.88) translateY(24px); opacity: 0; }
	to   { transform: scale(1) translateY(0);       opacity: 1; }
}

/* ── Header band ── */
.cs-popup-header {
	background: linear-gradient(135deg, var(--cs-primary) 0%, var(--cs-primary-dark) 100%);
	padding: 28px 32px 24px;
	text-align: center;
	position: relative;
}

.cs-popup-header::after {
	content: '';
	position: absolute;
	bottom: -1px;
	left: 0; right: 0;
	height: 20px;
	background: var(--cs-surface);
	border-radius: calc(var(--cs-radius) + 6px) calc(var(--cs-radius) + 6px) 0 0;
}

.cs-popup-emoji {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 12px;
	filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.cs-popup-header h2 {
	font-size: 22px !important;
	font-weight: 800 !important;
	color: #ffffff !important;
	margin: 0 !important;
	line-height: 1.25 !important;
	letter-spacing: -0.3px;
}

.cs-popup-header p {
	font-size: 13.5px !important;
	color: rgba(255,255,255,0.85) !important;
	margin: 6px 0 0 !important;
	line-height: 1.5 !important;
}

/* ── Close button ── */
#cs-close {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: rgba(255,255,255,0.15);
	border: none;
	color: rgba(255,255,255,0.8);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, transform 0.15s;
	padding: 0;
}
#cs-close:hover {
	background: rgba(255,255,255,0.28);
	transform: scale(1.1);
	color: #fff;
}

/* ── Body ── */
.cs-popup-body {
	padding: 20px 24px 24px;
}

/* ── Offer buttons ── */
.cs-offers {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 16px;
}

.cs-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 13px 16px;
	background: var(--cs-bg);
	border: 1.5px solid var(--cs-border);
	border-radius: 12px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 14px;
	font-weight: 600;
	color: #1a1a2e;
	cursor: pointer;
	transition: all 0.18s ease;
	text-align: left;
	position: relative;
	overflow: hidden;
}

.cs-btn::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, #667eea, #764ba2);
	opacity: 0;
	transition: opacity 0.18s;
}

.cs-btn:hover {
	border-color: var(--cs-accent);
	color: var(--cs-accent);
	background: #f6f7ff;
	transform: translateX(3px);
	box-shadow: 0 4px 16px rgba(79,70,229,0.12);
}

.cs-btn .cs-btn-icon {
	font-size: 18px;
	flex-shrink: 0;
	position: relative;
	z-index: 1;
}

.cs-btn .cs-btn-content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	position: relative;
	z-index: 1;
}

.cs-btn .cs-btn-text {
	position: relative;
	z-index: 1;
}

.cs-btn .cs-btn-desc {
	font-size: 11px;
	color: #6b7280;
	line-height: 1.35;
	font-weight: 400;
	text-align: left;
}

.cs-btn--hl .cs-btn-desc {
	color: rgba(255, 255, 255, 0.75);
}

/* Highlight button (discount) */
.cs-btn--hl {
	background: linear-gradient(135deg, var(--cs-primary), var(--cs-primary-dark));
	border-color: transparent;
	color: #ffffff;
	box-shadow: 0 4px 20px rgba(15,52,96,0.35);
	align-items: center;
	flex-wrap: nowrap;
	gap: 10px;
}

.cs-btn--hl .cs-btn-text {
	flex: 1;
	min-width: 0;
}

.cs-btn--hl:hover {
	background: linear-gradient(135deg, #0f3460, #533483);
	border-color: transparent;
	color: #ffffff;
	transform: translateX(3px);
	box-shadow: 0 6px 24px rgba(15,52,96,0.45);
}

.cs-btn--hl .cs-btn-tag {
	margin-left: auto;
	flex-shrink: 0;
	white-space: nowrap;
	background: #f59e0b;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 20px;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	position: relative;
	z-index: 1;
	line-height: 1.2;
}

/* Loading state */
.cs-btn.cs-loading {
	opacity: 0.65;
	cursor: not-allowed;
	pointer-events: none;
}

.cs-btn.cs-loading::after {
	content: '';
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255,255,255,0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: cs-spin 0.7s linear infinite;
}

@keyframes cs-spin {
	to { transform: translateY(-50%) rotate(360deg); }
}

/* ── Divider ── */
.cs-divider {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 14px 0 12px;
	color: #bbb;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.8px;
}
.cs-divider::before,
.cs-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: #eee;
}

/* ── Cancel link ── */
#cs-cancel-anyway {
	display: block;
	width: 100%;
	background: none;
	border: none;
	color: #aaa;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 12.5px;
	font-weight: 500;
	cursor: pointer;
	text-align: center;
	padding: 6px;
	transition: color 0.15s;
	text-decoration: underline;
	text-underline-offset: 3px;
}
#cs-cancel-anyway:hover { color: #666; }

/* ── Message states ── */
.cs-msg {
	border-radius: 10px;
	padding: 12px 16px;
	font-size: 13.5px;
	font-weight: 500;
	margin-bottom: 14px;
	display: none;
	line-height: 1.5;
}
.cs-msg.cs-ok {
	background: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
	display: block;
}
.cs-msg.cs-err {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
	display: block;
}

/* ── Trust footer ── */
.cs-trust {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 24px 16px;
	font-size: 11px;
	color: #bbb;
}
.cs-trust-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #10b981;
	flex-shrink: 0;
	animation: cs-pulse 2s infinite;
}
@keyframes cs-pulse {
	0%, 100% { opacity: 1; }
	50%       { opacity: 0.4; }
}

/* ── Mobile ── */
@media (max-width: 480px) {
	#cs-popup { border-radius: 16px; }
	.cs-popup-header { padding: 24px 20px 20px; }
	.cs-popup-body { padding: 16px 16px 20px; }
	.cs-popup-header h2 { font-size: 19px !important; }
	.cs-btn { font-size: 13px; padding: 12px 14px; }
}
