/**
 * XLC Linvio Checkout Embed — parent-side styles.
 *
 * Deliberately minimal. The point is that the embed reads as part of the page,
 * so this only handles the frame mechanics, the loading state and the fallback.
 * Anything that styles the checkout itself belongs in the Salesforce Site
 * Template, not here — we cannot reach across the origin boundary with CSS.
 */

.xlc-embed {
	position: relative;
	margin: 1.5rem 0;
	min-height: 120px;
}

/* Width is ours. Height matches the framed QuickEvent document until
   Salesforce sends a real height (iframe-resizer child is not on /pmtx).
   Measured 2026-09-22: ~1030px at desktop, ~1400px at 768, ~1970px at 390.
   Inline height from the resizer overrides these once the child connects. */
.xlc-embed__frame {
	display: block;
	width: 100%;
	height: 1080px;
	overflow: auto !important;
	border: 0;
	/* No transition on height: the resizer updates it frequently and animating
	   every update makes the page feel like it is chasing itself. */
	opacity: 0;
	transition: opacity 180ms ease;
}

.xlc-embed.is-ready .xlc-embed__frame,
.xlc-embed.is-loaded .xlc-embed__frame {
	opacity: 1;
}

.xlc-embed.is-blocked .xlc-embed__frame {
	display: none;
}

@media (max-width: 991px) {
	.xlc-embed__frame {
		height: 1560px;
	}
}

@media (max-width: 478px) {
	.xlc-embed__frame {
		height: 2080px;
	}
}

/* ---------- loading ---------- */

.xlc-embed__loading {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 2.5rem 0;
	color: #4d5b6d;
	font-size: 0.95rem;
}

.xlc-embed.is-ready .xlc-embed__loading,
.xlc-embed.is-loaded .xlc-embed__loading,
.xlc-embed.is-blocked .xlc-embed__loading {
	display: none;
}

.xlc-embed__spinner {
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: xlc-embed-spin 700ms linear infinite;
}

@keyframes xlc-embed-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.xlc-embed__spinner { animation-duration: 2s; }
	.xlc-embed__frame { transition: none; }
}

/* ---------- fallback ---------- */

.xlc-embed__fallback {
	border: 1px solid #dde2e9;
	border-left: 3px solid #0E2240;
	border-radius: 3px;
	padding: 1.25rem 1.5rem;
	background: #f6f8fa;
}

.xlc-embed__fallback-lead {
	margin: 0 0 0.75rem;
	font-weight: 600;
}

.xlc-embed__fallback p {
	margin: 0 0 0.75rem;
}

.xlc-embed__fallback p:last-child {
	margin-bottom: 0;
}

.xlc-embed__fallback-link {
	display: inline-block;
	background: #0E2240;
	color: #fff;
	padding: 0.7rem 1.4rem;
	border-radius: 2px;
	text-decoration: none;
	font-weight: 600;
}

.xlc-embed__fallback-link:hover,
.xlc-embed__fallback-link:focus {
	background: #1c3a66;
	color: #fff;
}

.xlc-embed__fallback-link:focus-visible {
	outline: 2px solid #3d6d9e;
	outline-offset: 3px;
}

/* Only editors see this. */
.xlc-embed__fallback-admin {
	font-size: 0.85rem;
	color: #4d5b6d;
	border-top: 1px solid #dde2e9;
	padding-top: 0.75rem;
	line-height: 1.5;
}

.xlc-embed-error {
	border: 1px solid #a63a2e;
	background: #f7e9e6;
	color: #7d2b21;
	padding: 1rem 1.25rem;
	border-radius: 3px;
}
