/* ---------------------------------------------------------------------
   Global page-loading indicator.

   Two parts:
     1. a slim bar pinned to the top of the window, and
     2. a centred "LOADING..." card over a dimmed backdrop.

   Both are driven by static/js/loading.js. Everything is prefixed `bitld-`
   so it cannot collide with the vendor/app stylesheets.
   --------------------------------------------------------------------- */

:root {
	--bitld-green: #00c853;
	--bitld-green-dk: #00a344;
	--bitld-ink: #0d1b33;
}

/* ------------------------------- top bar ---------------------------- */

.bitld-bar {
	position: fixed;
	top: 0; left: 0;
	height: 3px;
	width: 0;
	z-index: 100000;
	background: linear-gradient(90deg, var(--bitld-green), #35c9b8);
	box-shadow: 0 0 10px rgba(0, 200, 83, .7);
	opacity: 0;
	transition: width .2s ease, opacity .25s ease;
	pointer-events: none;
}

.bitld-bar.is-active { opacity: 1; }

/* ------------------------------- overlay ---------------------------- */

.bitld-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(233, 237, 245, .72);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	opacity: 0;
	visibility: hidden;
	transition: opacity .18s ease, visibility .18s ease;
}

.bitld-overlay.is-active {
	opacity: 1;
	visibility: visible;
}

.bitld-box {
	text-align: center;
	padding: 4px 8px;
	transform: translateY(6px);
	transition: transform .18s ease;
}

.bitld-overlay.is-active .bitld-box { transform: none; }

.bitld-title {
	font-size: 20px;
	font-weight: 800;
	letter-spacing: 1.5px;
	color: var(--bitld-ink);
	margin-bottom: 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
	             "Helvetica Neue", Arial, sans-serif;
}

/* pill track + fill */
.bitld-track {
	width: 260px;
	max-width: 70vw;
	height: 26px;
	border: 3px solid var(--bitld-ink);
	border-radius: 999px;
	background: #fff;
	padding: 3px;
	overflow: hidden;
}

.bitld-fill {
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--bitld-green-dk), var(--bitld-green));
	transition: width .25s ease;
}

/* Indeterminate shimmer so the bar still reads as "working" while it
   waits near the end for the server to respond. */
.bitld-fill::after {
	content: "";
	display: block;
	height: 100%;
	width: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg,
		rgba(255, 255, 255, 0) 0%,
		rgba(255, 255, 255, .45) 50%,
		rgba(255, 255, 255, 0) 100%);
	animation: bitld-shimmer 1.1s linear infinite;
}

@keyframes bitld-shimmer {
	from { transform: translateX(-100%); }
	to   { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
	.bitld-bar,
	.bitld-fill,
	.bitld-overlay,
	.bitld-box { transition: none; }
	.bitld-fill::after { animation: none; }
}
