/* "Install the app" banner and the iPhone/iPad how-to sheet (see
   public/assets/js/pwa-install.js). A separate stylesheet loaded by every
   layout, because the guest pages ship a precompiled Tailwind build and
   cannot pick up new utility classes, while the signed-in pages use app.css.
   Flat dark surface, brand red for the one primary action, no gradients. */

.pwa-banner,
.pwa-sheet {
	font-family: 'Raleway', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.pwa-banner[hidden],
.pwa-sheet[hidden] {
	display: none;
}

/* ---- Banner ---- */

.pwa-banner {
	position: fixed;
	z-index: 900;
	left: 12px;
	right: 12px;
	bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	color: #e9eaee;
	background: #14151b;
	border: 1px solid #2a2c36;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.pwa-banner__icon {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border-radius: 10px;
}

.pwa-banner__text {
	flex: 1 1 auto;
	min-width: 0;
	line-height: 1.35;
}

.pwa-banner__title {
	display: block;
	font-size: 15px;
	font-weight: 700;
	color: #fff;
}

.pwa-banner__sub {
	display: block;
	margin-top: 2px;
	font-size: 13px;
	color: #b4b7c2;
}

.pwa-banner__actions {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 6px;
}

.pwa-btn {
	min-height: 40px;
	padding: 9px 18px;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
}

.pwa-btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.pwa-btn--primary {
	color: #fff;
	background: #d82a4e;
}

.pwa-btn--primary:hover {
	background: #b5203f;
}

.pwa-btn--quiet {
	color: #b4b7c2;
	background: transparent;
}

.pwa-btn--quiet:hover {
	color: #fff;
}

@media only screen and (max-width: 520px) {
	.pwa-banner {
		flex-wrap: wrap;
		gap: 12px;
	}

	.pwa-banner__text {
		flex-basis: calc(100% - 60px);
	}

	.pwa-banner__actions {
		flex-basis: 100%;
	}

	.pwa-banner__actions .pwa-btn--primary {
		flex: 1 1 auto;
	}
}

@media only screen and (min-width: 768px) {
	.pwa-banner {
		left: auto;
		right: 24px;
		bottom: 24px;
		width: 400px;
	}
}

/* ---- Inline "Install app" links (sidebar, footer) ---- */

.pwa-link {
	padding: 0;
	font: inherit;
	color: inherit;
	text-align: left;
	background: none;
	border: 0;
	cursor: pointer;
}

.pwa-link[hidden] {
	display: none;
}

.app-sidebar__install {
	padding: 0 28px;
	margin-top: 20px;
}

.app-sidebar__install .pwa-link {
	display: block;
	width: 100%;
	padding: 4px 0;
	font-size: 15px;
	font-weight: 500;
	color: #9a9dab;
}

.app-sidebar__install .pwa-link:hover {
	color: #fff;
}

/* ---- iPhone / iPad how-to sheet ---- */

.pwa-sheet {
	position: fixed;
	z-index: 1100;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.pwa-sheet__backdrop {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: rgba(10, 11, 15, 0.62);
}

.pwa-sheet__panel {
	position: relative;
	width: 100%;
	max-width: 440px;
	max-height: 92vh;
	overflow-y: auto;
	padding: 24px 22px calc(22px + env(safe-area-inset-bottom, 0px));
	color: #e9eaee;
	background: #14151b;
	border-top: 1px solid #2a2c36;
	border-radius: 12px 12px 0 0;
}

.pwa-sheet__title {
	margin: 0 0 6px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
}

.pwa-sheet__lead {
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.5;
	color: #b4b7c2;
}

.pwa-steps {
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
	counter-reset: pwa-step;
}

.pwa-steps li {
	position: relative;
	margin: 0 0 14px;
	padding-left: 38px;
	font-size: 15px;
	line-height: 1.45;
	color: #e9eaee;
	counter-increment: pwa-step;
}

.pwa-steps li::before {
	content: counter(pwa-step);
	position: absolute;
	left: 0;
	top: -1px;
	width: 26px;
	height: 26px;
	font-size: 13px;
	font-weight: 700;
	line-height: 26px;
	text-align: center;
	color: #fff;
	background: #d82a4e;
	border-radius: 50%;
}

.pwa-steps strong {
	color: #fff;
}

.pwa-steps svg {
	display: inline-block;
	width: 18px;
	height: 18px;
	margin: 0 2px;
	vertical-align: -3px;
	fill: none;
	stroke: #fff;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.pwa-sheet__panel .pwa-btn {
	width: 100%;
}

@media only screen and (min-width: 520px) {
	.pwa-sheet {
		align-items: center;
	}

	.pwa-sheet__panel {
		border: 1px solid #2a2c36;
		border-radius: 8px;
	}
}

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

/* Never shown inside the installed app or when printing. */
@media (display-mode: standalone), print {
	.pwa-banner,
	.pwa-sheet,
	.pwa-link {
		display: none !important;
	}
}
