/* ==========================================================================
   Loading / content-unavailable screen, and the skeletons used inside pages.
   --------------------------------------------------------------------------
   Kept in its own small stylesheet rather than appended to app.css: this page
   is shown precisely when things are not working, so it should depend on as
   little as possible to render correctly.
   ========================================================================== */

:root {
	--load-bg:      #f6f7fb;
	--load-surface: #ffffff;
	--load-text:    #202332;
	--load-muted:   #6b7280;
	--load-line:    #e6e8f0;
	--load-shimmer: #eef0f6;
	--load-brand:   #454192;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--load-bg:      #12141c;
		--load-surface: #181b24;
		--load-text:    #e8eaf2;
		--load-muted:   #9aa1b4;
		--load-line:    #262a36;
		--load-shimmer: #20242f;
		--load-brand:   #8d87d6;
	}
}

:root[data-theme="dark"] {
	--load-bg:      #12141c;
	--load-surface: #181b24;
	--load-text:    #e8eaf2;
	--load-muted:   #9aa1b4;
	--load-line:    #262a36;
	--load-shimmer: #20242f;
	--load-brand:   #8d87d6;
}

.loading-body {
	margin: 0;
	min-height: 100vh;
	background: var(--load-bg);
	color: var(--load-text);
	font-family: "IBM Plex Sans", system-ui, -apple-system, Arial, sans-serif;
}

.loading {
	max-width: 620px;
	/* 16px side gutter so nothing touches the edge on a phone. */
	margin: 0 auto;
	padding: 64px 16px 72px;
	text-align: center;
	box-sizing: border-box;
}

.loading__brand { margin-bottom: 30px; }

.loading__logo {
	width: auto;
	height: 46px;
	max-width: 100%;
}

/* Three dots rather than a spinning ring: it reads as "working" without
   implying a percentage of progress that nothing here can measure. */
.loading__spinner {
	display: flex;
	justify-content: center;
	gap: 7px;
	margin-bottom: 22px;
}

.loading__spinner span {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--load-brand);
	animation: loading-bounce 1.3s ease-in-out infinite;
}

.loading__spinner span:nth-child(2) { animation-delay: .18s; }
.loading__spinner span:nth-child(3) { animation-delay: .36s; }

@keyframes loading-bounce {
	0%, 80%, 100% { opacity: .25; transform: translateY(0); }
	40%           { opacity: 1;   transform: translateY(-6px); }
}

.loading__title {
	margin: 0 0 8px;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -.01em;
}

.loading__text {
	margin: 0 auto 34px;
	max-width: 30rem;
	color: var(--load-muted);
	font-size: 15px;
	line-height: 1.6;
}

.loading__urgent {
	margin: 34px 0 0;
	font-size: 15px;
	color: var(--load-muted);
}

.loading__urgent a {
	color: var(--load-brand);
	font-weight: 700;
	text-decoration: none;
}

/* --------------------------------------------------------------------------
   Skeletons
   Also used inside real pages, for a section whose own content is missing
   while the rest of the page has loaded.
   -------------------------------------------------------------------------- */

.skeleton {
	position: relative;
	overflow: hidden;
	background: var(--load-shimmer);
	border-radius: 8px;
}

.skeleton::after {
	content: "";
	position: absolute;
	inset: 0;
	transform: translateX(-100%);
	background: linear-gradient(90deg,
		transparent 0%,
		rgba(255, 255, 255, .55) 50%,
		transparent 100%);
	animation: skeleton-sweep 1.5s infinite;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .skeleton::after {
		background: linear-gradient(90deg,
			transparent 0%,
			rgba(255, 255, 255, .07) 50%,
			transparent 100%);
	}
}

@keyframes skeleton-sweep {
	100% { transform: translateX(100%); }
}

/* Someone who has asked for less motion gets a plain block that still reads
   as a placeholder. */
@media (prefers-reduced-motion: reduce) {
	.skeleton::after { animation: none; display: none; }
	.loading__spinner span { animation: none; opacity: .6; }
}

.skeleton--line   { height: 14px; margin: 0 auto 12px; }
.skeleton--w90    { width: 90%; }
.skeleton--w70    { width: 70%; }
.skeleton--w50    { width: 50%; }
.skeleton--title  { height: 26px; width: 45%; margin: 0 auto 20px; }
.skeleton--card   { height: 150px; border-radius: 12px; }

.skeleton-page { margin-top: 36px; }

.skeleton-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 14px;
	margin-top: 26px;
}

/* A section inside an otherwise-working page whose content has not loaded. */
.section-skeleton {
	max-width: 1120px;
	margin: 0 auto;
	padding: 48px 16px;
	box-sizing: border-box;
}

.section-skeleton__note {
	margin: 18px 0 0;
	text-align: center;
	font-size: 13.5px;
	color: var(--load-muted);
}
