/**
 * ASKPERTASK-LOADING-CELEBRATION-1A — the owner-approved waiting / success states (website Full + Easy mode, and the app).
 *
 * Six views, all kept: M01 pins + logo (map discovery), M02 publishing (bubbles) + the one-shot Request celebration,
 * M03 magnifier (search), M04 compact save (cog + wrench in the button), M05 livelier save, M06 living list.
 * Adapted from the approved reference package (source/reference.css); colours are the package's logo samples. Only
 * transform / opacity animate; prefers-reduced-motion = no loops, no sweeps, no particles — the text stays.
 * Driven only by real operations (assets/js/apt-loading.js). Icons: the Font Awesome already on every page.
 */
.apt-ld-card,
.apt-ld-float,
.apt-ld-party,
.apt-ld-confirm,
.apt-ld-btn {
	--apt-ld-red: #ff101b;
	--apt-ld-blue: #00a2e3;
	--apt-ld-navy: #123f9a;
	--apt-ld-green: #4d9d17;
	--apt-ld-orange: #ff7116;
	--apt-ld-text: #293b45;
	--apt-ld-muted: #63727d;
	--apt-ld-line: #e2e9ed;
	--apt-ld-soft: #f1f5f7;
}

/* ------------------------------------------------------------------ */
/* The card (M01 / M02 / M03 / M06)                                    */
/* ------------------------------------------------------------------ */
.apt-ld-card {
	box-sizing: border-box;
	flex: 1 0 100%;
	width: 100%;
	max-width: 420px;
	margin: 12px auto;
	padding: 14px 16px;
	background: #fff;
	border: 1px solid var(--apt-ld-line);
	border-radius: 16px;
	color: var(--apt-ld-text);
	font-size: 14px;
	line-height: 1.45;
	text-align: center;
}
.apt-ld-card[hidden] { display: none !important; }
.apt-ld-host { flex-wrap: wrap !important; }
.apt-ld-card__text {
	display: block;
	margin: 6px 0 0;
	font-weight: 600;
	color: var(--apt-ld-text);
}
.apt-ld-card__slow {
	margin: 10px 0 0;
	padding: 9px 10px;
	border-radius: 8px;
	background: #fff4df;
	color: #77501c;
	font-size: 13px;
	text-align: left;
}
.apt-ld-card__slow[hidden] { display: none !important; }
.apt-ld-card--compact {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	text-align: left;
}
.apt-ld-card--compact .apt-ld-card__text { margin: 0; font-size: 13px; }
.apt-ld-card--done .apt-ld-scene { display: none; }

.apt-ld-scene {
	position: relative;
	margin: 0 auto;
	pointer-events: none;
}
.apt-ld-scene i { display: block; line-height: 1; }

/* M01 — pins and logo */
.apt-ld-m01 { width: 190px; height: 104px; }
.apt-ld-m01 > span {
	position: absolute;
	top: 34px;
	font-size: 32px;
	animation: apt-ld-pin 1.8s ease-in-out infinite;
}
.apt-ld-m01 > span:nth-child(1) { left: 22px; color: var(--apt-ld-green); }
.apt-ld-m01 > span:nth-child(2) { left: 82px; top: 14px; color: var(--apt-ld-navy); animation-delay: -.6s; }
.apt-ld-m01 > span:nth-child(3) { left: 142px; color: var(--apt-ld-orange); animation-delay: -1.2s; }
.apt-ld-m01 > b,
.apt-ld-m03 > b {
	position: absolute;
	left: 30px;
	bottom: 4px;
	width: 130px;
	height: 4px;
	border-radius: 4px;
	background: #e9f1f6;
	overflow: hidden;
}
.apt-ld-m01 > b::after,
.apt-ld-m03 > b::after {
	content: '';
	display: block;
	width: 42px;
	height: 100%;
	border-radius: 4px;
	background: var(--apt-ld-blue);
	animation: apt-ld-sweep 1.7s ease-in-out infinite;
}
.apt-ld-logo { display: block; width: 44px; height: auto; margin: 8px auto 0; }

/* M02 — publishing: speech bubbles rise from the request */
.apt-ld-m02 { width: 190px; height: 110px; }
.apt-ld-m02 .apt-ld-src {
	position: absolute;
	left: 76px;
	top: 66px;
	font-size: 36px;
	color: var(--apt-ld-red);
	animation: apt-ld-src 1.3s ease-in-out infinite;
}
.apt-ld-m02 .apt-ld-bub {
	position: absolute;
	left: 84px;
	top: 70px;
	font-size: 24px;
	opacity: 0;
	animation: apt-ld-fly 2.1s ease-out infinite;
}
.apt-ld-m02 .apt-ld-c1 { --x: -70px; --y: -60px; color: var(--apt-ld-red); animation-delay: -.15s; }
.apt-ld-m02 .apt-ld-c2 { --x: 8px; --y: -70px; color: var(--apt-ld-blue); animation-delay: -.85s; }
.apt-ld-m02 .apt-ld-c3 { --x: 74px; --y: -50px; color: var(--apt-ld-orange); animation-delay: -1.55s; }
.apt-ld-card--compact .apt-ld-m02 { flex: 0 0 auto; width: 64px; height: 40px; margin: 0; }
.apt-ld-card--compact .apt-ld-m02 .apt-ld-src { left: 22px; top: 18px; font-size: 18px; }
.apt-ld-card--compact .apt-ld-m02 .apt-ld-bub { left: 26px; top: 20px; font-size: 11px; }
.apt-ld-card--compact .apt-ld-m02 .apt-ld-c1 { --x: -22px; --y: -18px; }
.apt-ld-card--compact .apt-ld-m02 .apt-ld-c2 { --x: 4px; --y: -22px; }
.apt-ld-card--compact .apt-ld-m02 .apt-ld-c3 { --x: 26px; --y: -16px; }

/* M03 — the magnifier scans and enlarges the pins */
.apt-ld-m03 { width: 230px; height: 112px; }
.apt-ld-m03 > span {
	position: absolute;
	top: 48px;
	font-size: 30px;
}
.apt-ld-m03 .apt-ld-p1 { left: 32px; color: var(--apt-ld-green); animation: apt-ld-mg1 3.6s ease-in-out infinite; }
.apt-ld-m03 .apt-ld-p2 { left: 102px; color: var(--apt-ld-navy); animation: apt-ld-mg2 3.6s ease-in-out infinite; }
.apt-ld-m03 .apt-ld-p3 { left: 172px; color: var(--apt-ld-orange); animation: apt-ld-mg3 3.6s ease-in-out infinite; }
.apt-ld-m03 .apt-ld-glass {
	left: 14px;
	top: 30px;
	font-size: 58px;
	color: var(--apt-ld-blue);
	animation: apt-ld-scan 3.6s ease-in-out infinite;
	text-shadow: 0 2px 0 #fff;
}
.apt-ld-m03 .apt-ld-spark {
	left: 196px;
	top: 24px;
	font-size: 16px;
	color: var(--apt-ld-orange);
	opacity: 0;
	animation: apt-ld-spark 3.6s ease-in-out infinite;
}
.apt-ld-m03 > b { left: 50px; }

/* M06 — the living list: rings turn, light flows along the lines */
.apt-ld-m06 { display: grid; gap: 16px; width: 100%; max-width: 360px; margin: 6px auto; text-align: left; }
.apt-ld-row { display: flex; gap: 14px; align-items: center; }
.apt-ld-row > b {
	position: relative;
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #eef5fa;
}
.apt-ld-row > b::after {
	content: '';
	position: absolute;
	inset: 3px;
	border: 3px solid transparent;
	border-top-color: var(--apt-ld-blue);
	border-right-color: var(--apt-ld-navy);
	border-radius: 50%;
	animation: apt-ld-spin 1.35s linear infinite;
}
.apt-ld-row:nth-child(2) > b::after { border-top-color: var(--apt-ld-red); border-right-color: var(--apt-ld-orange); animation-delay: -.45s; }
.apt-ld-row:nth-child(3) > b::after { border-top-color: #59ae15; border-right-color: var(--apt-ld-blue); animation-delay: -.9s; }
.apt-ld-row > div { flex: 1; display: grid; gap: 7px; }
.apt-ld-row span {
	display: block;
	height: 8px;
	width: 80%;
	border-radius: 5px;
	background: linear-gradient(90deg, #e0eaf1 0%, #e0eaf1 32%, #81cdef 49%, #e0eaf1 66%, #e0eaf1 100%);
	background-size: 250% 100%;
	animation: apt-ld-lines 1.6s linear infinite;
}
.apt-ld-row span:nth-child(2) { width: 55%; }
.apt-ld-row span:nth-child(3) { width: 35%; }
.apt-ld-row:nth-child(2) span { animation-delay: -.35s; }
.apt-ld-row:nth-child(3) span { animation-delay: -.7s; }
.apt-ld-label {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 14px 0 4px;
	color: var(--apt-ld-navy);
	font-size: 13px;
	font-weight: 600;
}
.apt-ld-label i { color: var(--apt-ld-blue); font-size: 18px; animation: apt-ld-spin 1s linear infinite; }

/* A wait that belongs to a page change (search): floats above the page, never blocks it or moves it. */
.apt-ld-float {
	position: fixed;
	left: 50%;
	top: 38%;
	z-index: 99990;
	width: min(340px, calc(100vw - 32px));
	transform: translate(-50%, -50%);
	pointer-events: none;
}
.apt-ld-float .apt-ld-card { margin: 0; box-shadow: 0 12px 32px rgba(18, 63, 154, .16); }

/* Over the map while its results load (pointer-events none: the map stays usable). */
.apt-ld-over {
	position: absolute;
	left: 50%;
	top: 50%;
	z-index: 1001;
	width: min(300px, calc(100% - 24px));
	transform: translate(-50%, -50%);
	pointer-events: none;
}
.apt-ld-over .apt-ld-card { margin: 0; box-shadow: 0 10px 28px rgba(18, 63, 154, .16); }

/* ------------------------------------------------------------------ */
/* M04 / M05 — saving inside the button                                */
/* ------------------------------------------------------------------ */
.apt-ld-btn { position: relative !important; overflow: hidden; }
.apt-ld-btn__busy {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 0 10px;
	background-color: var(--apt-ld-blue);
	color: #fff;
	font-weight: 600;
	font-size: 14px;
	white-space: nowrap;
	border-radius: inherit;
}
.apt-ld-btn__busy--saved { background-color: #398b4b; }
.apt-ld-gears { position: relative; display: inline-block; width: 36px; height: 22px; flex: 0 0 36px; }
.apt-ld-gears i { position: absolute; line-height: 1; }
.apt-ld-gears i:first-child { left: 0; top: 0; font-size: 20px; animation: apt-ld-spin 2.5s linear infinite; }
.apt-ld-gears i:last-child { right: 0; top: 6px; font-size: 14px; animation: apt-ld-work 1.6s ease-in-out infinite; }
.apt-ld-btn--m05 .apt-ld-gears i:first-child { animation-duration: 1.1s; }
.apt-ld-btn--m05 .apt-ld-gears i:last-child { animation-duration: .65s; }
.apt-ld-btn--m05 .apt-ld-btn__busy::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: 0;
	width: 30%;
	height: 4px;
	background: rgba(255, 255, 255, .6);
	animation: apt-ld-btn-sweep .8s ease-in-out infinite;
}
.apt-ld-btn__busy--saved::after { display: none; }

/* ------------------------------------------------------------------ */
/* The Request celebration — once, after the server confirmed the request */
/* ------------------------------------------------------------------ */
.apt-ld-party {
	position: fixed;
	inset: 0;
	z-index: 99991;
	overflow: hidden;
	pointer-events: none;
}
.apt-ld-party > span {
	position: absolute;
	left: var(--left);
	bottom: -70px;
	width: var(--size);
	height: calc(var(--size) * 1.05);
	background: var(--colour);
	color: #fff;
	display: grid;
	place-items: center;
	font-size: 14px;
	font-weight: 700;
	opacity: 0;
	animation: apt-ld-rise 2.4s cubic-bezier(.16, .55, .42, 1) both;
	animation-delay: var(--delay);
	will-change: transform, opacity;
}
.apt-ld-party .apt-ld-balloon { border-radius: 50% 50% 46% 46%; }
.apt-ld-party .apt-ld-balloon::after { content: ''; position: absolute; top: 100%; left: 50%; width: 1px; height: 28px; background: var(--colour); }
.apt-ld-party .apt-ld-bubble { border-radius: 10px 10px 10px 2px; height: calc(var(--size) * .78); }
.apt-ld-party .apt-ld-bubble::after { content: ''; position: absolute; bottom: -6px; left: 5px; border-top: 8px solid var(--colour); border-right: 7px solid transparent; }
.apt-ld-party .apt-ld-dot { width: 10px; height: 10px; border-radius: 50%; }
.apt-ld-confirm {
	position: fixed;
	left: 50%;
	top: 40%;
	z-index: 99992;
	box-sizing: border-box;
	width: min(320px, calc(100vw - 40px));
	padding: 20px 16px;
	border-radius: 18px;
	background: rgba(255, 255, 255, .96);
	box-shadow: 0 14px 40px rgba(18, 63, 154, .18);
	color: var(--apt-ld-text);
	text-align: center;
	transform: translate(-50%, -50%);
	pointer-events: none;
	animation: apt-ld-confirm 4.2s ease both;
}
.apt-ld-confirm__check {
	display: grid;
	place-items: center;
	width: 58px;
	height: 58px;
	margin: 0 auto 12px;
	border-radius: 50%;
	background: #3d9c4c;
	color: #fff;
	font-size: 28px;
	animation: apt-ld-pop .45s cubic-bezier(.2, .8, .3, 1.5) both;
}
.apt-ld-confirm--review .apt-ld-confirm__check { background: var(--apt-ld-blue); }
.apt-ld-confirm strong { display: block; font-size: 20px; font-weight: 700; line-height: 1.25; }
.apt-ld-confirm p { margin: 8px 0 0; color: var(--apt-ld-muted); font-size: 14px; line-height: 1.4; }

/* ------------------------------------------------------------------ */
/* Motion                                                              */
/* ------------------------------------------------------------------ */
@keyframes apt-ld-pin { 50% { transform: translateY(-6px); } }
@keyframes apt-ld-sweep { from { transform: translateX(-42px); } to { transform: translateX(130px); } }
@keyframes apt-ld-src { 50% { transform: translateY(-4px) scale(1.09); } }
@keyframes apt-ld-fly { 0% { opacity: 0; transform: translate(0, 0) scale(.3); } 15%, 75% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1); } }
@keyframes apt-ld-scan { 0%, 8%, 100% { transform: translate(0, 0) rotate(-8deg); } 30%, 38%, 72%, 78% { transform: translate(70px, -6px) rotate(0); } 54%, 62% { transform: translate(140px, 0) rotate(8deg); } }
@keyframes apt-ld-mg1 { 0%, 12%, 92%, 100% { transform: scale(1.3); } 28%, 80% { transform: scale(1); } }
@keyframes apt-ld-mg2 { 0%, 18%, 50%, 65%, 90%, 100% { transform: scale(1); } 30%, 38%, 72%, 78% { transform: scale(1.3); } }
@keyframes apt-ld-mg3 { 0%, 40%, 76%, 100% { transform: scale(1); } 54%, 62% { transform: scale(1.3); } }
@keyframes apt-ld-spark { 0%, 43%, 75%, 100% { opacity: 0; transform: scale(.4); } 53%, 62% { opacity: 1; transform: scale(1.1); } }
@keyframes apt-ld-spin { to { transform: rotate(360deg); } }
@keyframes apt-ld-work { 50% { transform: rotate(-20deg); } }
@keyframes apt-ld-lines { from { background-position: 140% 0; } to { background-position: -110% 0; } }
@keyframes apt-ld-btn-sweep { from { transform: translateX(-100%); } to { transform: translateX(430%); } }
@keyframes apt-ld-rise { 0% { opacity: 0; transform: translate(0, 0) rotate(-8deg) scale(.65); } 10%, 76% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--drift), -78vh) rotate(var(--angle)) scale(1.05); } }
@keyframes apt-ld-pop { from { transform: scale(.45); } to { transform: scale(1); } }
@keyframes apt-ld-confirm { 0% { opacity: 0; } 8%, 85% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
	.apt-ld-card *,
	.apt-ld-btn__busy,
	.apt-ld-btn__busy *,
	.apt-ld-confirm,
	.apt-ld-confirm * {
		animation: none !important;
		transition: none !important;
	}
	.apt-ld-btn__busy::after,
	.apt-ld-m01 > b::after,
	.apt-ld-m03 > b::after,
	.apt-ld-m03 .apt-ld-spark { display: none; }
	.apt-ld-m02 .apt-ld-bub { opacity: 1; transform: translate(var(--x), var(--y)); }
	.apt-ld-m03 .apt-ld-glass { transform: translateX(70px); }
	.apt-ld-row span { background: #dce9f1; }
	.apt-ld-party { display: none; }
}
@media (max-width: 380px) {
	.apt-ld-card { padding: 12px 10px; }
	.apt-ld-confirm strong { font-size: 18px; }
}
