/**
 * Mahjong Event Booking - front-end form.
 * All rules are scoped under .meb-form so themes are unaffected.
 */

.meb-form {
	--meb-pink: #f8467d;
	--meb-pink-soft: #ffd9e5;
	--meb-pink-tint: #fff5f8;
	--meb-ink: #16161a;
	--meb-muted: #8a8a95;
	--meb-line: #ffc2d6;
	--meb-radius: 10px;
	--meb-gap: 28px;

	/*
	 * Shared row rhythm for the payment block. A payment-method box and the
	 * matching card field occupy exactly one row of this height, so the two
	 * columns line up regardless of font or content.
	 */
	--meb-row: 64px;
	--meb-row-gap: 14px;
	--meb-font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--meb-font-display: "Playfair Display", Georgia, "Times New Roman", serif;

	/*
	 * The form fills whatever container it is dropped into. Set
	 * --meb-max-width on .meb-form (or a wrapper) to cap it instead.
	 */
	--meb-max-width: 100%;

	box-sizing: border-box;
	color: var(--meb-ink);
	font-family: var(--meb-font);
	font-size: 15px;
	line-height: 1.5;
	margin: 0 auto;
	max-width: var(--meb-max-width);
	width: 100%;
}

.meb-form *,
.meb-form *::before,
.meb-form *::after {
	box-sizing: inherit;
	font-family: inherit;
}

/* ---------- Headings ---------- */

.meb-heading {
	align-items: center;
	color: var(--meb-pink);
	display: flex;
	font-size: clamp( 26px, 3.4vw, 40px );
	font-weight: 800;
	gap: 12px;
	letter-spacing: 0.01em;
	line-height: 1.15;
	margin: 0 0 32px;
	text-transform: uppercase;
}

.meb-heading__mark {
	color: var(--meb-pink);
	display: block;
	flex: 0 0 auto;
	width: 1em;
}

.meb-heading__mark svg {
	display: block;
	height: auto;
	width: 100%;
}

.meb-form .meb-heading--payment {
	font-family: var(--meb-font-display);
	font-size: clamp( 24px, 2.6vw, 34px );
	font-weight: 800;
	letter-spacing: 0.01em;
	margin-bottom: 26px;
}

.meb-subheading {
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.02em;
	margin: 0 0 16px;
	text-transform: uppercase;
}

.meb-label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	margin-bottom: 10px;
	text-transform: uppercase;
}

/* ---------- Layout ---------- */

.meb-grid {
	display: grid;
	gap: var(--meb-gap);
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
}

.meb-col--notes,
.meb-col--guests {
	display: flex;
	flex-direction: column;
}

/* ---------- Additional persons ---------- */

.meb-persons {
	margin: var(--meb-gap) 0 0;
}

.meb-persons[hidden] {
	display: none;
}

.meb-persons__grid {
	display: grid;
	gap: var(--meb-gap);
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
}

.meb-person[hidden] {
	display: none;
}

.meb-form .meb-persons__title {
	font-family: var(--meb-font);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.3;
	margin: 0 0 14px;
	text-transform: uppercase;
}

/* ---------- Inputs ---------- */

.meb-field {
	margin-bottom: 20px;
}

.meb-field:last-child {
	margin-bottom: 0;
}

.meb-input-wrap {
	align-items: center;
	background: #fff;
	border: 1px solid var(--meb-line);
	border-radius: var(--meb-radius);
	display: flex;
	overflow: hidden;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.meb-input-wrap:focus-within {
	border-color: var(--meb-pink);
	box-shadow: 0 0 0 3px rgba( 248, 70, 125, 0.12 );
}

.meb-input-icon {
	color: var(--meb-pink);
	display: flex;
	flex: 0 0 auto;
	padding: 0 12px 0 16px;
}

.meb-input-icon svg {
	height: 20px;
	width: 20px;
}

.meb-form .meb-input {
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--meb-ink);
	flex: 1 1 auto;
	font-size: 15px;
	min-width: 0;
	outline: 0;
	padding: 14px 16px 14px 0;
	width: 100%;
}

.meb-form .meb-input::placeholder {
	color: var(--meb-muted);
	opacity: 1;
}

.meb-form .meb-input--date::-webkit-calendar-picker-indicator {
	cursor: pointer;
	opacity: 0.55;
}

.meb-input-wrap--select {
	position: relative;
}

.meb-form .meb-input--select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	cursor: pointer;
	padding-right: 44px;
}

.meb-form .meb-input--select:invalid,
.meb-form .meb-input--select option[value=""] {
	color: var(--meb-muted);
}

.meb-form .meb-input--select option {
	color: var(--meb-ink);
}

.meb-input-caret {
	color: var(--meb-pink);
	display: flex;
	pointer-events: none;
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY( -50% );
}

.meb-input-caret svg {
	height: 20px;
	width: 20px;
}

/* Custom dropdown (drives the hidden native select) */
.meb-input-wrap--select.meb-is-open {
	border-color: var(--meb-pink);
	box-shadow: 0 0 0 3px rgba( 248, 70, 125, 0.12 );
}

.meb-input-wrap--select.meb-is-open .meb-input-caret {
	transform: translateY( -50% ) rotate( 180deg );
}

.meb-input-wrap--select.meb-has-custom {
	overflow: visible;
}

.meb-input-wrap--select.meb-has-custom .meb-input--select {
	height: 1px;
	left: 0;
	opacity: 0;
	pointer-events: none;
	position: absolute;
	top: 0;
	width: 1px;
}

.meb-form .meb-select-toggle {
	background: transparent;
	border: 0;
	color: var(--meb-muted);
	cursor: pointer;
	flex: 1 1 auto;
	font-family: var(--meb-font);
	font-size: 15px;
	min-width: 0;
	outline: 0;
	overflow: hidden;
	padding: 14px 44px 14px 0;
	text-align: left;
	text-overflow: ellipsis;
	white-space: nowrap;
	width: 100%;
}

.meb-form .meb-select-toggle.meb-has-value {
	color: var(--meb-ink);
}

.meb-select-list {
	background: #fff;
	border: 1px solid var(--meb-line);
	border-radius: var(--meb-radius);
	box-shadow: 0 10px 30px rgba( 248, 70, 125, 0.15 );
	left: 0;
	list-style: none;
	margin: 6px 0 0;
	overflow: hidden;
	padding: 6px;
	position: absolute;
	right: 0;
	top: 100%;
	z-index: 20;
}

.meb-select-list[hidden] {
	display: none;
}

.meb-select-option {
	align-items: center;
	border-radius: calc( var(--meb-radius) - 4px );
	color: var(--meb-ink);
	cursor: pointer;
	display: flex;
	font-family: var(--meb-font);
	font-size: 15px;
	gap: 12px;
	padding: 11px 14px;
	transition: background-color 0.12s ease, color 0.12s ease;
}

.meb-select-option::before {
	background: var(--meb-pink-soft);
	border-radius: 50%;
	content: "";
	flex: 0 0 auto;
	height: 10px;
	transition: background-color 0.12s ease;
	width: 10px;
}

.meb-select-option:hover,
.meb-select-option.meb-is-active {
	background: var(--meb-pink-tint);
	color: var(--meb-pink);
}

.meb-select-option.meb-is-selected {
	background: var(--meb-pink);
	color: #fff;
}

.meb-select-option:hover::before,
.meb-select-option.meb-is-active::before,
.meb-select-option.meb-is-selected::before {
	background: currentColor;
}

.meb-form .meb-textarea {
	background: #fff;
	border: 1px solid var(--meb-line);
	border-radius: var(--meb-radius);
	color: var(--meb-ink);
	flex: 1 1 auto;
	font-family: inherit;
	font-size: 15px;
	min-height: 330px;
	outline: 0;
	padding: 16px 18px;
	resize: vertical;
	width: 100%;
}

.meb-form .meb-textarea:focus {
	border-color: var(--meb-pink);
	box-shadow: 0 0 0 3px rgba( 248, 70, 125, 0.12 );
}

.meb-form .meb-textarea::placeholder {
	color: var(--meb-muted);
	opacity: 1;
}

/* ---------- Guest options ---------- */

/* The guest box fills its column so it ends level with the notes textarea. */
.meb-guests {
	border: 1px solid var(--meb-line);
	border-radius: var(--meb-radius);
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 22px 24px;
}

.meb-guest {
	align-items: flex-start;
	cursor: pointer;
	display: flex;
	flex: 1 1 auto;
	gap: 14px;
	padding: 14px 0;
	position: relative;
}

.meb-guest + .meb-guest {
	border-top: 1px solid rgba( 255, 194, 214, 0.55 );
}

.meb-guest__input {
	height: 1px;
	margin: 0;
	opacity: 0;
	position: absolute;
	width: 1px;
}

.meb-guest__dot {
	background: var(--meb-pink);
	border-radius: 50%;
	flex: 0 0 auto;
	height: 20px;
	margin-top: 2px;
	width: 20px;
}

.meb-guest__text {
	flex: 1 1 auto;
	min-width: 0;
}

.meb-guest__title {
	display: block;
	font-size: 16px;
	font-weight: 600;
}

.meb-guest__desc {
	color: var(--meb-muted);
	display: block;
	font-size: 14px;
	margin-top: 6px;
}

.meb-guest__box {
	border: 1px solid var(--meb-line);
	border-radius: 4px;
	flex: 0 0 auto;
	height: 20px;
	margin-top: 2px;
	position: relative;
	width: 20px;
}

.meb-guest__input:checked ~ .meb-guest__box {
	background: var(--meb-pink);
	border-color: var(--meb-pink);
}

.meb-guest__input:checked ~ .meb-guest__box::after {
	border: solid #fff;
	border-width: 0 2px 2px 0;
	content: "";
	height: 9px;
	left: 6px;
	position: absolute;
	top: 3px;
	transform: rotate( 45deg );
	width: 5px;
}

.meb-guest__input:focus-visible ~ .meb-guest__box {
	box-shadow: 0 0 0 3px rgba( 248, 70, 125, 0.25 );
}

/* ---------- Payment panel ---------- */

.meb-payment {
	background: var(--meb-pink-tint);
	border: 1px solid var(--meb-pink-soft);
	border-radius: 14px;
	margin-top: var(--meb-gap);
	padding: 34px 32px 38px;
}

/*
 * Explicit placement so the pay button sits directly under the method and card
 * columns instead of waiting for the taller summary. The summary spans both
 * rows, which makes it end level with the bottom of the button.
 * Row spacing is done with margins (not row-gap) so the spanned summary lines
 * up exactly with the button rather than stopping a gap short.
 */
.meb-payment__grid {
	align-items: start;
	column-gap: var(--meb-gap);
	display: grid;
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	row-gap: 0;
}

.meb-summary {
	align-self: stretch;
	display: flex;
	flex-direction: column;
	grid-column: 1;
	grid-row: 1 / span 2;
}

.meb-methods {
	grid-column: 2;
	grid-row: 1;
}

.meb-card {
	grid-column: 3;
	grid-row: 1;
}

.meb-payment__actions {
	grid-column: 2 / -1;
	grid-row: 2;
	margin-top: 22px;
}

.meb-secure-note {
	grid-column: 2 / -1;
	grid-row: 3;
}

.meb-summary__table {
	border: 1px solid var(--meb-pink-soft);
	border-radius: var(--meb-radius);
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	overflow: hidden;
}

.meb-summary__row {
	align-items: center;
	background: #fffbfc;
	display: flex;
	flex: 1 1 auto;
	font-size: 15px;
	font-weight: 400;
	gap: 12px;
	justify-content: space-between;
	padding: 18px 20px;
}

.meb-summary__row + .meb-summary__row {
	border-top: 1px solid var(--meb-pink-soft);
}

.meb-summary__row:nth-child( even ) {
	background: #fdeef3;
}

.meb-summary__label {
	min-width: 0;
}

.meb-summary__label--event {
	font-weight: 700;
}

.meb-summary__value {
	flex: 0 0 auto;
	white-space: nowrap;
}

/* ---------- Payment methods ---------- */

.meb-method {
	align-items: center;
	background: #fff;
	border: 1px solid var(--meb-pink-soft);
	border-radius: var(--meb-radius);
	cursor: pointer;
	display: flex;
	gap: 14px;
	margin-bottom: var(--meb-row-gap);
	min-height: var(--meb-row);
	padding: 0 20px;
	position: relative;
	transition: border-color 0.15s ease;
}

.meb-method:last-child {
	margin-bottom: 0;
}

.meb-method:has( .meb-method__input:checked ) {
	border-color: var(--meb-pink);
}

.meb-method__input {
	height: 1px;
	margin: 0;
	opacity: 0;
	position: absolute;
	width: 1px;
}

.meb-method__dot {
	border: 2px solid var(--meb-pink-soft);
	border-radius: 50%;
	flex: 0 0 auto;
	height: 22px;
	position: relative;
	width: 22px;
}

.meb-method__input:checked ~ .meb-method__dot {
	border-color: var(--meb-pink);
}

.meb-method__input:checked ~ .meb-method__dot::after {
	background: var(--meb-pink);
	border-radius: 50%;
	content: "";
	inset: 3px;
	position: absolute;
}

.meb-method__input:focus-visible ~ .meb-method__dot {
	box-shadow: 0 0 0 3px rgba( 248, 70, 125, 0.25 );
}

.meb-method__label {
	flex: 1 1 auto;
	font-size: 16px;
	white-space: nowrap;
}

.meb-brands {
	display: flex;
	flex: 0 1 auto;
	gap: 4px;
	min-width: 0;
}

.meb-brand {
	align-items: center;
	border-radius: 4px;
	color: #fff;
	display: flex;
	flex: 0 0 auto;
	height: 21px;
	justify-content: center;
	overflow: hidden;
	width: 29px;
}

.meb-brand__text {
	font-size: 9px;
	font-weight: 800;
	letter-spacing: 0.02em;
	line-height: 1;
}

.meb-brand--visa {
	background: #1a1f71;
}

.meb-brand--diners {
	background: #0079be;
}

.meb-brand__diners {
	display: flex;
}

.meb-brand__diners i {
	background: #fff;
	border-radius: 50%;
	display: block;
	height: 13px;
	width: 13px;
}

.meb-brand__diners i:last-child {
	margin-left: -6px;
}

.meb-brand--venmo {
	background: #008cff;
}

.meb-brand__venmo {
	font-size: 7.5px;
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1;
	text-transform: lowercase;
}

.meb-brand--amex {
	background: #016fd0;
}

.meb-brand__amex {
	display: flex;
	flex-direction: column;
	line-height: 1.05;
	text-align: center;
}

.meb-brand__amex b {
	font-size: 5px;
	font-weight: 800;
	letter-spacing: 0.02em;
}

.meb-brand--disc {
	background: #f38020;
}

.meb-brand--disc .meb-brand__text {
	font-size: 5.5px;
}

.meb-brand--mc {
	background: #1a1a1a;
}

.meb-brand__mc {
	display: flex;
}

.meb-brand__mc i {
	border-radius: 50%;
	display: block;
	height: 14px;
	width: 14px;
}

.meb-brand__mc i:first-child {
	background: #eb001b;
}

.meb-brand__mc i:last-child {
	background: #f79e1b;
	margin-left: -6px;
	mix-blend-mode: hard-light;
}

/* ---------- Submit ---------- */

.meb-form .meb-submit {
	align-items: center;
	background: var(--meb-pink);
	border: 0;
	border-radius: var(--meb-radius);
	color: #fff;
	cursor: pointer;
	display: flex;
	font-size: 17px;
	font-weight: 800;
	gap: 10px;
	justify-content: center;
	letter-spacing: 0.03em;
	margin: 0;
	padding: 18px 24px;
	text-transform: uppercase;
	transition: background-color 0.15s ease, opacity 0.15s ease;
	width: 100%;
}

.meb-form .meb-submit:hover:not( :disabled ) {
	background: #e33a6f;
}

.meb-form .meb-submit:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

.meb-submit__lock svg {
	display: block;
	height: 17px;
	width: 17px;
}

.meb-paypal-buttons {
	min-height: 1px;
}

.meb-secure-note {
	align-items: center;
	color: var(--meb-muted);
	display: flex;
	font-size: 13px;
	gap: 7px;
	justify-content: center;
	margin: 14px 0 0;
}

.meb-secure-note svg {
	display: block;
	height: 14px;
	width: 14px;
}

/* ---------- Card panel ---------- */

/*
 * Each card field fills one --meb-row band: the small label sits at the top of
 * the band and the input fills the rest, so Card Number lines up with the first
 * payment-method box and the Expiry/CVC pair with the second.
 */
.meb-card__field {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	margin-bottom: var(--meb-row-gap);
	min-height: var(--meb-row);
}

.meb-card__field:last-child {
	margin-bottom: 0;
}

.meb-card__label {
	display: block;
	flex: 0 0 auto;
	font-size: 13px;
	font-weight: 400;
	line-height: 20px;
	margin: 0 0 4px;
}

.meb-card__row {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	margin-bottom: 0;
}

.meb-card__row .meb-card__field {
	margin-bottom: 0;
}

/*
 * Fixed height: Stripe sizes its own iframe, and letting that drive the row
 * would knock the Expiry/CVC row out of line with the PayPal box.
 * 20px label + 4px gap + 40px input == --meb-row.
 */
.meb-stripe-element {
	align-items: center;
	background: #fff;
	border: 1px solid var(--meb-pink-soft);
	border-radius: var(--meb-radius);
	display: flex;
	flex: 0 0 auto;
	gap: 10px;
	height: 40px;
	padding: 6px 16px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Stripe injects an iframe that needs a definite width to lay out. */
.meb-stripe-element__mount {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
}

.meb-stripe-element__icon {
	align-items: center;
	color: #9aa3b2;
	display: flex;
	flex: 0 0 auto;
}

.meb-stripe-element__icon svg {
	height: 20px;
	width: 20px;
}

.meb-stripe-element--cvc .meb-stripe-element__icon {
	cursor: help;
}

.meb-stripe-element.meb-stripe-element--focus {
	border-color: var(--meb-pink);
	box-shadow: 0 0 0 3px rgba( 248, 70, 125, 0.12 );
}

.meb-card__unavailable {
	color: var(--meb-muted);
	font-size: 14px;
}

/* ---------- Messaging ---------- */

.meb-notice {
	border-radius: var(--meb-radius);
	font-size: 14px;
	margin-bottom: 20px;
	padding: 14px 18px;
}

.meb-notice--error {
	background: #fff0f2;
	border: 1px solid #f5b5c0;
	color: #a11834;
}

.meb-field-error {
	color: #c1123a;
	font-size: 13px;
	margin: 6px 0 0;
	min-height: 0;
}

.meb-field-error:empty {
	display: none;
}

.meb-input-wrap.meb-has-error,
.meb-stripe-element.meb-has-error {
	border-color: #d3315c;
}

.meb-form.meb-is-busy {
	opacity: 0.75;
	pointer-events: none;
}

/* ---------- Success ---------- */

.meb-success {
	background: var(--meb-pink-tint);
	border: 1px solid var(--meb-pink-soft);
	border-radius: 14px;
	padding: 48px 32px;
	text-align: center;
}

.meb-success__check {
	align-items: center;
	background: var(--meb-pink);
	border-radius: 50%;
	color: #fff;
	display: inline-flex;
	font-size: 30px;
	height: 62px;
	justify-content: center;
	margin-bottom: 18px;
	width: 62px;
}

.meb-success__title {
	color: var(--meb-pink);
	font-size: 26px;
	margin: 0 0 10px;
	text-transform: uppercase;
}

.meb-success__message {
	font-size: 16px;
	margin: 0 0 8px;
}

.meb-success__ref {
	color: var(--meb-muted);
	font-size: 15px;
	margin: 0;
}

/* ---------- Responsive ---------- */

@media ( max-width: 1100px ) {
	.meb-grid,
	.meb-persons__grid,
	.meb-payment__grid {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}

	/* Stacked: drop the explicit placement and go back to gap-based spacing. */
	.meb-payment__grid {
		row-gap: 22px;
	}

	.meb-summary,
	.meb-methods,
	.meb-card,
	.meb-payment__actions,
	.meb-secure-note {
		grid-column: auto;
		grid-row: auto;
	}

	.meb-summary {
		align-self: start;
	}

	.meb-payment__actions {
		margin-top: 0;
	}

	/* row-gap already spaces the note here. */
	.meb-secure-note {
		margin-top: 0;
	}

	.meb-col--notes,
	.meb-card,
	.meb-payment__actions,
	.meb-secure-note {
		grid-column: 1 / -1;
	}

	.meb-form .meb-textarea {
		min-height: 160px;
	}
}

@media ( max-width: 782px ) {
	.meb-form {
		--meb-gap: 20px;
	}

	.meb-grid,
	.meb-persons__grid,
	.meb-payment__grid {
		grid-template-columns: minmax( 0, 1fr );
	}

	.meb-payment {
		padding: 24px 18px 28px;
	}

	.meb-brands {
		display: none;
	}
}
