/* =========================================================
   "Get HertsPartners" -- the native-app invitation.
   Loaded only while it is switched on (inc/app-download.php).

   Every colour comes from the site's own tokens, which dark mode
   (html.hp-experience-dark) redefines as a set -- so the panel and its text
   always flip together. The old PWA prompt hardcoded a white panel while its
   text followed dark mode, which is how it ended up white-on-white.
   ========================================================= */

.hp-app-download {
	position: fixed;
	z-index: 99991;
	right: max(var(--hp-space-4), env(safe-area-inset-right));
	/* Just above the mobile tab bar -- the shared clearance, see navigation.css. */
	bottom: var(--hp-tabbar-clearance, calc(1rem + env(safe-area-inset-bottom)));
	left: max(var(--hp-space-4), env(safe-area-inset-left));
	max-width: 30rem;
	margin-inline: auto;
	padding: var(--hp-space-4);
	padding-top: var(--hp-space-5, 1.25rem);
	color: var(--hp-color-ink);
	background:
		linear-gradient(var(--hp-color-surface, #fff), var(--hp-color-surface, #fff)) padding-box,
		linear-gradient(135deg, #7c3aed, #c026d3) border-box;
	border: 2px solid transparent;
	border-radius: var(--hp-radius-lg, 20px);
	box-shadow: 0 22px 60px rgba(46, 16, 101, 0.28);
	animation: hp-app-download-in 260ms ease-out both;
}

.hp-app-download__head {
	display: flex;
	align-items: center;
	gap: var(--hp-space-3);
	padding-right: 2rem;
}

.hp-app-download__mark {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	object-fit: contain;
}

.hp-app-download__eyebrow {
	margin: 0 0 2px;
	color: var(--hp-color-link, #6d28d9);
	font: 800 0.72rem/1.2 var(--hp-font-body);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.hp-app-download__title {
	margin: 0;
	color: var(--hp-color-ink);
	font: 700 1.02rem/1.35 var(--hp-font-heading);
}

.hp-app-download__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--hp-space-2);
	margin-top: var(--hp-space-4);
}

.hp-app-download__store {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	min-height: 48px;
	padding: 0.55rem 1.1rem;
	color: var(--hp-color-ink);
	background: var(--hp-color-surface-muted, #f1ecff);
	border: 1px solid var(--hp-color-border, #ececec);
	border-radius: 14px;
	text-decoration: none;
}

.hp-app-download__store strong {
	font: 800 0.95rem/1.15 var(--hp-font-body);
}

.hp-app-download__store span {
	color: var(--hp-color-body);
	font-size: 0.75rem;
}

/* Scoped to the sheet and its visited/hover states so the site's own link
   colours (which are more specific than a bare class) can never turn the
   label dark on the violet button. */
.hp-app-download a.hp-app-download__store--primary,
.hp-app-download a.hp-app-download__store--primary:visited,
.hp-app-download a.hp-app-download__store--primary:hover {
	color: #fff;
	background: linear-gradient(135deg, #7c3aed, #6d28d9);
	border-color: transparent;
}

.hp-app-download a.hp-app-download__store--primary strong {
	color: #fff;
}

.hp-app-download a.hp-app-download__store--primary span {
	color: rgba(255, 255, 255, 0.88);
}

.hp-app-download a.hp-app-download__store,
.hp-app-download a.hp-app-download__store:visited {
	text-decoration: none;
}

.hp-app-download__later {
	min-height: 44px;
	padding: 0.55rem 0.9rem;
	color: var(--hp-color-link, #6d28d9);
	background: transparent;
	border: 0;
	font: 700 0.9rem/1 var(--hp-font-body);
	cursor: pointer;
}

.hp-app-download__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 44px;
	height: 44px;
	color: var(--hp-color-body);
	background: transparent;
	border: 0;
	border-radius: 50%;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
}

.hp-app-download a:focus-visible,
.hp-app-download button:focus-visible {
	outline: 3px solid var(--hp-color-primary-400, #a78bfa);
	outline-offset: 3px;
}

@media (min-width: 1025px) {
	.hp-app-download {
		right: max(var(--hp-space-6), env(safe-area-inset-right));
		bottom: max(var(--hp-space-6), env(safe-area-inset-bottom));
		left: auto;
		margin: 0;
	}
}

@keyframes hp-app-download-in {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.hp-app-download { animation: none; }
}
