/**
 * SSDC Button Motion — SSDC Button Motion 1.html
 * Applied via .ssdc-motion-pill (+ variant) from assets/js/button-motion.js
 */

:root {
	--ssdc-motion-ease: cubic-bezier(0.23, 1, 0.32, 1);
	--ssdc-motion-surface: #ffffff;
	--ssdc-motion-focus: #0646db;

	--ssdc-motion-brand: #01319d;
	--ssdc-motion-brand-hover: #03287c;
	--ssdc-motion-text-2: #1e293b;
	--ssdc-motion-text-2-hover: #0f172a;
	--ssdc-motion-text-3: #334155;
	--ssdc-motion-border: #cbd5e1;
	--ssdc-motion-bg-hover: #f8fafc;

	--ssdc-motion-error: #e20004;
	--ssdc-motion-error-hover: #ae0404;
	--ssdc-motion-error-ring: #fa0f0f;

	--ssdc-motion-glow-brand: #03287c60;
	--ssdc-motion-glow-neutral: #cbd5e160;
	--ssdc-motion-glow-error: #ae040460;

	--ssdc-motion-drop: 0 1px 2px rgba(0, 0, 0, 0.05);
	--ssdc-motion-edge-solid:
		var(--ssdc-motion-drop),
		inset 0 0 0 1px rgba(0, 0, 0, 0.18),
		inset 0 0 0 2px rgba(255, 255, 255, 0.12),
		inset 0 -2px 0 rgba(0, 0, 0, 0.05);
	--ssdc-motion-edge-secondary:
		inset 0 0 0 1px var(--ssdc-motion-border),
		var(--ssdc-motion-drop),
		inset 0 0 0 1px rgba(0, 0, 0, 0.18),
		inset 0 -2px 0 rgba(0, 0, 0, 0.05);
}

/* —— Base —— */
.ssdc-motion-pill:not(.ssdc-motion-pill--link) {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	-webkit-tap-highlight-color: transparent;
	transition: all 0.6s var(--ssdc-motion-ease);
}

.ssdc-motion-pill:not(.ssdc-motion-pill--link)::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 0;
	width: 20px;
	aspect-ratio: 1;
	border-radius: 50%;
	opacity: 0;
	transform: translate(-50%, -50%);
	pointer-events: none;
	transition: all 0.8s var(--ssdc-motion-ease);
	background: var(--ssdc-motion-ripple, transparent);
}

/* Label + icons above ripple (Figma .btn__content) */
.ssdc-motion-pill__content {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: inherit;
	max-width: 100%;
	color: inherit;
	background: transparent !important;
	pointer-events: none;
}

.ssdc-motion-pill__content a,
.ssdc-motion-pill__content button {
	pointer-events: auto;
}

.ssdc-motion-pill__content img,
.ssdc-motion-pill__content svg {
	flex-shrink: 0;
}

.ssdc-crs-btn.ssdc-motion-pill:not(:has(svg)):not(:has(img))::after {
	position: relative;
	z-index: 1;
}

/* —— Variants (tokens) —— */
.ssdc-motion-pill--destructive {
	--ssdc-motion-ripple: var(--ssdc-motion-error-hover);
	--ssdc-motion-glow: var(--ssdc-motion-glow-error);
	--ssdc-motion-ring: var(--ssdc-motion-error-ring);
	--ssdc-motion-fg-hover: #ffffff;
	--ssdc-motion-shadow: var(--ssdc-motion-edge-solid);
	--ssdc-motion-ripple-end: 150%;
}

.ssdc-motion-pill--destructive:not(.ssdc-motion-pill--link) {
	background-color: var(--ssdc-motion-error) !important;
	border-color: transparent !important;
	border-width: 0 !important;
	color: #ffffff !important;
}

.ssdc-motion-pill--brand {
	--ssdc-motion-ripple: var(--ssdc-motion-brand-hover);
	--ssdc-motion-glow: var(--ssdc-motion-glow-brand);
	--ssdc-motion-ring: var(--ssdc-motion-focus);
	--ssdc-motion-fg-hover: #ffffff;
	--ssdc-motion-shadow: var(--ssdc-motion-edge-solid);
	--ssdc-motion-ripple-end: 150%;
}

.ssdc-motion-pill--secondary {
	--ssdc-motion-ripple: var(--ssdc-motion-bg-hover);
	--ssdc-motion-glow: var(--ssdc-motion-glow-neutral);
	--ssdc-motion-ring: var(--ssdc-motion-focus);
	--ssdc-motion-fg-hover: var(--ssdc-motion-text-2-hover);
	--ssdc-motion-shadow: var(--ssdc-motion-edge-secondary);
	--ssdc-motion-ripple-end: 150%;
}

.ssdc-motion-pill--ghost {
	--ssdc-motion-ripple: var(--ssdc-motion-bg-hover);
	--ssdc-motion-glow: var(--ssdc-motion-glow-neutral);
	--ssdc-motion-ring: var(--ssdc-motion-focus);
	--ssdc-motion-fg-hover: #ffffff;
	--ssdc-motion-shadow: 0 0 #0000;
	--ssdc-motion-ripple-end: 150%;
}

.ssdc-motion-pill--teal {
	--ssdc-motion-ripple: #0d9488;
	--ssdc-motion-glow: #0d948860;
	--ssdc-motion-ring: var(--ssdc-motion-focus);
	--ssdc-motion-fg-hover: #ffffff;
	--ssdc-motion-shadow: var(--ssdc-motion-drop);
	--ssdc-motion-ripple-end: 150%;
}

.ssdc-motion-pill:not(.ssdc-motion-pill--link) {
	box-shadow: var(--ssdc-motion-shadow, 0 0 #0000);
}

/* —— Hover —— */
.ssdc-motion-pill:not(.ssdc-motion-pill--link):hover {
	transform: none !important;
}

.ssdc-motion-pill--secondary:hover,
.ssdc-motion-pill--ghost:hover,
.ssdc-motion-pill--brand:hover,
.ssdc-motion-pill--teal:hover,
.ssdc-motion-pill--destructive:hover {
	box-shadow: var(--ssdc-motion-shadow, 0 0 #0000), 0 0 0 5px var(--ssdc-motion-glow) !important;
}

/* Destructive primary hover: keep base fill #e20004; ripple = #ae0404 + glow #ae040460 (Figma d-primary) */
.ssdc-motion-pill--destructive:not(.ssdc-motion-pill--link):hover {
	background-color: var(--ssdc-motion-error) !important;
	border-color: transparent !important;
}

.ssdc-motion-pill--destructive:hover .ssdc-motion-pill__content,
.ssdc-motion-pill--brand:hover .ssdc-motion-pill__content,
.ssdc-motion-pill--teal:hover .ssdc-motion-pill__content {
	color: #ffffff !important;
}

.ssdc-motion-pill--secondary:hover .ssdc-motion-pill__content {
	color: var(--ssdc-motion-text-2-hover) !important;
}

.ssdc-motion-pill--ghost:hover .ssdc-motion-pill__content {
	color: #ffffff !important;
}

/* Secondary — Figma hover fill #f8fafc + neutral glow (#cbd5e160) */
.ssdc-motion-pill--secondary:hover {
	background-color: var(--ssdc-motion-bg-hover) !important;
}

.ssdc-motion-pill--ghost:hover {
	background-color: transparent !important;
}

.hv2-cta-inner .ssdc-motion-pill--secondary:hover .ssdc-motion-pill__content {
	color: #0f172a !important;
}

.hv2-cta-inner .ssdc-motion-pill--secondary:hover {
	background-color: var(--ssdc-motion-bg-hover) !important;
	border-color: #cbd5e1 !important;
}

.ssdc-cta-btn--white.ssdc-motion-pill--secondary:hover,
.ssdc-faq-btn--white.ssdc-motion-pill--secondary:hover {
	background-color: var(--ssdc-motion-bg-hover) !important;
	color: var(--ssdc-motion-text-2-hover) !important;
}

.hv2-cta-inner .ssdc-motion-pill--destructive:hover .ssdc-motion-pill__content {
	color: #ffffff !important;
}

.ssdc-motion-pill:not(.ssdc-motion-pill--link):hover::before {
	width: var(--ssdc-motion-ripple-end, 150%);
	opacity: 1;
}

/* —— Focus —— */
.ssdc-motion-pill:not(.ssdc-motion-pill--link):focus-visible {
	outline: none;
	box-shadow:
		var(--ssdc-motion-shadow, 0 0 #0000),
		0 0 0 2px var(--ssdc-motion-surface),
		0 0 0 4px var(--ssdc-motion-ring, var(--ssdc-motion-focus)) !important;
}

/* —— Active —— */
.ssdc-motion-pill:not(.ssdc-motion-pill--link):active {
	transform: scale(0.95) !important;
}

.ssdc-enrol:hover .ssdc-enrol-ico {
	transform: none;
}

/* —— Link variant —— */
.ssdc-motion-pill--link {
	position: relative;
	overflow: visible;
	--ssdc-motion-ring: var(--ssdc-motion-focus);
	--ssdc-motion-underline: var(--ssdc-motion-focus);
	transition: color 0.6s var(--ssdc-motion-ease);
}

.ssdc-motion-pill--link:hover {
	box-shadow: none !important;
	transform: none !important;
}

.ssdc-motion-pill--link > span {
	padding-inline: 0;
	background: linear-gradient(var(--ssdc-motion-underline), var(--ssdc-motion-underline)) 50% 100% / 0% 1.5px no-repeat;
	transition: background-size 0.6s var(--ssdc-motion-ease);
}

.ssdc-motion-pill--link:hover > span {
	background-size: 100% 1.5px;
}

.ssdc-motion-pill--link:focus-visible {
	outline: none;
	box-shadow:
		0 0 0 2px var(--ssdc-motion-surface),
		0 0 0 4px var(--ssdc-motion-ring) !important;
}

.eenrol-card__link.ssdc-motion-pill--link {
	--ssdc-motion-underline: var(--ssdc-motion-focus);
}

/* Beat page CSS that resets white-button hover (home, CTA banners, test-dates) */
body .hv2-btn--white.ssdc-motion-pill--secondary:hover,
body .hv2-btn--outline.ssdc-motion-pill--secondary:hover,
body .ssdc-cta-btn--white.ssdc-motion-pill--secondary:hover,
body .ssdc-faq-btn--white.ssdc-motion-pill--secondary:hover,
body .ssdc-legal-btn.ssdc-motion-pill--secondary:hover,
body .eenrol-login__btn.ssdc-motion-pill--secondary:hover,
body .st-btn-shuttle.ssdc-motion-pill--secondary:hover {
	background-color: var(--ssdc-motion-bg-hover) !important;
	box-shadow: var(--ssdc-motion-edge-secondary), 0 0 0 5px var(--ssdc-motion-glow-neutral) !important;
}

/* Beat page-level red CTA hovers (instant dark fill, lift, soft shadow) — motion uses ripple + ring */
body .ssdc-enrol.ssdc-motion-pill--destructive:hover,
body .ssdc-mdrawer__enrol.ssdc-motion-pill--destructive:hover,
body .ssdc-mdrawer__login.ssdc-motion-pill--destructive:hover,
body .hv2-btn--red.ssdc-motion-pill--destructive:hover,
body .hv-btn--red.ssdc-motion-pill--destructive:hover,
body .ssdc-cta-btn--red.ssdc-motion-pill--destructive:hover,
body .ssdc-faq-btn--red.ssdc-motion-pill--destructive:hover,
body .ssdc-crs-btn-red.ssdc-motion-pill--destructive:hover,
body .idch-btn--red.ssdc-motion-pill--destructive:hover,
body .comp-btn--red.ssdc-motion-pill--destructive:hover,
body .an-btn--primary-red.ssdc-motion-pill--destructive:hover,
body .eenrol-card__cta.ssdc-motion-pill--destructive:hover {
	background-color: var(--ssdc-motion-error) !important;
	border-color: transparent !important;
	transform: none !important;
	box-shadow: var(--ssdc-motion-edge-solid), 0 0 0 5px var(--ssdc-motion-glow-error) !important;
}

@media (prefers-reduced-motion: reduce) {
	.ssdc-motion-pill {
		transition: none;
	}

	.ssdc-motion-pill::before {
		transition: none;
	}

	.ssdc-motion-pill:hover::before {
		width: 20px;
		opacity: 0;
	}

	.ssdc-motion-pill:active {
		transform: none !important;
	}
}
