/**
 * UniteElements 10% Voucher & OTP Lead Capture Widget Stylesheet
 *
 * Implements high-converting AppSumo-style layout, Cyber Bot Mascot,
 * glassmorphic blur overlay, auto-advancing OTP digit boxes, and mobile optimization.
 *
 * @package UniteElements_Core
 * @author Jyotirmay Ray <https://jyotirmayray.in/>
 */

/* ==========================================================================
   1. Floating Right-Side 3D Circle Orb Launcher
   ========================================================================== */

/* 3D keyframes */
@keyframes ueOrbFloat {
	0%, 100% { transform: translateY(-50%) translateY(0px) rotate3d(1, 0, 0, 0deg); }
	25%       { transform: translateY(-50%) translateY(-6px) rotate3d(1, 0, 0, 4deg); }
	75%       { transform: translateY(-50%) translateY(4px) rotate3d(1, 0, 0, -3deg); }
}

@keyframes ueOrbWobble {
	0%   { transform: translateY(-50%) scale(1) rotate(0deg); }
	15%  { transform: translateY(-50%) scale(1.12) rotate(-6deg); }
	30%  { transform: translateY(-50%) scale(1.08) rotate(6deg); }
	45%  { transform: translateY(-50%) scale(1.04) rotate(-4deg); }
	60%  { transform: translateY(-50%) scale(1.02) rotate(3deg); }
	100% { transform: translateY(-50%) scale(1) rotate(0deg); }
}

@keyframes ueOrbPulseRing {
	0%   { box-shadow: 0 0 0 0 rgba(245,158,11,0.65), 0 0 0 0 rgba(245,158,11,0.3); }
	60%  { box-shadow: 0 0 0 10px rgba(245,158,11,0), 0 0 0 20px rgba(245,158,11,0); }
	100% { box-shadow: 0 0 0 0 rgba(245,158,11,0), 0 0 0 0 rgba(245,158,11,0); }
}

@keyframes ueVoucherPulse {
	0%   { box-shadow: 0 0 0 0 rgba(220,38,38,0.7); }
	70%  { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
	100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}

.ue-voucher-side-tab {
	/* Positioning */
	position: fixed;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 99998;

	/* Circle shape - smaller medium size */
	width: 44px;
	height: 44px;
	border-radius: 50%;
	padding: 0;
	margin: 0;
	border: none;
	cursor: pointer;
	outline: none;
	user-select: none;

	/* 3D sphere gradient — amber gold */
	background:
		radial-gradient(circle at 38% 32%, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 48%),
		radial-gradient(circle at 60% 68%, rgba(100,40,0,0.3) 0%, rgba(100,40,0,0) 52%),
		linear-gradient(145deg, #FBBF24 0%, #F59E0B 40%, #D97706 72%, #B45309 100%);

	/* Depth shadows */
	box-shadow:
		0 3px 5px rgba(180, 83, 9, 0.28),
		0 6px 16px rgba(245, 158, 11, 0.4),
		inset 0 1.5px 3px rgba(255, 255, 255, 0.5),
		inset 0 -2px 5px rgba(120, 53, 15, 0.35);

	/* Icon centering */
	display: inline-flex;
	align-items: center;
	justify-content: center;

	/* Floating 3D animation */
	animation: ueOrbFloat 4s ease-in-out infinite;

	/* Font */
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

	/* Transition for hover */
	transition: box-shadow 0.2s ease, filter 0.2s ease;
}

/* Gloss highlight cap on top of sphere */
.ue-voucher-side-tab::before {
	content: '';
	position: absolute;
	top: 5px;
	left: 10px;
	width: 24px;
	height: 12px;
	border-radius: 50%;
	background: radial-gradient(ellipse at 50% 20%, rgba(255,255,255,0.72) 0%, rgba(255,255,255,0) 100%);
	pointer-events: none;
}

/* Bottom specular rim */
.ue-voucher-side-tab::after {
	content: '';
	position: absolute;
	bottom: 4px;
	left: 13px;
	width: 18px;
	height: 6px;
	border-radius: 50%;
	background: rgba(255,255,255,0.15);
	pointer-events: none;
}

.ue-voucher-side-tab:hover {
	animation: ueOrbWobble 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards, ueOrbPulseRing 1.2s ease-out;
	filter: brightness(1.1) saturate(1.2);
	box-shadow:
		0 4px 8px rgba(180, 83, 9, 0.35),
		0 8px 22px rgba(245, 158, 11, 0.55),
		inset 0 2px 4px rgba(255, 255, 255, 0.6),
		inset 0 -2.5px 5px rgba(120, 53, 15, 0.4);
}

/* Tooltip label "10% OFF" — slides in from right on hover */
.ue-voucher-side-tab .ue-voucher-tab-tooltip {
	position: absolute;
	right: calc(100% + 10px);
	top: 50%;
	transform: translateY(-50%) translateX(6px);
	background: #0F172A;
	color: #FCD34D;
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: 0.06em;
	white-space: nowrap;
	padding: 4px 9px;
	border-radius: 7px;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s ease, transform 0.2s ease;
	box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.ue-voucher-side-tab .ue-voucher-tab-tooltip::after {
	content: '';
	position: absolute;
	top: 50%;
	right: -4px;
	transform: translateY(-50%);
	border-width: 4px 0 4px 4px;
	border-style: solid;
	border-color: transparent transparent transparent #0F172A;
}
.ue-voucher-side-tab:hover .ue-voucher-tab-tooltip {
	opacity: 1;
	transform: translateY(-50%) translateX(0);
}

/* Icon size */
.ue-voucher-tab-icon {
	font-size: 18px;
	line-height: 1;
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	filter: drop-shadow(0 1.5px 2px rgba(0,0,0,0.25));
}
.ue-voucher-tab-icon svg {
	width: 18px;
	height: 18px;
	stroke: #FFFFFF;
}

/* Hide pill text — circle is icon-only */
.ue-voucher-tab-text {
	display: none;
}

/* Red pulse dot repositioned to top-right of circle */
.ue-voucher-tab-pulse {
	position: absolute;
	top: 1px;
	right: 1px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #DC2626;
	border: 1.5px solid #FFFFFF;
	box-shadow: 0 0 0 0 rgba(220,38,38,0.7);
	animation: ueVoucherPulse 2s infinite;
	z-index: 2;
}

/* Glow halo behind circle */
.ue-voucher-tab-glow {
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(245,158,11,0.25) 30%, transparent 70%);
	animation: ueOrbPulseRing 3s ease-out infinite;
	pointer-events: none;
}



/* ==========================================================================
   2. Glassmorphic Modal Backdrop Overlay
   ========================================================================== */
.ue-voucher-modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	background: rgba(15, 23, 42, 0.65);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.ue-voucher-modal-backdrop.is-open {
	opacity: 1;
	visibility: visible;
}

/* ==========================================================================
   3. Voucher Card Container & Mascot Peeking
   ========================================================================== */
.ue-voucher-card-wrap {
	width: 100%;
	max-width: 480px;
	position: relative;
	perspective: 1000px;
}

.ue-voucher-card {
	background: #FFFFFF;
	border-radius: 24px;
	border: 1px solid rgba(226, 232, 240, 0.95);
	box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.8);
	padding: 44px 34px 32px;
	position: relative;
	text-align: center;
	transform: scale(0.92) translateY(14px);
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
	box-sizing: border-box;
}

.ue-voucher-modal-backdrop.is-open .ue-voucher-card {
	transform: scale(1) translateY(0);
}

/* Close Button */
.ue-voucher-close-btn {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #F1F5F9;
	border: 1px solid #E2E8F0;
	color: #64748B;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	outline: none;
	padding: 0;
}

.ue-voucher-close-btn:hover {
	background: #E2E8F0;
	color: #0F172A;
	transform: rotate(90deg);
}

/* Option B: Cyber Bot Mascot Peeking Over Card */
.ue-voucher-mascot-wrap {
	position: absolute;
	top: -38px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
}

.ue-voucher-mascot {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: #0F172A;
	border: 3px solid #FFFFFF;
	box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
	display: flex;
	align-items: center;
	justify-content: center;
	animation: ueVoucherFloat 3s ease-in-out infinite alternate;
}

@keyframes ueVoucherFloat {
	0% {
		transform: translateY(0);
	}
	100% {
		transform: translateY(-4px);
	}
}

/* ==========================================================================
   4. Step Content & Typography
   ========================================================================== */
.ue-voucher-step {
	display: none;
}

.ue-voucher-step.is-active {
	display: block;
	animation: ueVoucherFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.ue-voucher-heading {
	font-size: 23px;
	font-weight: 800;
	color: #0F172A;
	line-height: 1.3;
	margin: 12px 0 8px;
	letter-spacing: -0.02em;
}

.ue-voucher-subheading {
	font-size: 14.5px;
	line-height: 1.55;
	color: #64748B;
	margin: 0 0 24px;
	font-weight: 500;
}

/* ==========================================================================
   5. Form Inputs & Buttons
   ========================================================================== */
.ue-voucher-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ue-voucher-input-group {
	position: relative;
	width: 100%;
}

.ue-voucher-input {
	width: 100%;
	height: 50px;
	border: 1.5px solid #CBD5E1;
	border-radius: 12px;
	padding: 0 16px;
	font-size: 15px;
	color: #0F172A;
	background: #FFFFFF;
	transition: all 0.2s ease;
	box-sizing: border-box;
	font-family: inherit;
}

.ue-voucher-input:focus {
	border-color: #2563EB;
	outline: none;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Gold CTA Button (Matching Screenshot) */
.ue-voucher-btn-gold {
	width: 100%;
	height: 50px;
	background: #F59E0B;
	border: none;
	border-radius: 12px;
	font-size: 15px;
	font-weight: 800;
	color: #000000;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-decoration: none !important;
	transition: all 0.2s ease;
	box-shadow: 0 4px 14px rgba(245, 158, 11, 0.32);
	box-sizing: border-box;
	user-select: none;
}

.ue-voucher-btn-gold:hover {
	background: #E08E0B;
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(245, 158, 11, 0.42);
}

.ue-voucher-btn-gold:active {
	transform: translateY(1px);
}

.ue-voucher-btn-gold:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

/* Spinner */
.ue-voucher-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2.5px solid rgba(0, 0, 0, 0.2);
	border-top-color: #000000;
	border-radius: 50%;
	animation: ueSpinner 0.7s infinite linear;
}

@keyframes ueSpinner {
	to {
		transform: rotate(360deg);
	}
}

/* Error Messages */
.ue-voucher-error-msg {
	font-size: 12.5px;
	font-weight: 600;
	color: #DC2626;
	background: #FEE2E2;
	border: 1px solid #FECACA;
	border-radius: 8px;
	padding: 8px 12px;
	text-align: left;
	line-height: 1.4;
}

/* ==========================================================================
   6. Step 2: OTP 6-Digit Inputs & Spam Notice
   ========================================================================== */
.ue-voucher-otp-inputs {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin-bottom: 6px;
}

.ue-otp-digit {
	width: 48px;
	height: 56px;
	font-size: 26px;
	font-weight: 900;
	text-align: center;
	border: 2px solid #CBD5E1;
	border-radius: 12px;
	color: #1D4ED8;
	font-family: "Space Grotesk", monospace;
	background: #F8FAFC;
	transition: all 0.18s ease;
	box-sizing: border-box;
	outline: none;
	caret-color: #2563EB;
}

.ue-otp-digit:focus {
	border-color: #2563EB;
	background: #FFFFFF;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
	transform: scale(1.04);
}

/* Spam Alert Box */
.ue-voucher-spam-notice {
	background-color: #FEF3C7;
	border: 1px solid #FDE68A;
	border-radius: 10px;
	padding: 10px 14px;
	display: flex;
	align-items: flex-start;
	gap: 8px;
	text-align: left;
	font-size: 12px;
	line-height: 1.45;
	color: #92400E;
}

.ue-voucher-spam-notice .ue-spam-icon {
	font-size: 14px;
	flex-shrink: 0;
	line-height: 1.2;
}

/* Resend Row */
.ue-voucher-resend-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 14px;
	font-size: 12.5px;
	color: #64748B;
}

.ue-voucher-resend-btn,
.ue-voucher-link-btn {
	background: none;
	border: none;
	padding: 0;
	font-size: 12.5px;
	color: #2563EB;
	font-weight: 600;
	cursor: pointer;
	text-decoration: underline;
	transition: color 0.18s ease;
}

.ue-voucher-resend-btn:disabled {
	color: #94A3B8;
	text-decoration: none;
	cursor: not-allowed;
}

.ue-voucher-resend-btn:hover:not(:disabled),
.ue-voucher-link-btn:hover {
	color: #1D4ED8;
}

/* ==========================================================================
   7. Step 3: Success & Coupon Card
   ========================================================================== */
.ue-voucher-success-badge {
	font-size: 40px;
	margin-bottom: 8px;
	animation: ueVoucherPop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ueVoucherPop {
	0% {
		transform: scale(0.5);
		opacity: 0;
	}
	70% {
		transform: scale(1.15);
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

.ue-voucher-code-card {
	background: #F8FAFC;
	border: 2px dashed #3B82F6;
	border-radius: 14px;
	padding: 18px 20px;
	text-align: center;
	margin-bottom: 20px;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.ue-voucher-card-tag {
	display: inline-block;
	font-size: 11px;
	font-weight: 800;
	color: #2563EB;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	background: #EFF6FF;
	padding: 2px 10px;
	border-radius: 999px;
	margin-bottom: 8px;
}

.ue-voucher-code-val {
	font-size: 32px;
	font-weight: 900;
	letter-spacing: 3px;
	color: #D97706;
	font-family: "Space Grotesk", monospace;
	margin-bottom: 12px;
}

.ue-voucher-copy-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 18px;
	background: #2563EB;
	color: #FFFFFF;
	font-weight: 700;
	font-size: 13px;
	border-radius: 8px;
	border: none;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.ue-voucher-copy-btn:hover {
	background: #1D4ED8;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.ue-voucher-copy-btn.copied {
	background: #10B981;
}

.ue-voucher-shop-btn {
	margin-bottom: 16px;
}

.ue-voucher-emailed-note {
	font-size: 12px;
	color: #64748B;
	line-height: 1.5;
	margin: 0;
}

/* Micro Trust Line */
.ue-voucher-micro-trust {
	font-size: 11.5px;
	color: #94A3B8;
	margin-top: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

/* ==========================================================================
   8. Mobile Responsive Breakpoint (<768px)
   ========================================================================== */
@media (max-width: 767px) {
	/* Pinned floating circle orb — mobile bottom right */
	.ue-voucher-side-tab {
		top: auto;
		bottom: 85px;
		right: 12px;
		transform: none;
		width: 40px;
		height: 40px;
		border-radius: 50%;
		padding: 0;
		animation: none; /* pause float on mobile to save battery */
	}

	.ue-voucher-side-tab .ue-voucher-tab-icon {
		font-size: 16px;
	}

	.ue-voucher-side-tab:hover {
		animation: ueOrbWobble 0.5s ease forwards;
	}

	/* Hide tooltip on touch — not needed on mobile */
	.ue-voucher-side-tab .ue-voucher-tab-tooltip {
		display: none;
	}


	.ue-voucher-card {
		padding: 38px 22px 26px;
		border-radius: 20px;
	}

	.ue-voucher-heading {
		font-size: 20px;
	}

	.ue-voucher-subheading {
		font-size: 13.5px;
		margin-bottom: 20px;
	}

	.ue-otp-digit {
		width: 40px;
		height: 48px;
		font-size: 22px;
		border-radius: 8px;
	}

	.ue-voucher-otp-inputs {
		gap: 6px;
	}
}
