/*
 * Memoryroom — booking form + WhatsApp button.
 * Scoped under .mm-book / .mm-wa so it cannot leak into the rest of the site.
 * Shares the landing page's brand tokens — near-black canvas, champagne accent,
 * burgundy primary action, Newsreader display and Instrument Sans body — so the
 * booking page cannot drift away from the site again.
 *
 * Architecture: an editorial column on the left, the form on the right, and the
 * form sitting inside a double bezel — an outer shell with its own surface and
 * hairline, an inner core holding the fields. The curves are concentric:
 * core radius = panel radius − panel padding.
 */

/* ------------------------------------------------------------------ *
 * Booking page shell: a branded bar so a blank-canvas page still has
 * a way back to the landing page.
 * ------------------------------------------------------------------ */

.mm-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	padding: 1.1rem 3rem;
	background: var(--memory-black, #161616);
	border-bottom: 1px solid rgba(183, 146, 94, 0.25);
	font-family: var(--font-body, 'Instrument Sans'), -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.mm-top__brand {
	font-size: 1.6rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1;
	text-decoration: none;
}

.mm-top__a {
	color: var(--memory-white, #FFFFFF);
}

.mm-top__b {
	color: var(--memory-champagne, #B7925E);
}

.mm-top__back {
	color: #C9C3B8;
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-decoration: none;
}

.mm-top__back:hover {
	color: var(--memory-champagne, #B7925E);
}

/* Room for the form on a blank canvas. min-height keeps the near-black canvas
   covering the viewport even when the form is short. A very soft champagne wash
   from the top-left gives the flat black some depth without becoming a gradient
   backdrop. */
/* Motion tokens live on :root because the floating WhatsApp button is rendered
   outside .mm-book-page and has to resolve the same curve. */
:root {
	--mm-ease: cubic-bezier(0.32, 0.72, 0, 1);
	--mm-dur: 220ms;
	--mm-dur-enter: 760ms;
}

.mm-book-page {
	background:
		radial-gradient(120% 90% at 12% 0%, rgba(183, 146, 94, 0.10) 0%, rgba(183, 146, 94, 0) 58%),
		var(--memory-black, #161616);
	min-height: 100vh;
	padding: 0 1.5rem 7rem;
}

@media (max-width: 767px) {
	.mm-top {
		padding: 0.9rem 1.25rem;
	}
	.mm-top__brand {
		font-size: 1.25rem;
	}
	.mm-book-page {
		padding: 0 1rem 4rem;
	}
}

.mm-book {
	--mm-accent: var(--memory-champagne, #B7925E);
	--mm-accent-text: #D4B37C; /* lighter tint: #B7925E is only 3.9:1 on dark */
	--mm-burgundy: var(--memory-burgundy, #5F1826);
	--mm-ivory: var(--memory-ivory, #F9F6EF);
	--mm-surface: #19191a;
	--mm-line: rgba(183, 146, 94, 0.22);
	--mm-field-line: rgba(255, 255, 255, 0.12);
	--mm-muted: #B4AEA4;
	--mm-text: #E8E2D8;

	display: grid;
	grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
	column-gap: clamp(2.5rem, 5vw, 5.5rem);
	align-items: start;
	max-width: 76rem;
	margin: 4.5rem auto 0;
	font-family: var(--font-body, 'Instrument Sans'), -apple-system, 'Segoe UI', Roboto, sans-serif;
	color: var(--mm-text);
}

/* Sticks beside the field being filled in instead of scrolling away. */
.mm-book__intro {
	position: sticky;
	top: 2.5rem;
}

/* Outer shell of the bezel: its own surface, its own hairline, its own radius. */
.mm-book__panel {
	background: rgba(255, 255, 255, 0.035);
	border: 1px solid rgba(183, 146, 94, 0.16);
	border-radius: 32px;
	padding: 0.5rem;
	box-shadow: 0 44px 90px -56px rgba(0, 0, 0, 0.95);
}

/* Inner core: its own surface, its own top highlight, and a radius of
   panel radius − panel padding so the two curves stay concentric
   (32 − 8 = 24). */
.mm-book__core {
	background: var(--mm-surface);
	border-radius: 24px;
	padding: 2.25rem;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

/* Collapse rules sit AFTER the desktop declarations on purpose. Same specificity
   and an earlier position would lose the cascade and leave two columns on a
   phone, which is exactly what happened the first time. */

/* The split only earns its keep when there is width for two columns. Below this
   the editorial column stacks above the form, which is also the reading order. */
@media (max-width: 980px) {
	.mm-book {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 2.5rem;
		margin-top: 3rem;
	}

	.mm-book__intro {
		position: static;
	}
}

@media (max-width: 560px) {
	.mm-book__panel {
		border-radius: 24px;
	}

	.mm-book__core {
		/* 24 − 8, staying concentric */
		border-radius: 18px;
		padding: 1.25rem;
	}
}

.mm-book__title {
	font-family: var(--font-display, 'Newsreader'), Georgia, serif;
	font-size: clamp(2.4rem, 4.4vw, 3.9rem);
	font-weight: 500;
	line-height: 1.06;
	letter-spacing: -0.022em;
	color: var(--memory-white, #FFFFFF);
	margin: 0 0 1.1rem;
	text-wrap: balance;
}

/* 46ch keeps the lead inside the 65–75ch body measure once it is read at the
   column's own width; the column itself does the rest of the constraining. */
.mm-book__sub {
	font-size: 1.05rem;
	line-height: 1.7;
	color: var(--mm-muted);
	margin: 0;
	max-width: 46ch;
	text-wrap: pretty;
}

.mm-book__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.25rem 1.5rem;
}

.mm-extras {
	border: 0;
	margin: 1.5rem 0 0;
	padding: 0;
	min-width: 0;
}

.mm-extras legend {
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--mm-muted);
	margin-bottom: 0.7rem;
}

.mm-extras__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem 1rem;
}

.mm-extra {
	box-sizing: border-box;
	min-width: 0;
	padding: 0.8rem;
	border: 1px solid var(--mm-field-line);
	border-radius: 12px;
	background: #121212;
}

.mm-extras__summary {
	white-space: pre-line;
}

.mm-field {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	min-width: 0;
}

.mm-field--wide {
	grid-column: 1 / -1;
}

.mm-field label {
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--mm-muted);
}

.mm-field__req {
	color: var(--mm-accent-text);
}

.mm-field input,
.mm-field select,
.mm-field textarea {
	width: 100%;
	box-sizing: border-box;
	background: #121212;
	border: 1px solid var(--mm-field-line);
	border-radius: 12px;
	color: var(--mm-text);
	font-family: inherit;
	font-size: 1rem;
	padding: 0.9rem 1rem;
	transition: border-color var(--mm-dur) var(--mm-ease),
		box-shadow var(--mm-dur) var(--mm-ease);
}

.mm-field textarea {
	resize: vertical;
	min-height: 7rem;
}

.mm-field input::placeholder,
.mm-field textarea::placeholder {
	color: #8A857D;
}

.mm-field input:focus,
.mm-field select:focus,
.mm-field textarea:focus {
	outline: none;
	border-color: var(--mm-accent);
	box-shadow: inset 0 0 0 1px var(--mm-accent), 0 0 0 4px rgba(183, 146, 94, 0.18);
}

/* One icon system. The accordion chevron on the landing pages is a 1.6px round
   -capped stroke, so the select uses the same stroke rather than a pair of
   filled gradient triangles. */
.mm-field select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23B7925E' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-position: calc(100% - 1.15rem) 50%;
	background-size: 12px 8px;
	background-repeat: no-repeat;
	padding-right: 3rem;
}

/* Native date/time pickers render dark-on-dark otherwise. */
.mm-field input[type="date"],
.mm-field input[type="time"] {
	color-scheme: dark;
}

.mm-field input[aria-invalid="true"],
.mm-field select[aria-invalid="true"],
.mm-field textarea[aria-invalid="true"] {
	border-color: #ff5a5a;
}

/* Honeypot: off-screen for people, still reachable by bots. */
.mm-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Explicit consent checkbox. */
.mm-consent {
	margin-top: 1.5rem;
}

.mm-check {
	display: flex;
	align-items: flex-start;
	gap: 0.7rem;
	font-size: 0.92rem;
	line-height: 1.6;
	color: var(--mm-muted);
	cursor: pointer;
}

.mm-check input[type="checkbox"] {
	flex: 0 0 auto;
	width: 1.15rem;
	height: 1.15rem;
	margin: 0.15rem 0 0;
	accent-color: #B7925E;
	cursor: pointer;
}

.mm-check a {
	color: var(--mm-accent-text);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.mm-check a:hover {
	color: var(--memory-white, #FFFFFF);
}

.mm-check input[aria-invalid="true"] {
	outline: 2px solid #ff5a5a;
	outline-offset: 2px;
}

.mm-book__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
	margin-top: 2rem;
}

.mm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	box-sizing: border-box;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none;
	padding: 1.1rem 2.5rem;
	/* Squared corners are the brand's button language on the landing pages;
	   switching to pills here would make the two pages disagree. */
	border-radius: 0;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background-color var(--mm-dur) var(--mm-ease),
		color var(--mm-dur) var(--mm-ease),
		border-color var(--mm-dur) var(--mm-ease),
		transform var(--mm-dur) var(--mm-ease);
}

/* The button gives under the finger. Cheapest honest way to make a control feel
   like an object rather than a rectangle that changes colour. */
.mm-btn:active:not(:disabled) {
	transform: scale(0.98);
}

/* Matches the landing page buttons: burgundy fill, champagne on hover. */
.mm-btn--primary {
	background: var(--mm-burgundy);
	color: var(--memory-white, #FFFFFF);
}

.mm-btn--primary:hover:not(:disabled) {
	background: var(--mm-accent);
	color: var(--memory-black, #161616);
}

.mm-btn--primary:disabled {
	opacity: 0.6;
	cursor: progress;
}

/* Loading and success share the disabled shape, but a spin is the only thing on
   this page that loops, so it stays short and honours reduced motion. */
.mm-btn--primary:disabled::before {
	content: "";
	width: 0.9em;
	height: 0.9em;
	border-radius: 50%;
	border: 1.6px solid currentColor;
	border-top-color: transparent;
	animation: mm-spin 700ms linear infinite;
}

@keyframes mm-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.mm-btn--primary:disabled::before {
		animation: none;
	}
}

.mm-btn--ghost {
	background: transparent;
	color: var(--mm-text);
	border-color: rgba(183, 146, 94, 0.45);
}

.mm-btn--ghost:hover {
	border-color: var(--mm-accent);
	color: var(--mm-accent-text);
}

.mm-book__note {
	font-size: 0.88rem;
	line-height: 1.6;
	color: var(--mm-muted);
	margin: 1.25rem 0 0;
}

.mm-book__status {
	margin: 1.25rem 0 0;
	font-size: 0.98rem;
	line-height: 1.6;
	min-height: 1.6em;
	white-space: pre-line;
}

.mm-book__status.is-error {
	color: #ff8a8a;
}

.mm-book__status.is-success {
	color: var(--mm-accent-text);
}

/* Standing message above the form — the result of a trip to Stripe.
   A thick strip down one edge is the most recognisable tell of an assembled
   UI, so the whole box carries the accent instead: a hairline border on every
   side, the accent tinted into the surface, and the card radius. */
.mm-book__alert {
	margin: 0 0 1.75rem;
	padding: 1rem 1.25rem;
	border: 1px solid rgba(183, 146, 94, 0.34);
	border-radius: 12px;
	background: rgba(183, 146, 94, 0.08);
	font-size: 0.98rem;
	line-height: 1.6;
}

.mm-book__alert.is-error {
	border-color: rgba(255, 138, 138, 0.42);
	background: rgba(255, 138, 138, 0.08);
}

/* Amount about to be charged, kept next to the button that charges it. */
.mm-book__deposit {
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--mm-text);
	margin: 1.25rem 0 0;
}

.mm-book__deposit strong {
	color: var(--mm-accent-text);
}

.mm-book__deposit[hidden] {
	display: none;
}

/* ------------------------------------------------------------------ *
 * Floating WhatsApp button
 * ------------------------------------------------------------------ */

.mm-wa {
	position: fixed;
	right: 1.5rem;
	bottom: 1.5rem;
	z-index: 900;
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	background: var(--memory-champagne, #B7925E);
	color: var(--memory-black, #161616);
	font-family: var(--font-body, 'Instrument Sans'), -apple-system, 'Segoe UI', Roboto, sans-serif;
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-decoration: none;
	padding: 0.85rem 1.25rem;
	border-radius: 999px;
	box-shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.9);
	transition: transform var(--mm-dur) var(--mm-ease),
		background-color var(--mm-dur) var(--mm-ease);
}

/* Pressed under the finger, like the form's buttons. */
.mm-wa:active {
	transform: scale(0.98);
}

.mm-wa:hover {
	background: var(--memory-ivory, #F9F6EF);
	transform: translateY(-2px);
}

.mm-wa svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
	flex: 0 0 auto;
}

.mm-wa__label {
	white-space: nowrap;
}

@media (max-width: 767px) {
	.mm-book__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.mm-extras__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.mm-btn {
		width: 100%;
		text-align: center;
		padding: 1rem 1.5rem;
	}

	.mm-wa {
		right: 1rem;
		bottom: 1rem;
		padding: 0.75rem;
	}

	.mm-wa__label {
		display: none;
	}
}

/* ------------------------------------------------------------------ *
 * Entry
 * ------------------------------------------------------------------ */

/* The editorial column and the panel resolve into place instead of appearing
   already there. Transform and opacity only: a blur would repaint a large area
   on every frame, which is exactly what makes a heavy fade-up stutter on a
   phone. Gated on html.mm-motion, the same switch the marketing pages use —
   with no JS, no IntersectionObserver, or reduced motion set, the page is
   static and fully visible. The script also arms a failsafe timeout. */
@media (prefers-reduced-motion: no-preference) {
	html.mm-motion .mm-book__intro > *,
	html.mm-motion .mm-book__panel {
		opacity: 0;
		transform: translateY(18px);
		transition: opacity var(--mm-dur-enter) var(--mm-ease),
			transform var(--mm-dur-enter) var(--mm-ease);
	}

	/* The panel trails the title by a beat so the eye lands on the words first,
	   which is the order they should be read in. */
	html.mm-motion .mm-book__intro > *:nth-child(2) {
		transition-delay: 90ms;
	}

	html.mm-motion .mm-book__panel {
		transition-delay: 60ms;
	}

	html.mm-motion .mm-book__intro > [data-mm-visible],
	html.mm-motion .mm-book__panel[data-mm-visible] {
		opacity: 1;
		transform: none;
	}
}
