/**
 * Guest-facing payment styles.
 *
 * Designed to be read one-handed on a phone, outdoors, possibly in bright sun
 * or rain: large touch targets, high contrast, no hover-only affordances.
 * Everything is scoped under .gb- so it cannot leak into the harbour's theme.
 */

.gb-wrap {
	--gb-ink: #10202b;
	--gb-muted: #5b6b78;
	--gb-line: #dbe3e9;
	--gb-surface: #ffffff;
	--gb-canvas: #f2f5f8;
	--gb-brand: #0a5f96;
	--gb-brand-ink: #ffffff;
	--gb-ok: #0f7b4f;
	--gb-ok-bg: #e8f6ef;
	--gb-warn: #a3341f;
	--gb-warn-bg: #fdeeea;
	--gb-expired: #8a6d1f;
	--gb-expired-bg: #fdf6e3;
	--gb-radius: 14px;

	box-sizing: border-box;
	max-width: 30rem;
	margin: 0 auto;
	padding: 0 0 2rem;
	color: var(--gb-ink);
	font-size: 1rem;
	line-height: 1.5;
}

.gb-wrap *,
.gb-wrap *::before,
.gb-wrap *::after {
	box-sizing: inherit;
}

/* ---------------------------------------------------------------- card */

.gb-card {
	background: var(--gb-surface);
	border: 1px solid var(--gb-line);
	border-radius: var(--gb-radius);
	padding: 1.5rem 1.25rem;
	box-shadow: 0 1px 2px rgba(16, 32, 43, 0.05);
}

.gb-card--ok {
	border-color: rgba(15, 123, 79, 0.35);
	background: var(--gb-ok-bg);
}

.gb-card--warn {
	border-color: rgba(163, 52, 31, 0.35);
	background: var(--gb-warn-bg);
}

.gb-card--expired {
	border-color: rgba(138, 109, 31, 0.35);
	background: var(--gb-expired-bg);
}

.gb-card--sim {
	border-style: dashed;
	border-color: var(--gb-brand);
}

.gb-card--pending {
	text-align: center;
}

.gb-title {
	margin: 0 0 0.5rem;
	font-size: 1.35rem;
	line-height: 1.25;
}

.gb-intro {
	margin: 0 0 1.25rem;
	color: var(--gb-muted);
}

.gb-note {
	margin: 0.75rem 0 0;
	color: var(--gb-muted);
	font-size: 0.875rem;
}

/* ------------------------------------------------------------- language */

.gb-lang {
	display: flex;
	justify-content: flex-end;
	gap: 0.2rem;
	margin-bottom: 0.75rem;
	font-size: 0.875rem;
	width: max-content;
	margin-left: auto;
	padding: 0.2rem;
	border: 1px solid rgba(11, 61, 59, 0.12);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.82);
	box-shadow: 0 4px 14px rgba(11, 61, 59, 0.06);
}

.gb-lang__item {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	min-height: 2rem;
	padding: 0.3rem 0.58rem;
	border-radius: 999px;
	color: var(--gb-muted);
	text-decoration: none;
	font-size: 0.78rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.04em;
}

.gb-lang__item.is-active {
	background: var(--gb-teal, #0b3d3b);
	color: #fff;
	box-shadow: 0 2px 8px rgba(11, 61, 59, 0.18);
	font-weight: 700;
}

.gb-lang__item:not(.is-active):hover {
	background: var(--gb-canvas);
	color: var(--gb-ink);
}

.gb-lang__item:focus-visible {
	outline: 3px solid rgba(19, 113, 109, 0.28);
	outline-offset: 2px;
}

.gb-lang__flag {
	font-size: 1rem;
	line-height: 1;
}

.gb-password__form {
	display: grid;
	gap: 0.75rem;
	margin-top: 1.25rem;
}

.gb-password__error {
	padding: 0.75rem 0.9rem;
	border-radius: 0.65rem;
	background: #fff2f0;
	color: #8a261c;
}

@media print {
	.gb-lang { display: none !important; }
}

/* ----------------------------------------------------------------- form */

.gb-fieldset {
	margin: 0 0 1.25rem;
	padding: 0;
	border: 0;
}

.gb-legend {
	padding: 0;
	margin-bottom: 0.5rem;
	font-weight: 600;
}

.gb-rates {
	display: grid;
	gap: 0.5rem;
}

.gb-rate {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	/* Comfortably tappable with wet or gloved hands. */
	min-height: 3.75rem;
	padding: 0.75rem 1rem;
	border: 2px solid var(--gb-line);
	border-radius: var(--gb-radius);
	cursor: pointer;
}

.gb-rate:focus-within {
	outline: 3px solid var(--gb-brand);
	outline-offset: 2px;
}

.gb-rate:has(input:checked) {
	border-color: var(--gb-brand);
	background: rgba(10, 95, 150, 0.06);
}

.gb-rate input {
	width: 1.35rem;
	height: 1.35rem;
	margin: 0;
	accent-color: var(--gb-brand);
	flex: 0 0 auto;
}

.gb-rate__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
}

.gb-rate__label {
	font-weight: 600;
}

.gb-rate__meta {
	color: var(--gb-muted);
	font-size: 0.875rem;
}

.gb-rate__price {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	font-weight: 700;
	white-space: nowrap;
}

.gb-rate__price small {
	color: var(--gb-muted);
	font-size: 0.7rem;
	font-weight: 400;
}

.gb-field {
	margin-bottom: 1.125rem;
}

.gb-label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
}

.gb-optional {
	margin-left: 0.35rem;
	color: var(--gb-muted);
	font-size: 0.8125rem;
	font-weight: 400;
}

.gb-input {
	width: 100%;
	/* 16px minimum stops iOS Safari zooming in on focus. */
	min-height: 3rem;
	padding: 0.7rem 0.85rem;
	border: 2px solid var(--gb-line);
	border-radius: 10px;
	background: var(--gb-surface);
	color: var(--gb-ink);
	font-size: 1rem;
	font-family: inherit;
}

.gb-input:focus {
	border-color: var(--gb-brand);
	outline: 3px solid rgba(10, 95, 150, 0.25);
	outline-offset: 0;
}

.gb-help {
	margin: 0.35rem 0 0;
	color: var(--gb-muted);
	font-size: 0.8125rem;
}

.gb-error {
	margin: 0 0 0.75rem;
	padding: 0.75rem 0.9rem;
	border-radius: 10px;
	background: var(--gb-warn-bg);
	color: var(--gb-warn);
	font-weight: 600;
}

.gb-button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 3.5rem;
	margin-top: 0.25rem;
	padding: 0.9rem 1.25rem;
	border: 2px solid var(--gb-brand);
	border-radius: 12px;
	background: var(--gb-brand);
	color: var(--gb-brand-ink);
	font-size: 1.0625rem;
	font-weight: 700;
	font-family: inherit;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.gb-button:disabled {
	opacity: 0.6;
	cursor: progress;
}

.gb-button--ghost {
	margin-top: 0.6rem;
	background: transparent;
	color: var(--gb-brand);
}

.gb-terms {
	margin: 1rem 0 0;
	text-align: center;
	font-size: 0.875rem;
}

/* ---------------------------------------------------------- live boats */

.gb-live-boats {
	margin-top: 1rem;
}

.gb-live-boats__status {
	margin: 0;
	color: var(--gb-muted);
}

.gb-live-boats__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.gb-live-boats__item {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.75rem 0;
	border-top: 1px solid var(--gb-line);
}

.gb-live-boats__item:first-child {
	border-top: 0;
}

.gb-live-boats__name {
	min-width: 0;
	font-weight: 600;
	overflow-wrap: anywhere;
}

.gb-live-boats__remaining {
	flex: 0 0 auto;
	color: var(--gb-muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* --------------------------------------------------------------- status */

.gb-badge {
	display: inline-block;
	margin-bottom: 0.6rem;
	padding: 0.35rem 0.75rem;
	border-radius: 999px;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.gb-badge--ok {
	background: var(--gb-ok);
	color: #fff;
}

.gb-badge--expired {
	background: var(--gb-expired);
	color: #fff;
}

.gb-badge--sim {
	background: var(--gb-brand);
	color: #fff;
}

.gb-countdown {
	margin: 1rem 0 1.25rem;
	padding: 1rem;
	border-radius: var(--gb-radius);
	background: var(--gb-surface);
	text-align: center;
}

.gb-countdown__label {
	display: block;
	color: var(--gb-muted);
	font-size: 0.8125rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.gb-countdown__value {
	display: block;
	margin-top: 0.25rem;
	font-size: 2.75rem;
	font-weight: 700;
	line-height: 1.1;
	/* Tabular figures stop the layout jittering as the seconds tick. */
	font-variant-numeric: tabular-nums;
}

.gb-countdown.is-low .gb-countdown__value {
	color: var(--gb-warn);
}

.gb-details {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.4rem 1rem;
	margin: 0;
	padding-top: 0.75rem;
	border-top: 1px solid var(--gb-line);
}

.gb-details dt {
	color: var(--gb-muted);
	font-size: 0.9375rem;
}

.gb-details dd {
	margin: 0;
	font-weight: 600;
	text-align: right;
	overflow-wrap: anywhere;
}

.gb-ref {
	font-size: 0.75rem;
	font-weight: 400;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.gb-spinner {
	width: 2rem;
	height: 2rem;
	margin: 0 auto 0.75rem;
	border: 3px solid var(--gb-line);
	border-top-color: var(--gb-brand);
	border-radius: 50%;
	animation: gb-spin 0.9s linear infinite;
}

@keyframes gb-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.gb-spinner {
		animation-duration: 3s;
	}
}

.gb-sim-form {
	margin-top: 1rem;
}

/* ------------------------------------------------------- MobilePay Box */

.gb-amount-callout {
	margin: 0 0 1.25rem;
	padding: 1rem;
	border-radius: var(--gb-radius);
	background: var(--gb-canvas);
	text-align: center;
}

.gb-amount-callout__label {
	display: block;
	color: var(--gb-muted);
	font-size: 0.8125rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.gb-amount-callout__value {
	display: block;
	margin-top: 0.15rem;
	font-size: 2.25rem;
	font-weight: 700;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.gb-steps {
	margin: 0 0 1.25rem;
	padding-left: 1.25rem;
}

.gb-steps li {
	margin-bottom: 0.35rem;
}

.gb-box-qr {
	display: flex;
	justify-content: center;
	margin: 1rem 0;
}

.gb-box-qr img {
	width: 12rem;
	height: 12rem;
	/* A QR must sit on white to scan reliably, even in dark mode. */
	padding: 0.5rem;
	background: #fff;
	border-radius: 8px;
}

.gb-box-number {
	margin: 0.75rem 0;
	padding: 0.75rem;
	border: 2px dashed var(--gb-line);
	border-radius: 10px;
	text-align: center;
}

.gb-box-number__label {
	display: block;
	color: var(--gb-muted);
	font-size: 0.8125rem;
}

.gb-box-number__value {
	display: block;
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: 0.03em;
}

.gb-box-form {
	margin-top: 1.25rem;
}

.gb-note--warn {
	padding: 0.75rem 0.9rem;
	border-radius: 10px;
	background: var(--gb-expired-bg);
	color: var(--gb-expired);
}

/* ------------------------------------------------------------ dark mode */

@media (prefers-color-scheme: dark) {
	.gb-wrap {
		--gb-ink: #eef4f8;
		--gb-muted: #a3b3c0;
		--gb-line: #2c3b47;
		--gb-surface: #16232d;
		--gb-canvas: #0f1a22;
		--gb-brand: #4aa3dd;
		--gb-brand-ink: #05202f;
		--gb-ok: #4cc38a;
		--gb-ok-bg: #122b21;
		--gb-warn: #f5836a;
		--gb-warn-bg: #2e1a16;
		--gb-expired: #e0be62;
		--gb-expired-bg: #2b2415;
	}
}
