/* Payment success / failed page styles for Stripe Paywall Bridge */

.spb-success-page,
.spb-failed-page {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 80vh;
	padding: 40px 20px;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.spb-success-page {
	background: linear-gradient(135deg, #dcfce7 0%, #f0f9ff 50%, #f5f3ff 100%);
}

.spb-failed-page {
	background: linear-gradient(135deg, #fee2e2 0%, #fff7ed 50%, #fef2f2 100%);
}

.spb-success-page::before {
	content: '';
	position: absolute;
	width: 600px;
	height: 600px;
	background: radial-gradient(circle, rgba(34, 197, 94, .15) 0%, transparent 70%);
	top: -200px;
	left: -200px;
	animation: spbBlob 10s ease-in-out infinite alternate;
}

.spb-success-page::after {
	content: '';
	position: absolute;
	width: 500px;
	height: 500px;
	background: radial-gradient(circle, rgba(99, 102, 241, .12) 0%, transparent 70%);
	bottom: -150px;
	right: -150px;
	animation: spbBlob 12s ease-in-out infinite alternate-reverse;
}

.spb-failed-page::before {
	content: '';
	position: absolute;
	width: 600px;
	height: 600px;
	background: radial-gradient(circle, rgba(239, 68, 68, .15) 0%, transparent 70%);
	top: -200px;
	right: -200px;
	animation: spbBlobRed 10s ease-in-out infinite alternate;
}

.spb-failed-page::after {
	content: '';
	position: absolute;
	width: 500px;
	height: 500px;
	background: radial-gradient(circle, rgba(249, 115, 22, .12) 0%, transparent 70%);
	bottom: -150px;
	left: -150px;
	animation: spbBlobRed 12s ease-in-out infinite alternate-reverse;
}

@keyframes spbBlob {
	from { transform: translate(0, 0) scale(1); }
	to { transform: translate(40px, 40px) scale(1.1); }
}

@keyframes spbBlobRed {
	from { transform: translate(0, 0) scale(1); }
	to { transform: translate(-40px, 40px) scale(1.1); }
}

.spb-success-card,
.spb-failed-card {
	position: relative;
	z-index: 1;
	background: rgba(255, 255, 255, .95);
	backdrop-filter: blur(10px);
	border-radius: 28px;
	max-width: 620px;
	width: 100%;
	padding: 64px 48px;
	text-align: center;
	animation: spbFadeUp .7s ease;
}

.spb-success-card {
	box-shadow: 0 25px 80px rgba(0, 0, 0, .08), 0 10px 30px rgba(34, 197, 94, .1);
}

.spb-failed-card {
	box-shadow: 0 25px 80px rgba(0, 0, 0, .08), 0 10px 30px rgba(239, 68, 68, .1);
}

@keyframes spbFadeUp {
	from { opacity: 0; transform: translateY(30px); }
	to { opacity: 1; transform: translateY(0); }
}

.spb-success-icon,
.spb-failed-icon {
	width: 110px;
	height: 110px;
	margin: 0 auto 28px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.spb-success-icon {
	background: linear-gradient(135deg, #22c55e, #16a34a);
	box-shadow: 0 12px 40px rgba(34, 197, 94, .35);
	animation: spbPop .6s cubic-bezier(.175, .885, .32, 1.275) .2s both;
}

.spb-failed-icon {
	background: linear-gradient(135deg, #ef4444, #f97316);
	box-shadow: 0 12px 40px rgba(239, 68, 68, .35);
	animation: spbShake .6s ease .4s both;
}

@keyframes spbPop {
	from { transform: scale(0); }
	70% { transform: scale(1.15); }
	to { transform: scale(1); }
}

@keyframes spbShake {
	0%, 100% { transform: translateX(0); }
	20%, 60% { transform: translateX(-8px); }
	40%, 80% { transform: translateX(8px); }
}

.spb-success-icon svg,
.spb-failed-icon svg {
	width: 54px;
	height: 54px;
}

.spb-check {
	stroke-dasharray: 60;
	stroke-dashoffset: 60;
	animation: spbDraw .6s ease .6s forwards;
}

@keyframes spbDraw {
	to { stroke-dashoffset: 0; }
}

.spb-success-card h1,
.spb-failed-card h1 {
	font-size: 36px;
	font-weight: 800;
	color: #111827;
	margin: 0 0 14px;
	letter-spacing: -1px;
}

.spb-success-card .spb-lead,
.spb-failed-card .spb-lead {
	font-size: 18px;
	color: #4b5563;
	line-height: 1.6;
	margin: 0 auto 28px;
	max-width: 420px;
}

.spb-success-divider,
.spb-failed-divider {
	width: 64px;
	height: 4px;
	border-radius: 4px;
	margin: 0 auto 28px;
}

.spb-success-divider {
	background: linear-gradient(90deg, #22c55e, #16a34a);
}

.spb-failed-divider {
	background: linear-gradient(90deg, #ef4444, #f97316);
}

.spb-success-actions,
.spb-failed-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	justify-content: center;
	margin-bottom: 36px;
}

.spb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 15px 32px;
	border-radius: 14px;
	font-size: 16px;
	font-weight: 600;
	text-decoration: none !important;
	transition: transform .2s, box-shadow .2s;
}

.spb-btn:hover {
	transform: translateY(-2px);
}

.spb-success-card .spb-btn-primary {
	background: linear-gradient(135deg, #22c55e, #16a34a);
	color: #fff !important;
	box-shadow: 0 8px 24px rgba(34, 197, 94, .3);
}

.spb-success-card .spb-btn-primary:hover {
	box-shadow: 0 12px 32px rgba(34, 197, 94, .4);
}

.spb-failed-card .spb-btn-primary {
	background: linear-gradient(135deg, #ef4444, #f97316);
	color: #fff !important;
	box-shadow: 0 8px 24px rgba(239, 68, 68, .3);
}

.spb-failed-card .spb-btn-primary:hover {
	box-shadow: 0 12px 32px rgba(239, 68, 68, .4);
}

.spb-btn-secondary {
	background: #fff;
	color: #374151 !important;
	border: 2px solid #e5e7eb;
}

.spb-btn-secondary:hover {
	border-color: #d1d5db;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
}

.spb-confetti {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	overflow: hidden;
	border-radius: 28px;
}

.spb-confetti span {
	position: absolute;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	opacity: .7;
	animation: spbFall 4s linear infinite;
}

.spb-confetti span:nth-child(1) { left: 10%; background: #22c55e; animation-delay: 0s; }
.spb-confetti span:nth-child(2) { left: 25%; background: #6366f1; animation-delay: .5s; animation-duration: 5s; }
.spb-confetti span:nth-child(3) { left: 40%; background: #f59e0b; animation-delay: 1s; }
.spb-confetti span:nth-child(4) { left: 55%; background: #ec4899; animation-delay: 1.5s; animation-duration: 4.5s; }
.spb-confetti span:nth-child(5) { left: 70%; background: #3b82f6; animation-delay: .2s; }
.spb-confetti span:nth-child(6) { left: 85%; background: #22c55e; animation-delay: .8s; animation-duration: 5.5s; }

@keyframes spbFall {
	0% { transform: translateY(-20px) rotate(0); opacity: 0; }
	10% { opacity: 1; }
	90% { opacity: 1; }
	100% { transform: translateY(340px) rotate(720deg); opacity: 0; }
}

.spb-success-footer,
.spb-failed-footer {
	font-size: 14px;
	color: #9ca3af;
}

.spb-success-footer a {
	color: #22c55e;
}

.spb-failed-footer a {
	color: #ef4444;
}

@media (max-width: 600px) {
	.spb-success-card,
	.spb-failed-card {
		padding: 40px 24px;
	}

	.spb-success-card h1,
	.spb-failed-card h1 {
		font-size: 26px;
	}

	.spb-success-card .spb-lead,
	.spb-failed-card .spb-lead {
		font-size: 16px;
	}

	.spb-success-icon,
	.spb-failed-icon {
		width: 80px;
		height: 80px;
	}

	.spb-success-icon svg,
	.spb-failed-icon svg {
		width: 40px;
		height: 40px;
	}

	.spb-btn {
		padding: 13px 24px;
		font-size: 15px;
	}
}
