/* Rio notification primer: first-load full-screen takeover (see
   new/templ/component/notifications_modal.templ RioPrimerModal and
   notifications.js showRioPrimer/rioPrimerEnable). Deliberately dark and
   premium in BOTH themes - it's a one-off pitch, not page chrome.
   NOTE: class names must not contain "card" (theme.css paints [class*="card"]). */

/* display:flex below outweighs the UA's [hidden]{display:none}, so restate it */
#rioPrimer.rp-overlay[hidden] {
	display: none;
}
#rioPrimer.rp-overlay {
	position: fixed;
	inset: 0;
	z-index: 1095; /* above the offcanvas layer (1045/1100), below .rio-noti-swal (1200) */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
#rioPrimer .rp-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(4, 10, 24, 0.62);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	opacity: 0;
	transition: opacity .3s ease;
}
#rioPrimer.rp-open .rp-backdrop {
	opacity: 1;
}

#rioPrimer .rp-panel {
	position: relative;
	width: 100%;
	max-width: 440px;
	max-height: calc(100dvh - 40px);
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: none;
	border-radius: 30px;
	padding: 0 28px calc(24px + env(safe-area-inset-bottom));
	text-align: center;
	color: #eaf1ff;
	background:
		radial-gradient(520px 260px at 50% -60px, rgba(0, 150, 255, 0.28) 0%, rgba(0, 150, 255, 0) 70%),
		linear-gradient(168deg, #101b36 0%, #0a1226 58%, #070d1d 100%);
	border: 1px solid rgba(120, 170, 255, 0.16);
	box-shadow:
		0 40px 110px -20px rgba(0, 0, 0, 0.75),
		inset 0 1px 0 rgba(255, 255, 255, 0.07);
	opacity: 0;
	transform: translateY(26px) scale(.96);
	transition: opacity .32s ease, transform .38s cubic-bezier(.22, 1.2, .36, 1);
}
#rioPrimer .rp-panel::-webkit-scrollbar { display: none; }
#rioPrimer.rp-open .rp-panel {
	opacity: 1;
	transform: translateY(0) scale(1);
}
#rioPrimer.rp-closing .rp-backdrop { opacity: 0; }
#rioPrimer.rp-closing .rp-panel {
	opacity: 0;
	transform: translateY(20px) scale(.97);
}

/* Ambient glow + drifting sparkles behind the content */
#rioPrimer .rp-glow {
	position: absolute;
	top: -90px;
	left: 50%;
	width: 340px;
	height: 340px;
	transform: translateX(-50%);
	border-radius: 50%;
	background: radial-gradient(circle, rgba(0, 162, 255, 0.35) 0%, rgba(0, 162, 255, 0) 65%);
	pointer-events: none;
	animation: rpGlowPulse 4.5s ease-in-out infinite;
}
@keyframes rpGlowPulse {
	0%, 100% { opacity: .75; transform: translateX(-50%) scale(1); }
	50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}
#rioPrimer .rp-stars {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image:
		radial-gradient(2px 2px at 12% 18%, rgba(160, 210, 255, .8) 50%, transparent 51%),
		radial-gradient(1.5px 1.5px at 85% 12%, rgba(160, 210, 255, .65) 50%, transparent 51%),
		radial-gradient(1.5px 1.5px at 72% 30%, rgba(160, 210, 255, .5) 50%, transparent 51%),
		radial-gradient(2px 2px at 22% 38%, rgba(160, 210, 255, .45) 50%, transparent 51%),
		radial-gradient(1.5px 1.5px at 90% 44%, rgba(160, 210, 255, .4) 50%, transparent 51%);
	animation: rpStarTwinkle 3.2s ease-in-out infinite;
}
@keyframes rpStarTwinkle {
	0%, 100% { opacity: .9; }
	50% { opacity: .35; }
}

/* Hero: Rio inside a glowing ring */
#rioPrimer .rp-hero {
	position: relative;
	height: 168px;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	margin-bottom: 2px;
}
#rioPrimer .rp-hero-ring {
	position: absolute;
	bottom: -40px;
	left: 50%;
	transform: translateX(-50%);
	width: 190px;
	height: 190px;
	border-radius: 50%;
	background: linear-gradient(180deg, rgba(0, 162, 255, 0.22) 0%, rgba(0, 86, 214, 0.05) 100%);
	box-shadow: inset 0 0 0 1px rgba(0, 170, 255, 0.28), 0 0 50px -8px rgba(0, 150, 255, 0.45);
}
#rioPrimer #rpParrot {
	position: relative;
	height: 215px;
	width: 100%;
	max-width: 380px;
	margin-bottom: -26px;
	filter: hue-rotate(-15deg) drop-shadow(0 18px 24px rgba(0, 0, 0, 0.45));
	pointer-events: none;
}

#rioPrimer .rp-eyebrow {
	display: inline-block;
	font-size: .72rem;
	font-weight: 800;
	letter-spacing: 2.4px;
	text-transform: uppercase;
	color: #6fc0ff;
	background: rgba(0, 140, 255, 0.12);
	border: 1px solid rgba(0, 162, 255, 0.3);
	border-radius: 999px;
	padding: 5px 14px;
	margin-bottom: 12px;
}
#rioPrimer .rp-title {
	font-weight: 800;
	font-size: 1.85rem;
	letter-spacing: -.5px;
	line-height: 1.15;
	margin-bottom: .5rem;
	color: #fff;
	background: linear-gradient(135deg, #ffffff 30%, #9ecfff 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}
#rioPrimer .rp-sub {
	color: #a7b6d4;
	font-size: .94rem;
	line-height: 1.5;
	margin: 0 auto 18px;
	max-width: 340px;
}
#rioPrimer .rp-sub b {
	color: #ffd666;
	font-weight: 700;
}

/* Perk rows */
#rioPrimer .rp-perks {
	display: flex;
	flex-direction: column;
	gap: 9px;
	margin-bottom: 18px;
}
#rioPrimer .rp-perk {
	display: flex;
	align-items: center;
	gap: 13px;
	text-align: left;
	background: rgba(255, 255, 255, 0.045);
	border: 1px solid rgba(130, 175, 255, 0.12);
	border-radius: 18px;
	padding: 10px 14px;
	opacity: 0;
	transform: translateY(12px);
}
#rioPrimer.rp-open .rp-perk {
	animation: rpRowIn .45s cubic-bezier(.22, 1.1, .36, 1) both;
}
#rioPrimer.rp-open .rp-perk:nth-child(1) { animation-delay: .18s; }
#rioPrimer.rp-open .rp-perk:nth-child(2) { animation-delay: .28s; }
#rioPrimer.rp-open .rp-perk:nth-child(3) { animation-delay: .38s; }
@keyframes rpRowIn {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: translateY(0); }
}
#rioPrimer .rp-perk-icon {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 13px;
	background: linear-gradient(135deg, rgba(0, 140, 255, 0.2) 0%, rgba(0, 86, 214, 0.26) 100%);
	box-shadow: inset 0 0 0 1px rgba(0, 170, 255, 0.22);
}
#rioPrimer .rp-perk-icon img {
	max-height: 28px;
	max-width: 28px;
}
#rioPrimer .rp-perk-title {
	display: block;
	font-weight: 700;
	font-size: .9rem;
	color: #f0f5ff;
	line-height: 1.25;
}
#rioPrimer .rp-perk-desc {
	display: block;
	font-size: .78rem;
	color: #94a5c6;
	line-height: 1.35;
}

/* Inline error (permission blocked / push stack unavailable) */
#rioPrimer .rp-error {
	background: rgba(255, 92, 116, 0.1);
	border: 1px solid rgba(255, 92, 116, 0.3);
	border-radius: 14px;
	color: #ffb3c0;
	font-size: .82rem;
	line-height: 1.45;
	padding: 10px 14px;
	margin-bottom: 12px;
	text-align: left;
	animation: rpRowIn .3s ease both;
}

/* CTA */
#rioPrimer .rp-cta {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	border: none;
	border-radius: 18px;
	padding: 15px 20px;
	font-size: 1.02rem;
	font-weight: 800;
	letter-spacing: .2px;
	color: #fff;
	background: linear-gradient(135deg, #00a2ff 0%, #0056d6 100%);
	box-shadow: 0 14px 34px -10px rgba(0, 140, 255, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.25);
	cursor: pointer;
	overflow: hidden;
	transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
#rioPrimer .rp-cta::after {
	content: "";
	position: absolute;
	top: 0;
	left: -80%;
	width: 55%;
	height: 100%;
	background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.28) 50%, transparent 100%);
	transform: skewX(-18deg);
	animation: rpCtaSheen 3.4s ease-in-out infinite;
}
@keyframes rpCtaSheen {
	0%, 55% { left: -80%; }
	85%, 100% { left: 130%; }
}
#rioPrimer .rp-cta:hover {
	transform: translateY(-2px);
	box-shadow: 0 20px 44px -10px rgba(0, 140, 255, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
#rioPrimer .rp-cta:active {
	transform: translateY(0) scale(.985);
}
#rioPrimer .rp-cta img {
	height: 26px;
	width: auto;
	transform-origin: 50% 10%;
}
#rioPrimer .rp-cta:hover img {
	animation: rpBellSwing .9s ease;
}
@keyframes rpBellSwing {
	0%, 100% { transform: rotate(0deg); }
	20% { transform: rotate(14deg); }
	40% { transform: rotate(-10deg); }
	60% { transform: rotate(6deg); }
	80% { transform: rotate(-4deg); }
}
@keyframes rpCtaShake {
	0%, 100% { transform: translateX(0); }
	20% { transform: translateX(-7px); }
	40% { transform: translateX(6px); }
	60% { transform: translateX(-4px); }
	80% { transform: translateX(3px); }
}
#rioPrimer .rp-cta.rp-shake {
	animation: rpCtaShake .45s ease;
}

/* Pending spinner while the permission prompt / push SDK settles */
#rioPrimer .rp-cta-spinner {
	display: none;
	width: 20px;
	height: 20px;
	border: 3px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: rpSpin .7s linear infinite;
}
@keyframes rpSpin {
	to { transform: rotate(360deg); }
}
#rioPrimer .rp-cta.is-pending {
	pointer-events: none;
	filter: saturate(.75) brightness(.9);
}
#rioPrimer .rp-cta.is-pending .rp-cta-spinner { display: inline-block; }
#rioPrimer .rp-cta.is-pending img { display: none; }

#rioPrimer .rp-cta-note {
	color: #7e8fb0;
	font-size: .76rem;
	margin: 10px 0 4px;
}

/* De-emphasised decline; after the first tap it becomes loss-framed */
#rioPrimer .rp-later {
	background: none;
	border: none;
	color: #65789e;
	font-size: .83rem;
	font-weight: 600;
	padding: 9px 14px;
	cursor: pointer;
	border-radius: 10px;
	transition: color .15s ease;
}
#rioPrimer .rp-later:hover {
	color: #93a6cc;
	text-decoration: underline;
}

/* Success state */
#rioPrimer .rp-success {
	padding: 10px 0 24px;
	animation: rpRowIn .35s ease both;
}
#rioPrimer .rp-success-badge {
	width: 76px;
	height: 76px;
	margin: 6px auto 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	font-size: 32px;
	color: #fff;
	background: linear-gradient(135deg, #2ecc71 0%, #19a85b 100%);
	box-shadow: 0 16px 40px -10px rgba(46, 204, 113, 0.6);
	animation: rpPop .45s cubic-bezier(.22, 1.4, .36, 1) both;
}
@keyframes rpPop {
	from { transform: scale(.4); opacity: 0; }
	to { transform: scale(1); opacity: 1; }
}

/* Lock page scroll while the primer is up */
body.rp-lock {
	overflow: hidden;
}

/* Phones: pin to the bottom like a sheet, full width */
@media (max-width: 575.98px) {
	#rioPrimer.rp-overlay {
		align-items: flex-end;
		padding: 0;
	}
	#rioPrimer .rp-panel {
		max-width: none;
		max-height: calc(100dvh - 24px);
		border-radius: 30px 30px 0 0;
		border-bottom: none;
		padding-left: 22px;
		padding-right: 22px;
	}
	#rioPrimer .rp-hero { height: 150px; }
	#rioPrimer #rpParrot { height: 195px; margin-bottom: -24px; }
	#rioPrimer .rp-title { font-size: 1.6rem; }
	#rioPrimer .rp-sub { font-size: .88rem; margin-bottom: 14px; }
	#rioPrimer .rp-perk { padding: 9px 12px; border-radius: 16px; }
}

/* Short viewports: compact the hero so the CTA stays above the fold */
@media (max-height: 720px) {
	#rioPrimer .rp-hero { height: 118px; }
	#rioPrimer #rpParrot { height: 160px; margin-bottom: -20px; }
	#rioPrimer .rp-hero-ring { width: 150px; height: 150px; bottom: -34px; }
	#rioPrimer .rp-perk-desc { display: none; }
	#rioPrimer .rp-perks { gap: 7px; margin-bottom: 14px; }
}
