/* Campsite Booking System — Guest App shell (v0.33.0).
 *
 * App-style UI: branded header, card-based Home, bottom tab bar, Explore
 * place cards. All brand colours derive from two custom properties set
 * inline by the renderer: --tpcbs-brand and --tpcbs-brand-soft.
 */

/* ── Shell ─────────────────────────────────────────────────────────────── */

body.tpcbs-gp-virtual {
	margin: 0;
	background: #f7f7f5;
}

.tpcbs-ga {
	--tpcbs-brand: #1d7a4d;
	--tpcbs-brand-soft: #e2f2ea;
	max-width: 480px;
	margin: 16px auto;
	min-height: 640px;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 20px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: #111827;
	display: flex;
	flex-direction: column;
}

/* Full-bleed app on phones — the frame only matters on larger screens.
 * overflow returns to visible so the sticky bottom tab bar pins to the
 * viewport (an overflow:hidden ancestor would trap it inside the shell). */
@media (max-width: 520px) {
	.tpcbs-ga {
		margin: 0;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		overflow: visible;
		min-height: 100vh;
	}
}

.tpcbs-ga h3 {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 8px;
}

.tpga-icon { display: inline-block; vertical-align: middle; flex: 0 0 auto; }
.tpga-muted { color: #6b7280; font-size: 12px; }
.tpga-empty { color: #6b7280; font-size: 14px; margin: 0; }

/* ── Header ────────────────────────────────────────────────────────────── */

.tpga-header {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 64px;
	padding: 0 16px;
	background: var(--tpcbs-brand-soft);
	border-bottom: 1px solid #e5e7eb;
}

.tpga-logo-chip {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: var(--tpcbs-brand-soft);
	color: var(--tpcbs-brand);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.tpga-logo-chip img { width: 28px; height: 28px; object-fit: contain; }

.tpga-header-text { display: flex; flex-direction: column; min-width: 0; }
.tpga-site-name { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpga-greeting { font-size: 12px; color: #525c69; } /* WCAG AA contrast — was #6b7280 */

/* ── Panels ────────────────────────────────────────────────────────────── */

.tpga-panel {
	display: none;
	flex: 1 1 auto;
	padding: 12px 16px;
}
.tpga-panel.is-active { display: block; animation: tpga-fade 150ms ease; }
@keyframes tpga-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
	.tpga-panel.is-active { animation: none; }
	.tpga-pill:active, .tpga-filter-pill:active, .tpga-tile:active { transform: none !important; }
}

/* ── Cards ─────────────────────────────────────────────────────────────── */

.tpga-card {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 14px 16px;
	margin: 0 0 12px;
}
.tpga-prose p { margin: 0 0 10px; }
.tpga-prose p:last-child { margin-bottom: 0; }

/* Home welcome card carries the brand tint (text stays dark for contrast). */
.tpga-panel[data-panel="home"] .tpga-card.tpga-prose {
	background: var(--tpcbs-brand-soft);
	border-color: transparent;
	color: #111827;
}

/* ── "Your stay" card ──────────────────────────────────────────────────── */

.tpga-stay-card {
	display: flex;
	flex-direction: column;
	background: var(--tpcbs-brand);
	color: #ffffff;
	border-radius: 16px;
	padding: 16px;
	margin: 0 0 12px;
}
.tpga-stay-eyebrow {
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #eaf6ee; /* WCAG AA contrast — was var(--tpcbs-brand-soft) #e2f2ea */
	margin-bottom: 4px;
}
.tpga-stay-pitch { font-size: 18px; font-weight: 600; color: #ffffff; }
.tpga-stay-dates { font-size: 13px; color: #eaf6ee; margin-top: 2px; } /* WCAG AA — was var(--tpcbs-brand-soft) */
.tpga-stay-pills { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.tpga-pill {
	appearance: none;
	border: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	border-radius: 999px;
	padding: 6px 12px;
	font-size: 12px;
	font-weight: 600;
	background: rgba(0, 0, 0, 0.28); /* WCAG AA contrast — was rgba(255,255,255,0.18) */
	color: #ffffff;
	min-height: 32px;
	transition: transform 100ms ease;
}
.tpga-pill:active { transform: scale(0.97); }
.tpga-pill:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }

/* ── Welcome hero (no token) ───────────────────────────────────────────── */

.tpga-hero {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--tpcbs-brand);
	color: #ffffff;
	border-radius: 16px;
	padding: 18px 16px;
	margin: 0 0 12px;
}
.tpga-hero-eyebrow {
	font-size: 11px;
	letter-spacing: 0.08em;
	color: rgba(255, 255, 255, 0.7);
	margin-bottom: 4px;
}
.tpga-hero-name { font-size: 20px; font-weight: 600; color: #ffffff; }
.tpga-hero-strap { font-size: 13px; color: rgba(255, 255, 255, 0.85); margin-top: 2px; }
.tpga-hero-book { text-decoration: none; }

/* Demo sample stay card "Example" badge. */
.tpga-stay-card--demo { position: relative; }
.tpga-demo-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	background: rgba(0, 0, 0, 0.35); /* WCAG AA contrast — was rgba(255,255,255,0.22) */
	color: #ffffff;
	border-radius: 999px;
	padding: 3px 8px;
}

/* Light brand colour → dark text on brand surfaces so it stays readable. */
.tpga-brand-light .tpga-stay-card,
.tpga-brand-light .tpga-hero { color: #111827; }
.tpga-brand-light .tpga-stay-pitch,
.tpga-brand-light .tpga-hero-name { color: #111827; }
.tpga-brand-light .tpga-stay-dates,
.tpga-brand-light .tpga-hero-strap { color: rgba(17, 24, 39, 0.75); }
.tpga-brand-light .tpga-stay-eyebrow,
.tpga-brand-light .tpga-hero-eyebrow { color: rgba(17, 24, 39, 0.6); }
.tpga-brand-light .tpga-pill { background: rgba(17, 24, 39, 0.1); color: #111827; }
.tpga-brand-light .tpga-demo-badge { background: rgba(17, 24, 39, 0.14); color: #111827; }

/* ── Get me there card ─────────────────────────────────────────────────── */

.tpga-getthere {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #e6f1fb;
	color: #185fa5;
	border-radius: 12px;
	padding: 12px 14px;
	margin: 0 0 12px;
	min-height: 48px;
	text-decoration: none;
}
.tpga-getthere-text { flex: 1 1 auto; display: flex; flex-direction: column; }
.tpga-getthere-title { font-size: 15px; font-weight: 600; color: #0c447c; }
.tpga-getthere-sub { font-size: 12px; color: #185fa5; }
.tpga-getthere:focus-visible { outline: 2px solid #185fa5; outline-offset: 2px; }

/* ── Quick tiles ───────────────────────────────────────────────────────── */

.tpga-tiles {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
	margin: 0 0 12px;
}
.tpga-tile {
	appearance: none;
	border: 0;
	background: transparent;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 4px 0;
	min-height: 48px;
	text-decoration: none;
	transition: transform 100ms ease;
}
.tpga-tile:active { transform: scale(0.97); }
.tpga-tile:focus-visible { outline: 2px solid var(--tpcbs-brand); outline-offset: 2px; border-radius: 8px; }
.tpga-tile-chip {
	width: 52px;
	height: 52px;
	border-radius: 14px;
	background: #f3f4f6;
	color: #111827;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.tpga-tile-label { font-size: 11px; color: #6b7280; }

/* Wi-Fi (and future) sheets */
.tpga-sheet {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 14px 16px;
	margin: 0 0 12px;
}
.tpga-code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	background: #f3f4f6;
	border-radius: 6px;
	padding: 2px 8px;
}

/* ── Explore ───────────────────────────────────────────────────────────── */

.tpga-pills {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding: 2px 0 10px;
}
.tpga-pills::-webkit-scrollbar { display: none; }

.tpga-filter-pill {
	appearance: none;
	border: 0;
	cursor: pointer;
	flex: 0 0 auto;
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 600;
	background: #f3f4f6;
	color: #6b7280;
	transition: transform 100ms ease;
}
.tpga-filter-pill.is-active { background: var(--tpcbs-brand); color: #ffffff; }
.tpga-filter-pill:active { transform: scale(0.97); }
.tpga-filter-pill:focus-visible { outline: 2px solid var(--tpcbs-brand); outline-offset: 2px; }

.tpga-places { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }

.tpga-place {
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	background: #ffffff;
}
.tpga-place.is-hidden { display: none; }
.tpga-place-img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}
.tpga-place-body { padding: 12px; }
.tpga-place-toprow {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
}
.tpga-place-name { font-size: 14px; font-weight: 600; }
.tpga-place-badge {
	flex: 0 0 auto;
	font-size: 11px;
	font-weight: 600;
	border-radius: 999px;
	padding: 2px 8px;
	white-space: nowrap;
}
.tpga-host-pick {
	background: var(--tpga-brand, #2e7d32);
	color: #fff;
}
.tpga-place-rating {
	flex: 0 0 auto;
	font-size: 11px;
	font-weight: 600;
	color: #b45309;
	background: #fef3c7;
	border-radius: 999px;
	padding: 2px 8px;
	white-space: nowrap;
}
.tpga-place-toprow { flex-wrap: wrap; }
.tpga-place-desc { font-size: 12px; color: #6b7280; margin: 6px 0 0; }
.tpga-place-desc p { font-size: 12px; color: #6b7280; margin: 0 0 6px; }
.tpga-place-desc p:last-child { margin-bottom: 0; }
.tpga-place-desc ul, .tpga-place-desc ol { margin: 0 0 6px 18px; padding: 0; }
.tpga-place-distance { font-size: 12px; color: #6b7280; margin: 4px 0 0; }
.tpga-place-links { display: flex; gap: 14px; margin: 8px 0 0; }
.tpga-place-go,
.tpga-place-web {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	font-weight: 600;
	color: var(--tpcbs-brand);
	text-decoration: none;
}
.tpga-place-go:focus-visible,
.tpga-place-web:focus-visible { outline: 2px solid var(--tpcbs-brand); outline-offset: 2px; }

/* ── My stay ───────────────────────────────────────────────────────────── */

.tpga-stay-locked { text-align: center; padding: 28px 16px; color: #374151; }
.tpga-stay-locked .tpga-icon { color: var(--tpcbs-brand); margin-bottom: 6px; }
.tpga-stay-locked p { color: #6b7280; font-size: 14px; margin: 6px 0 0; }

/* Booking summary def-list (markup unchanged from v1). */
.tpcbs-gp-deflist { margin: 0; }
.tpcbs-gp-defrow {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 7px 0;
	border-bottom: 1px solid #f3f4f6;
	font-size: 14px;
}
.tpcbs-gp-defrow dt { color: #6b7280; }
.tpcbs-gp-defrow dd { margin: 0; font-weight: 600; text-align: right; }
.tpcbs-gp-defrow-strong dd { color: var(--tpcbs-brand); }
.tpcbs-gp-balance { margin-top: 10px; }
.tpcbs-gp-balance-note { font-size: 13px; color: #6b7280; margin: 10px 0 0; }
.tpcbs-gp-paid { color: #047857; }

/* v0.89.10 — extras (add-ons) on the booking summary */
.tpcbs-gp-extras { margin: 14px 0 8px; padding-top: 12px; border-top: 1px solid #e5e7eb; }
.tpcbs-gp-extras__title { margin: 0 0 8px; font-size: 13px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.tpcbs-gp-extras__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.tpcbs-gp-extras__row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; font-size: 14px; }
.tpcbs-gp-extras__name { font-weight: 600; color: #111827; }
.tpcbs-gp-extras__meta { grid-column: 1; font-size: 12px; color: #6b7280; }
.tpcbs-gp-extras__total { grid-column: 2; grid-row: 1; font-weight: 700; color: #111827; }

.tpcbs-gp-pitch-code { margin: 10px 0 0; }
.tpcbs-gp-code-value {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 16px;
	background: #f3f4f6;
	border-radius: 6px;
	padding: 2px 10px;
	letter-spacing: 0.08em;
}
.tpcbs-gp-keys-note { font-size: 12px; color: #6b7280; margin: 8px 0 0; }

/* Amend block (markup unchanged from v0.28). */
.tpcbs-gp-amend label { display: block; font-size: 13px; color: #374151; margin: 8px 0 2px; }
.tpcbs-gp-amend input,
.tpcbs-gp-amend select {
	width: 100%;
	max-width: 220px;
	padding: 8px 10px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 14px;
}
.tpcbs-gp-amend-result { font-size: 14px; margin-top: 10px; }
.tpcbs-gp-amend-result.is-ok { color: #047857; }
.tpcbs-gp-amend-result.is-error { color: #b4532a; }
#tpcbs-amend-submit,
.tpcbs-gp-paybtn {
	display: inline-block;
	appearance: none;
	border: 0;
	cursor: pointer;
	background: var(--tpcbs-brand);
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	border-radius: 999px;
	padding: 10px 20px;
	margin-top: 12px;
	min-height: 44px;
	text-decoration: none;
}

/* ── Map ───────────────────────────────────────────────────────────────── */

.tpcbs-gp-map-img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
	border: 1px solid #e5e7eb;
}
.tpcbs-gp-map-link:focus-visible { outline: 2px solid var(--tpcbs-brand); outline-offset: 2px; }

/* ── Help / contact ────────────────────────────────────────────────────── */

.tpga-contact-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	font-weight: 600;
	color: var(--tpcbs-brand);
	text-decoration: none;
	min-height: 44px;
}
.tpga-contact-link:focus-visible { outline: 2px solid var(--tpcbs-brand); outline-offset: 2px; }

/* ── Bottom tab bar ────────────────────────────────────────────────────── */

.tpga-tabbar {
	position: sticky;
	bottom: 0;
	z-index: 50;
	display: flex;
	background: #ffffff;
	border-top: 0.5px solid #e5e7eb;
	padding: 8px 0 calc(12px + env(safe-area-inset-bottom, 0px));
	margin-top: auto;
}
.tpga-tab {
	appearance: none;
	border: 0;
	background: transparent;
	cursor: pointer;
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	color: #9ca3af;
	font-size: 10px;
	padding: 2px 0;
	min-height: 44px;
}
.tpga-tab span { line-height: 1.2; }
.tpga-tab.is-active { color: var(--tpcbs-brand); font-weight: 600; }
.tpga-tab:focus-visible { outline: 2px solid var(--tpcbs-brand); outline-offset: -2px; border-radius: 8px; }

/* ── Desktop framing ───────────────────────────────────────────────────── */

@media (min-width: 600px) {
	.tpcbs-ga {
		border-left: 1px solid #e5e7eb;
		border-right: 1px solid #e5e7eb;
		min-height: 90vh;
	}
}

/* Amend form fields (markup from guest-portal-amend.php, unchanged). */
.tpcbs-gp-field { display: block; margin: 8px 0; }
.tpcbs-gp-field span { display: block; font-size: 13px; color: #374151; margin-bottom: 2px; }
.tpcbs-gp-qtygrid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px 12px;
}
.tpcbs-gp-callbtn {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-weight: 600;
	color: var(--tpcbs-brand);
	text-decoration: none;
}
.tpcbs-gp-amend-blocked p { color: #6b7280; font-size: 14px; }

/* v0.89.15 — amend add-ons + pitch-change UI */
.tpcbs-gp-amend-legend { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; color: #6b7280; margin: 14px 0 8px; }
.tpcbs-gp-amend-hint { color: #6b7280; font-size: 13px; margin: 0 0 8px; }
.tpcbs-gp-amend-extras, .tpcbs-gp-amend-pitchchange { margin-top: 10px; }
.tpcbs-gp-addon-list, .tpcbs-gp-pitch-list { display: flex; flex-direction: column; gap: 8px; }
.tpcbs-gp-addon, .tpcbs-gp-pitch { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 10px; cursor: pointer; align-items: flex-start; background: #fff; }
.tpcbs-gp-addon:has(input:checked), .tpcbs-gp-pitch:has(input:checked) { border-color: transparent; background: #e6efe6; }
.tpcbs-gp-addon input, .tpcbs-gp-pitch input { margin-top: 3px; }
.tpcbs-gp-addon-body, .tpcbs-gp-pitch-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.tpcbs-gp-addon-name, .tpcbs-gp-pitch-name { font-weight: 600; color: #111827; font-size: 14px; }
.tpcbs-gp-addon-desc { font-size: 12px; color: #6b7280; }
.tpcbs-gp-addon-price, .tpcbs-gp-pitch-note { font-size: 12px; color: #6b7280; }
.tpcbs-gp-pitch-diff-up { color: #b91c1c; }
.tpcbs-gp-pitch-diff-down { color: #047857; }

/* v0.92.0 — Share-with-party + Get-me-there + Call reception action card */
.tpcbs-gp-actions { text-align: center; }
.tpcbs-gp-actions h3 { margin-bottom: 6px; }
.tpcbs-gp-share-blurb { color: #6b7280; font-size: 13px; margin: 0 0 14px; }
.tpcbs-gp-qr { display: inline-block; padding: 12px; background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.tpcbs-gp-qr img, .tpcbs-gp-qr canvas { display: block; }
.tpcbs-gp-actionrow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.tpga-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none; border: 1px solid transparent; background: var(--tpcbs-brand, #2e7d32); color: #fff; cursor: pointer; }
.tpga-btn:hover, .tpga-btn:focus-visible { filter: brightness(1.05); }
.tpga-btn-secondary { background: #fff; color: var(--tpcbs-brand, #2e7d32); border-color: var(--tpcbs-brand, #2e7d32); }
.tpcbs-gp-copy { min-width: 160px; }

/* v0.94.0 — Pin-on-image site map */
.tpcbs-gp-map-wrap { position: relative; display: block; line-height: 0; }
.tpcbs-gp-map-link { display: block; }
.tpcbs-gp-map-img { display: block; max-width: 100%; height: auto; border-radius: 12px; }
.tpcbs-gp-map-pins { position: absolute; inset: 0; pointer-events: none; }
.tpcbs-gp-map-pin { position: absolute; width: 12px; height: 12px; border-radius: 999px; background: rgba(255,255,255,0.9); border: 2px solid var(--tpcbs-brand, #2e7d32); box-shadow: 0 1px 3px rgba(0,0,0,0.35); transform: translate(-50%,-50%); }
.tpcbs-gp-map-pin.is-own { width: 20px; height: 20px; background: var(--tpcbs-brand, #2e7d32); border: 3px solid #fff; z-index: 2; }
.tpcbs-gp-map-pin-label { position: absolute; left: 50%; top: calc(100% + 4px); transform: translateX(-50%); background: var(--tpcbs-brand, #2e7d32); color: #fff; font-style: normal; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,0.35); }
