/*--------------------------------------------------------------
# Book Travel — Member Card
# Member pricing as an upgrade: the black member card slides in
# over the white standard one, and each price counts down to the
# member rate with the saving tagged beside it.
--------------------------------------------------------------*/

/* ── Section ──
   Bottom padding only: .bt-claim above supplies the gap over this (or
   .bt-process, while the baggage claim is hidden), and .bt-lie-flat below has
   no top padding, so this section's bottom padding is the gap above it. Steps
   100 / 80 / 72 / 56px, like the rest of the page.
   overflow-x: clip stops the member card, waiting off to the right, from
   widening the page, and trims nothing that's on screen. */
.bt-member-card {
	/* The theme loads no monospace font; the same system stack the other
	   concept-built sections use. */
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
	--spring: cubic-bezier(0.34, 1.56, 0.64, 1);
	--ease: cubic-bezier(0.22, 1, 0.36, 1);

	background: var(--tpp-white);
	padding: 0 0 100px;
	overflow-x: clip;
}

.bt-member-card__container {
	width: 100%;
	max-width: var(--tpp-container-max);
	margin: 0 auto;
	padding: 0 var(--tpp-container-padding);
}

.bt-member-card__heading {
	text-align: center;
	font-family: var(--tpp-font-heading);
	font-size: clamp(2rem, 4.5vw + 0.5rem, 3.5rem);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.03em;
	color: var(--tpp-black);
	margin: 0 0 20px;
}

/* The condition, set as a quiet pill so it reads as the terms of the claim
   above it rather than as more pitch (the membership section's treatment). */
.bt-member-card__terms {
	display: block;
	width: fit-content;
	max-width: 100%;
	margin: 0 auto 48px;
	padding: 7px 16px;
	border: 1px solid var(--tpp-border);
	border-radius: var(--tpp-radius-pill);
	font-family: var(--tpp-font-body);
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.5;
	text-align: center;
	color: var(--tpp-text);
}

.bt-member-card__layout {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	gap: 64px;
	align-items: center;
	max-width: 1000px;
	margin: 0 auto;
}


/* ──────────────────────────────────────────────
   The cards
   ────────────────────────────────────────────── */

.bt-member-card__stage {
	position: relative;
	width: min(100%, 440px);
	aspect-ratio: 1.586;
	margin: 24px auto;
}

/* Sized off each card's own width (cqi), with px fallbacks first */
.bt-member-card__face {
	position: absolute;
	inset: 0;
	overflow: hidden;
	border-radius: 22px;
	container-type: inline-size;
	transition:
		transform 0.9s var(--spring),
		opacity 0.5s ease,
		filter 0.5s ease;
}

.bt-member-card__face--std {
	background: linear-gradient(135deg, #FFFFFF, #F1EFEA 60%, #E6E2DA);
	color: var(--tpp-black);
	box-shadow:
		0 0 0 1px var(--tpp-border),
		0 30px 50px -30px rgba(0, 0, 0, 0.35);
}

/* The member card waits off to the right... */
.bt-member-card__face--mem {
	opacity: 0;
	color: #EDEDED;
	background:
		repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 3px),
		radial-gradient(130% 100% at 0 0, #3B3B3B, #171717 55%, #0E0E0E);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.12),
		0 44px 70px -36px rgba(0, 0, 0, 0.6);
	transform: translateX(115%) rotate(10deg);
}

/* ...and slides in over the standard one, which steps back behind it */
.bt-member-card.is-member .bt-member-card__face--mem {
	opacity: 1;
	transform: none;
}

.bt-member-card.is-member .bt-member-card__face--std {
	filter: brightness(0.94);
	transform: translate(-9%, -7%) rotate(-7deg) scale(0.94);
}

.bt-member-card__tier {
	position: absolute;
	left: 8%;
	top: 11%;
	font-family: var(--mono);
	font-size: 12px;
	font-size: 2.8cqi;
	font-weight: 700;
	letter-spacing: 0.22em;
	text-transform: uppercase;
}

.bt-member-card__face--mem .bt-member-card__tier {
	color: var(--tpp-accent);
}

.bt-member-card__mark {
	position: absolute;
	right: 7%;
	top: 9%;
	width: 9%;
	height: auto;
	opacity: 0.5;
	transform: rotate(45deg);
}

.bt-member-card__face--mem .bt-member-card__mark {
	color: var(--tpp-accent);
	opacity: 1;
}

.bt-member-card__chip {
	position: absolute;
	left: 8%;
	top: 36%;
	width: 13%;
	aspect-ratio: 1.35;
	border-radius: 6px;
	background: linear-gradient(135deg, #ECECEC, #A7A7A7);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.bt-member-card__chip::before {
	content: '';
	position: absolute;
	inset: 26% 0;
	border-top: 1px solid rgba(0, 0, 0, 0.2);
	border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.bt-member-card__chip::after {
	content: '';
	position: absolute;
	inset: 0 34%;
	border-left: 1px solid rgba(0, 0, 0, 0.2);
	border-right: 1px solid rgba(0, 0, 0, 0.2);
}

.bt-member-card__digits {
	position: absolute;
	left: 8%;
	bottom: 28%;
	font-family: var(--mono);
	font-size: 17px;
	font-size: 4.2cqi;
	letter-spacing: 0.16em;
	white-space: nowrap;
	opacity: 0.7;
}

.bt-member-card__name {
	position: absolute;
	left: 8%;
	bottom: 10%;
	font-family: var(--mono);
	font-size: 12px;
	font-size: 2.7cqi;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}


/* ──────────────────────────────────────────────
   The prices
   ────────────────────────────────────────────── */

/* Two classes on the button rules: style.css styles every <button>, its
   :hover and its :focus, at up to one class plus an element. */
.bt-member-card__toggle {
	display: flex;
	width: max-content;
	max-width: 100%;
	padding: 5px;
	border-radius: var(--tpp-radius-pill);
	background: var(--tpp-off-white);
	box-shadow: inset 0 0 0 1px var(--tpp-border-light);
}

.bt-member-card .bt-member-card__toggle button {
	margin: 0;
	padding: 10px 20px;
	border: 0;
	border-radius: var(--tpp-radius-pill);
	background: transparent;
	color: var(--tpp-text-light);
	font-family: var(--tpp-font-body);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	transition: background 0.25s ease, color 0.25s ease;
}

.bt-member-card .bt-member-card__toggle button:not([aria-pressed="true"]):hover {
	color: var(--tpp-black);
}

.bt-member-card .bt-member-card__toggle button[aria-pressed="true"] {
	background: var(--tpp-black);
	color: var(--tpp-white);
}

.bt-member-card .bt-member-card__toggle button:focus-visible {
	outline: 2px solid var(--tpp-black);
	outline-offset: 2px;
}

.bt-member-card__prices {
	margin: 24px 0 0;
}

.bt-member-card__prices div {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 16px;
	padding: 14px 0;
	border-top: 1px solid var(--tpp-border);
}

.bt-member-card__prices div:last-child {
	border-bottom: 1px solid var(--tpp-border);
}

.bt-member-card__prices dt {
	font-family: var(--tpp-font-body);
	font-size: 0.9375rem;
	font-weight: 400;
	color: var(--tpp-text);
}

/* row-reverse: the price comes first in the markup, the tag shows first */
.bt-member-card__prices dd {
	display: flex;
	flex-direction: row-reverse;
	align-items: baseline;
	gap: 10px;
	margin: 0;
}

.bt-member-card__val {
	min-width: 4ch;
	font-family: var(--tpp-font-heading);
	font-size: 1.375rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	text-align: right;
	font-variant-numeric: tabular-nums;
	color: var(--tpp-black);
}

/* The saving. Hidden from everyone (visibility, not just opacity) while the
   non-member prices show, so a screen reader doesn't read it there either.
   It goes quickly, and arrives once the count is nearly done. */
.bt-member-card__save {
	padding: 2px 8px;
	border-radius: var(--tpp-radius-pill);
	background: var(--tpp-accent);
	color: var(--tpp-black);
	font-family: var(--mono);
	font-size: 0.6875rem;
	font-weight: 700;
	line-height: 1.6;
	letter-spacing: 0.06em;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transform: translateX(6px);
	transition:
		opacity 0.25s ease,
		transform 0.25s ease,
		visibility 0s linear 0.25s;
}

.bt-member-card.is-member .bt-member-card__save {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition:
		opacity 0.4s ease 0.5s,
		transform 0.4s var(--ease) 0.5s,
		visibility 0s linear 0s;
}

/* While js/book-travel-member-card.js rewinds the section to non-member at
   load, nothing animates: the upgrade should only play once, in view. */
.bt-member-card.is-rewinding .bt-member-card__face,
.bt-member-card.is-rewinding .bt-member-card__save {
	transition: none;
}

.bt-member-card__desc {
	margin: 18px 0 0;
	font-family: var(--tpp-font-body);
	font-size: 0.875rem;
	line-height: 1.6;
	color: var(--tpp-text-light);
}

/* Owen's figure (task E38): the "90%" set large beside his sentence, under
   a hairline so it reads as a fact, not more fine print. */
.bt-member-card__stat {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin: 16px 0 0;
	padding: 14px 0 0;
	border-top: 1px solid var(--tpp-border-light);
	font-family: var(--tpp-font-body);
	font-size: 0.875rem;
	line-height: 1.55;
	color: var(--tpp-text);
}

.bt-member-card__stat b {
	flex: none;
	font-family: var(--tpp-font-heading);
	font-size: 1.625rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.03em;
	color: var(--tpp-black);
}


/* ── CTA ──
   The page's black pill (.bt-pricing__cta). Colour restated for every link
   state: style.css sets :visited, :hover, :focus and :active to inherit, and
   the hover animation's letters take theirs from here. */
.bt-member-card__actions {
	margin-top: 22px;
}

.bt-member-card__cta,
.bt-member-card__cta:visited,
.bt-member-card__cta:hover,
.bt-member-card__cta:focus,
.bt-member-card__cta:active {
	color: var(--tpp-white);
}

.bt-member-card__cta {
	padding: 14px 30px;
	font-size: 0.9375rem;
	border-radius: var(--tpp-radius-pill);
	background: var(--tpp-black);
	border: 1.5px solid var(--tpp-black);
}

.bt-member-card__cta:hover,
.bt-member-card__cta:focus-visible {
	background: var(--tpp-dark);
	border-color: var(--tpp-dark);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}


/* ──────────────────────────────────────────────
   Scroll-reveal
   .is-visible comes from js/book-travel-member-card.js
   ────────────────────────────────────────────── */

.bt-member-card__heading,
.bt-member-card__terms,
.bt-member-card__layout {
	opacity: 0;
	transform: translateY(24px);
	transition:
		opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.bt-member-card.is-visible .bt-member-card__heading,
.bt-member-card.is-visible .bt-member-card__terms,
.bt-member-card.is-visible .bt-member-card__layout {
	opacity: 1;
	transform: none;
}

.bt-member-card.is-visible .bt-member-card__terms {
	transition-delay: 0.08s;
}

.bt-member-card.is-visible .bt-member-card__layout {
	transition-delay: 0.16s;
}


/* ──────────────────────────────────────────────
   Responsive
   ────────────────────────────────────────────── */

/* Tablet (≤991px) — the cards above the prices */
@media screen and (max-width: 991px) {
	.bt-member-card {
		padding: 0 0 80px;
	}

	.bt-member-card__layout {
		grid-template-columns: 1fr;
		gap: 32px;
	}

	.bt-member-card__panel {
		width: 100%;
		max-width: 520px;
		margin: 0 auto;
	}
}

/* Mobile (≤767px) */
@media screen and (max-width: 767px) {
	.bt-member-card {
		padding: 0 0 72px;
	}

	.bt-member-card__heading {
		font-size: clamp(1.75rem, 7vw, 2.5rem);
		margin-bottom: 16px;
	}

	/* Wraps to two lines on a phone, where a full pill radius would pinch
	   the text at both ends. */
	.bt-member-card__terms {
		font-size: 0.75rem;
		padding: 6px 14px;
		border-radius: 14px;
		margin-bottom: 32px;
	}

	/* Narrower than the screen, so the standard card has room to step back
	   to the left without running off it. */
	.bt-member-card__stage {
		width: min(86%, 400px);
	}

	.bt-member-card__cta {
		width: 100%;
	}
}

/* Small mobile (≤480px) */
@media screen and (max-width: 480px) {
	.bt-member-card {
		padding: 0 0 56px;
	}

	.bt-member-card .bt-member-card__toggle button {
		padding: 10px 16px;
		font-size: 0.8125rem;
	}

	.bt-member-card__prices dt {
		font-size: 0.875rem;
	}

	.bt-member-card__val {
		font-size: 1.25rem;
	}
}


/* ──────────────────────────────────────────────
   Reduced motion
   ────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.bt-member-card__heading,
	.bt-member-card__terms,
	.bt-member-card__layout,
	.bt-member-card__face,
	.bt-member-card__save,
	.bt-member-card.is-member .bt-member-card__save,
	.bt-member-card .bt-member-card__toggle button {
		transition: none;
	}
}
