/* ==========================================================================
   Anan Early Years – Floating Banner
   Colours, type and buttons mirror the Anan Early Years site theme.
   Everything is scoped under .aefb so theme styles don't leak in (or out).
   ========================================================================== */

.aefb {
	--aefb-purple: #9373a8;
	--aefb-purple-deep: #6b3fa0;
	--aefb-purple-ink: #4a1f78;
	--aefb-pink: #f08ab0;
	--aefb-pink-deep: #c9477c;
	--aefb-orange: #f5a35f;
	--aefb-yellow: #f5c85a;
	--aefb-teal: #7bb8ae;
	--aefb-purple-soft: #f1eaf7;
	--aefb-pink-soft: #fde9f1;
	--aefb-ink: #2f2a3a;
	--aefb-muted: #6b6578;
	--aefb-line: #ece4f2;
	--aefb-cream: #fffbf6;
	--aefb-rainbow: linear-gradient(90deg, #9373a8 0%, #f08ab0 30%, #f5a35f 55%, #f5c85a 75%, #7bb8ae 100%);
	--aefb-font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
	--aefb-script: "Pacifico", cursive;
	--aefb-ease: cubic-bezier(.22, 1, .36, 1);

	position: fixed;
	left: 24px;
	bottom: var(--aefb-bottom, 24px);
	z-index: 99990;
	width: 360px;
	max-width: calc(100vw - 32px);
	padding-top: 64px; /* room for the floating image above the card */
	font-family: var(--aefb-font);
	color: var(--aefb-ink);
	text-align: left;
	opacity: 0;
	transform: translate(-24px, 48px) scale(.92);
	transform-origin: bottom left;
	pointer-events: none;
	transition: opacity .45s var(--aefb-ease), transform .7s cubic-bezier(.2, .9, .3, 1.2);
}

.aefb[hidden] {
	display: none !important;
}

.aefb.is-visible {
	opacity: 1;
	transform: none;
}

.aefb.is-visible .aefb-card {
	pointer-events: auto;
}

.aefb.is-leaving {
	opacity: 0;
	transform: translate(-16px, 32px) scale(.95);
	transition-duration: .4s;
	transition-timing-function: var(--aefb-ease);
}

.aefb *,
.aefb *::before,
.aefb *::after {
	box-sizing: border-box;
}

/* Gentle bobbing – the "floating" feel */
.aefb-float {
	animation: aefbFloat 5s ease-in-out infinite;
}

/* ---------- Card ---------- */
.aefb .aefb-card {
	position: relative;
	isolation: isolate;
	padding: 24px 22px 22px;
	border-radius: 28px;
	background: linear-gradient(165deg, var(--aefb-cream) 0%, #fff 45%, var(--aefb-purple-soft) 100%);
	box-shadow: 0 30px 60px -24px rgba(74, 31, 120, .45), 0 0 0 1px var(--aefb-line);
}

/* Rainbow ribbon hanging from the top edge */
.aefb .aefb-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 28px;
	right: 28px;
	z-index: 1;
	height: 5px;
	border-radius: 0 0 6px 6px;
	background: var(--aefb-rainbow);
}

.aefb .aefb-bg {
	position: absolute;
	inset: 0;
	z-index: -1; /* behind the content, but inside the card (see isolation below) */
	overflow: hidden;
	border-radius: inherit;
	pointer-events: none;
}

.aefb .aefb-blob {
	position: absolute;
	border-radius: 50%;
	filter: blur(28px);
	opacity: .55;
}

.aefb .aefb-blob--pink {
	right: -50px;
	bottom: -40px;
	width: 170px;
	height: 170px;
	background: var(--aefb-pink-soft);
}

.aefb .aefb-blob--yellow {
	top: 40px;
	left: -60px;
	width: 140px;
	height: 140px;
	background: #fef6df;
}

/* ---------- Floating girl + sparkle ---------- */
.aefb .aefb-girl {
	position: absolute;
	top: -62px;
	right: 54px;
	z-index: 2;
	width: 150px;
	max-width: none;
	height: auto;
	margin: 0;
	pointer-events: none;
	filter: drop-shadow(0 14px 14px rgba(74, 31, 120, .22));
	animation: aefbFly 4s ease-in-out infinite;
}

.aefb .aefb-star {
	position: absolute;
	top: -78px;
	right: 34px;
	z-index: 2;
	width: 30px;
	max-width: none;
	height: auto;
	margin: 0;
	pointer-events: none;
	animation: aefbTwinkle 2.4s ease-in-out infinite;
}

/* ---------- Close ---------- */
.aefb .aefb-close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	color: var(--aefb-purple-ink);
	background: #fff;
	box-shadow: 0 6px 16px -8px rgba(74, 31, 120, .45), 0 0 0 1px var(--aefb-line);
	line-height: 1;
	cursor: pointer;
	transition: transform .3s var(--aefb-ease), color .2s, box-shadow .2s;
}

.aefb .aefb-close:hover {
	color: var(--aefb-pink-deep);
	background: #fff;
	transform: rotate(90deg);
}

.aefb .aefb-close:focus-visible,
.aefb .aefb-btn:focus-visible {
	outline: 3px solid var(--aefb-pink);
	outline-offset: 3px;
}

.aefb .aefb-close svg {
	display: block;
}

/* ---------- Content ---------- */
.aefb .aefb-logo {
	display: block;
	width: auto;
	max-width: 130px;
	height: 48px;
	margin: 0 0 14px;
	object-fit: contain;
}

.aefb .aefb-title {
	margin: 0 0 10px;
	padding: 0;
	font-family: var(--aefb-font);
	font-size: 19px;
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: -.01em;
	text-transform: none;
	color: var(--aefb-ink);
}

.aefb .aefb-script {
	display: block;
	width: fit-content;
	margin-top: 2px;
	padding-right: 4px; /* stops the last Pacifico swash being clipped by background-clip */
	font-family: var(--aefb-script);
	font-size: 23px;
	font-weight: 400;
	line-height: 1.45;
	letter-spacing: 0;
	background: linear-gradient(90deg, var(--aefb-purple-deep) 0%, #b55ca8 45%, var(--aefb-pink) 72%, var(--aefb-orange) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.aefb .aefb-text {
	margin: 0 0 16px;
	padding: 0;
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--aefb-muted);
}

.aefb .aefb-stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 16px;
}

.aefb .aefb-stat {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 10px 12px;
	border-radius: 16px;
	background: var(--aefb-purple-soft);
}

.aefb .aefb-stat:nth-child(2) {
	background: var(--aefb-pink-soft);
}

.aefb .aefb-stat strong {
	flex-shrink: 0;
	font-size: 24px;
	font-weight: 800;
	line-height: 1;
	color: var(--aefb-purple-deep);
}

.aefb .aefb-stat:nth-child(2) strong {
	color: var(--aefb-pink-deep);
}

.aefb .aefb-stat span {
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--aefb-ink);
}

/* ---------- Button (matches .btn-anan) ---------- */
.aefb .aefb-btn {
	position: relative;
	z-index: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 13px 24px;
	border: 0;
	border-radius: 60px;
	overflow: hidden;
	font-family: var(--aefb-font);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	text-transform: none;
	color: #fff;
	background: var(--aefb-purple-deep);
	box-shadow: 0 10px 24px -10px rgba(107, 63, 160, .7);
	transition: box-shadow .4s var(--aefb-ease);
}

.aefb .aefb-btn::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--aefb-rainbow);
	transform: translateX(-101%);
	transition: transform .6s var(--aefb-ease);
}

.aefb .aefb-btn:hover,
.aefb .aefb-btn:focus {
	color: #fff;
	text-decoration: none;
	box-shadow: 0 16px 30px -12px rgba(240, 138, 176, .8);
}

.aefb .aefb-btn:hover::before {
	transform: translateX(0);
}

.aefb .aefb-btn svg {
	transition: transform .4s var(--aefb-ease);
}

.aefb .aefb-btn:hover svg {
	transform: translateX(4px);
}

/* ---------- Animations ---------- */
@keyframes aefbFloat {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-8px); }
}

@keyframes aefbFly {
	0%, 100% { transform: translate(0, 0) rotate(-2deg); }
	50% { transform: translate(5px, -7px) rotate(1.5deg); }
}

@keyframes aefbTwinkle {
	0%, 100% { opacity: .8; transform: scale(.8) rotate(0deg); }
	50% { opacity: 1; transform: scale(1.15) rotate(25deg); }
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
	.aefb.aefb--hide-mobile {
		display: none !important;
	}
}

@media (max-width: 480px) {
	.aefb {
		left: 16px;
		bottom: min(var(--aefb-bottom, 24px), 16px);
		width: calc(100vw - 32px);
		padding-top: 52px;
	}

	.aefb .aefb-card {
		padding: 20px 18px 18px;
		border-radius: 24px;
	}

	.aefb .aefb-girl {
		top: -50px;
		right: 52px;
		width: 120px;
	}

	.aefb .aefb-star {
		top: -62px;
		right: 36px;
		width: 24px;
	}

	.aefb .aefb-logo {
		height: 40px;
		margin-bottom: 10px;
	}

	.aefb .aefb-title { font-size: 17px; }
	.aefb .aefb-script { font-size: 20px; }
	.aefb .aefb-text { font-size: 13px; margin-bottom: 12px; }
	.aefb .aefb-stats { margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
	.aefb,
	.aefb.is-leaving {
		transform: none;
		transition: opacity .3s linear;
	}

	.aefb-float,
	.aefb .aefb-girl,
	.aefb .aefb-star {
		animation: none;
	}
}

@media print {
	.aefb {
		display: none !important;
	}
}
