/* What the booking checkout adds to the shell: the booking form arranged in it, ticket steppers, the details fields and their errors, the hold line and coupon field in the summary, and the confirmation. The booking card that opens it is styled in the main stylesheet (partials/_booking-card.scss). */

#{$root} {

	/* The booking form in the checkout (placeholders/bookingform.php in forms/bookingform/booking-checkout.php). Its wrapper and form leave their sections to the main column, which stacks them each as wide as the column, and its summary section is the summary rail: beside the column on wide screens, under the toggle on a phone. */

	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner {
		display: flex;
		flex-direction: column;
		width: 100%;
		max-width: none;
		margin: 0;
		padding-left: 0;
		padding-right: 0;
	}

	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-event-booking-form,
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-form > .em-event-booking-form,
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-event-booking-form > form.em-booking-form,
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-form > .em-event-booking-form > form.em-booking-form {
		display: contents !important;
	}

	// the booking form's wrapper is an .em component of its own, which would set the site's type again inside the checkout
	.em {
		--font-size: inherit;
		--line-height: inherit;
		--font-family: inherit;
	}

	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-event-booking-form > .em-loading,
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-form > .em-event-booking-form > .em-loading {
		display: none !important;
	}

	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > :not(.em-event-booking-form),
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-event-booking-form > :not(form),
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-form > .em-event-booking-form > :not(form),
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-event-booking-form > form.em-booking-form > :not(.em-booking-form-section-summary),
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-form > .em-event-booking-form > form.em-booking-form > :not(.em-booking-form-section-summary) {
		@include column;
	}

	/* An event booked by date and time: its picker (forms/bookingform/booking-recurring.php or booking-timeslots.php) is a section of the column, and the booking form it loads for the chosen date or time is arranged as any event's, its summary section the rail. The picker's wrappers leave their parts to the column as the booking form's do. */

	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring,
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-form {
		display: contents !important;
	}

	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > :not(.em-booking-recurrence-form):not(.em-booking-recurrence-picker) {
		@include column;
	}

	// the picker's title, the checkout's own for a recurring event and the timeslot template's for an event with timeslots, reads as a section title
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > h3.em-booking-checkout-picker-title,
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > h3.em-booking-form-timeslots-title {
		margin-top: 32px !important;
		margin-bottom: 16px !important;
		border: 0 !important;
		background: none !important;
		color: var(--em-checkout-text-strong) !important;
		font-family: inherit !important;
		font-size: 21px !important;
		font-weight: 600 !important;
		line-height: 1.3 !important;
		letter-spacing: 0 !important;
	}

	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > h3.em-booking-checkout-picker-title + .em-booking-recurring > .em-booking-recurrence-picker,
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > h3.em-booking-form-timeslots-title + .em-booking-recurrence-picker {
		margin-top: 0;
	}

	// the calendar and the chosen day's times in one box, side by side where there is room and the times under the calendar on a phone (the timeslot template's section is a booking form wrapper too, whose parts would otherwise each be a column)
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-picker {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
		align-items: start;
		margin-top: 32px;
		margin-bottom: 0;

		&.mode-calendar {
			@media (min-width: $medium) {
				grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
			}
		}

		// as wide as the column's content, which the column's padding would otherwise put inside the box
		box-sizing: border-box;
		width: calc(100% - 32px);
		max-width: 580px;
		margin-inline: auto;

		@media (min-width: $medium) {
			width: calc(100% - 42px);
		}

		@media (min-width: $wide) {
			width: calc(100% - 76px);
			margin-inline: auto 38px;
		}

		padding: 16px;
		border: 1px solid var(--em-checkout-border);
		border-radius: var(--em-checkout-radius);

		@media (min-width: $medium) {
			padding: 21px;
		}

		.em-view-container[data-view="calendar"] {
			width: 100%;
			max-width: none;
			margin: 0;
		}

		.em-calendar {
			--accent-color: var(--em-checkout-accent);
			margin: 0 !important;
			padding: 0 !important;
			font-size: 14px;

			.em-cal-nav {
				margin-bottom: 8px !important;
			}

			.em-cal-day-dots {
				display: none !important;
			}

			// the rings the calendar script draws around a day in its events' category colors; every date here is the same event, so the accent marks them instead
			.em-cal-day-date .ring {
				display: contents !important;
			}

			.em-cal-body .em-cal-day {
				display: flex;
				align-items: center;
				justify-content: center;
				min-height: 40px;
			}

			.em-cal-day-date {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 36px;
				height: 36px;
				margin: 0 !important;
				border-radius: 50%;
				color: var(--em-checkout-muted);

				a {
					display: flex;
					align-items: center;
					justify-content: center;
					width: 100%;
					height: 100%;
					border-radius: 50%;
					background: var(--em-checkout-accent-tint) !important;
					color: var(--em-checkout-accent) !important;
					font-weight: 600;
					text-decoration: none !important;
				}

				a:hover,
				a:focus-visible {
					box-shadow: inset 0 0 0 1px var(--em-checkout-accent);
				}

				&.selected,
				&.selected a {
					background: var(--em-checkout-accent) !important;
					color: var(--button-primary-color, #fff) !important;
				}
			}

			.eventless-pre .em-cal-day-date,
			.eventless-post .em-cal-day-date {
				opacity: 0.45;
			}
		}

		.em-booking-recurrences {
			gap: 10px;

			h3 {
				margin: 6px 0 4px !important;
				color: var(--em-checkout-text-strong);
				font-family: inherit !important;
				font-size: 15px !important;
				font-weight: 600 !important;
				line-height: 1.4 !important;
			}

			p.em-timezone {
				font-size: 13px;

				label {
					color: var(--em-checkout-muted);
					font-weight: normal;
				}
			}

			p.more-recurrenes {
				margin: 0;
				color: var(--em-checkout-muted);
				font-size: 13px;
				font-style: normal;
			}

			&.selected .em-booking-recurrence:not(.selected) {
				opacity: 1;
			}

			.em-booking-timeslots-list {
				grid-template-columns: minmax(0, 1fr) !important;
			}
		}

		// each time a row: its time, the date when the list spans dates, and the places left at the end
		.em-booking-recurrences .em-booking-recurrence,
		.em-booking-timeslots-list .em-booking-recurrence {
			display: flex !important;
			flex-wrap: wrap;
			align-items: center;
			justify-content: space-between;
			gap: 2px 12px;
			box-sizing: border-box;
			width: 100%;
			min-height: 50px;
			margin: 0 !important;
			padding: 12px 16px !important;
			border: 1px solid var(--em-checkout-border) !important;
			border-radius: var(--em-checkout-radius) !important;
			background: var(--em-checkout-surface) !important;
			color: var(--em-checkout-text) !important;
			font-size: 14px;
			line-height: 1.4;
			text-align: start;
			opacity: 1 !important;
			transform: none !important;
			box-shadow: none !important;

			.em-icon {
				display: none !important;
			}

			.em-booking-recurrence-date {
				flex-basis: 100%;
				order: -1;
				color: var(--em-checkout-muted);
				font-size: 13px;
			}

			.em-booking-recurrence-time {
				font-weight: 500;
			}

			.em-booking-recurrence-spaces {
				color: var(--em-checkout-muted);
				font-size: 13px;
				font-style: normal;
			}

			&:not([disabled]):hover,
			&:not([disabled]):focus-visible {
				border-color: var(--em-checkout-accent) !important;
			}

			&.selected {
				border-color: var(--em-checkout-accent) !important;
				background: var(--em-checkout-accent-tint) !important;
				box-shadow: inset 0 0 0 1px var(--em-checkout-accent) !important;
			}

			&[disabled] {
				background: var(--em-checkout-aside) !important;
				color: var(--em-checkout-muted) !important;
				opacity: 1;
			}
		}
	}

	// an event booked by date alone has one time a date, which loads as soon as the date is chosen, so the calendar takes the box and a date's times show only when it has several, or none that can be booked
	&.em-booking-checkout.picker-date > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-picker.mode-calendar {
		@media (min-width: $medium) {
			grid-template-columns: minmax(0, 1fr);
		}

		.em-booking-recurrences:not(.several) {
			display: none !important;
		}

		.em-view-container[data-view="calendar"] {
			max-width: 400px;
			margin-inline: auto;
		}
	}

	// the booking form of the chosen date and time follows the picker as the column's next sections
	&.em-booking-checkout .em-booking-recurring > .em-booking-recurrence-form {
		margin-top: 0;
	}

	// once booked, the confirmation stands in for the picker as it does for the form
	&.em-booking-checkout.booked > .em-checkout-main > .em-checkout-main-inner > h3.em-booking-checkout-picker-title,
	&.em-booking-checkout.booked > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > :not(.em-booking-recurrence-form) {
		display: none !important;
	}

	// the rail waiting for a date and time gives way to the chosen one's summary section once its booking form is there
	&.em-booking-checkout:has(> .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-form > .em-event-booking-form > form.em-booking-form > .em-booking-form-section-summary) > .em-booking-checkout-pending {
		display: none !important;
	}

	// a banner in place of the form, such as why the event cannot be booked, is as wide as the column's content, which a banner's own margins and padding would otherwise undo
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-checkout-notice {
		width: calc(100% - 32px);
		max-width: 580px;
		margin-inline: auto !important;

		@media (min-width: $medium) {
			width: calc(100% - 42px);
		}
	}

	// without a summary rail the column is centred, as the header and footer are
	&.em-booking-checkout.no-summary > .em-checkout-main > .em-checkout-main-inner > * {
		@media (min-width: $wide) {
			margin-inline-end: auto !important;
		}
	}

	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-event-booking-form > form.em-booking-form > section:not(.em-booking-form-section-summary),
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-form > .em-event-booking-form > form.em-booking-form > section:not(.em-booking-form-section-summary) {
		margin-top: 32px;

		> h3.em-booking-section-title {
			margin: 0 0 16px !important;
			padding: 0 !important;
			border: 0 !important;
			background: none !important;
			color: var(--em-checkout-text-strong) !important;
			font-family: inherit !important;
			font-size: 21px !important;
			font-weight: 600 !important;
			line-height: 1.3 !important;
			letter-spacing: 0 !important;

			&.hidden {
				display: none !important;
			}
		}

		> .em-booking-section:not(.em-booking-form-buttons) {
			margin: 0 !important;
			padding: 0 !important;
		}
	}

	// the sign in form login.php prints above the booking form, which the sign in link beside the details heading opens
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-event-booking-form > .em-login,
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-form > .em-event-booking-form > .em-login {
		margin-top: 0;
		margin-bottom: 0;

		> .em-login-trigger {
			display: none;
		}

		.em-login-content {
			margin-top: 24px;
		}
	}

	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-event-booking-form > form.em-booking-form > .em-booking-form-section-details,
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-form > .em-event-booking-form > form.em-booking-form > .em-booking-form-section-details {
		position: relative;

		> .em-booking-form-details {
			position: static;
		}

		.em-login-trigger {
			position: absolute;
			top: 0;
			inset-inline-end: 16px;
			margin: 0 !important;
			font-size: 0;
			font-style: normal;
			line-height: 27px;

			@media (min-width: $medium) {
				inset-inline-end: 21px;
			}

			@media (min-width: $wide) {
				inset-inline-end: 38px;
			}

			a {
				color: var(--em-checkout-accent) !important;
				font-size: 14px;
			}
		}
	}

	/* The summary rail: the booking form's summary section, or a placed booking's summary in the shell's aside (checkout/booking-summary.php, which the payment page prints too) */

	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-event-booking-form > form.em-booking-form > .em-booking-form-section-summary,
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-form > .em-event-booking-form > form.em-booking-form > .em-booking-form-section-summary,
	& > .em-checkout-aside.em-checkout-booking-summary > .em-checkout-aside-inner {
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		// the rail holds the event too, so it stays in view before tickets are chosen where the site hides the booking form's other sections until then (dbem_bookings_form_hide_dynamic)
		visibility: visible;

		> .em-booking-form-summary,
		> .em-booking-form-summary > .em-booking-summary {
			display: contents !important;
		}

		> h3.em-booking-section-title {
			position: absolute !important;
			width: 1px;
			height: 1px;
			margin: -1px !important;
			padding: 0 !important;
			overflow: hidden;
			clip: rect(0, 0, 0, 0);
			white-space: nowrap;
			border: 0 !important;
		}

		// the event and the tickets chosen first, then how long places are held and the coupon field, then the costs
		.em-booking-summary > :not(.em-bs-section-items) {
			order: 2;
		}

		> .em-booking-checkout-hold,
		> .em-booking-form-section-coupons {
			order: 1;
		}

		> .em-booking-form-section-coupons,
		.em-booking-summary > .em-checkout-coupons {
			margin-top: 18px !important;
		}

		> .em-checkout-items {
			margin-bottom: 0 !important;
		}

		// nothing chosen yet, so the summary is only the booking form's message
		.em-booking-summary[data-spaces="0"] {
			display: block !important;
			order: 0;
			padding: 14px 0 2px;
			color: var(--em-checkout-muted);
			font-size: 13px;
		}
	}

	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-event-booking-form > form.em-booking-form > .em-booking-form-section-summary,
	&.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-form > .em-event-booking-form > form.em-booking-form > .em-booking-form-section-summary {
		margin: 0 !important;
		padding: 0;
		border: 0;
		background: var(--em-checkout-aside);

		@media (max-width: $wide - 1px) {
			order: -1;
			width: 100%;
			// flush under the toggle, and its content lined up with the column like the toggle's
			margin-top: -8px !important;
			padding: 0 max(16px, calc((100% - 580px) / 2));
			border-bottom: 1px solid var(--em-checkout-border);

			&::before,
			&::after {
				content: "";
				flex: none;
				height: 16px;
				order: -10;
			}

			&::after {
				order: 10;
			}
		}

		@media (min-width: $medium) and (max-width: $wide - 1px) {
			padding: 0 max(21px, calc((100% - 580px) / 2));

			&::before,
			&::after {
				height: 21px;
			}
		}

		// the rail beside the main column, kept in view as the page scrolls
		@media (min-width: $wide) {
			position: fixed;
			z-index: 2;
			inset-block: 0;
			inset-inline-end: 0;
			width: 45%;
			height: auto !important;
			padding-block: 38px;
			padding-inline: 38px max(38px, calc(45% - 458px));
			overflow-y: auto;
			border-inline-start: 1px solid var(--em-checkout-border);
		}
	}

	&.ready.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-event-booking-form > form.em-booking-form > .em-booking-form-section-summary,
	&.ready.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-form > .em-event-booking-form > form.em-booking-form > .em-booking-form-section-summary {
		@media (max-width: $wide - 1px) {
			height: 0;
			overflow: hidden;
			border-bottom-width: 0;
			transition: height 0.25s ease-out;
		}
	}

	&.ready.summary-open.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-event-booking-form > form.em-booking-form > .em-booking-form-section-summary,
	&.ready.summary-open.em-booking-checkout > .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-form > .em-event-booking-form > form.em-booking-form > .em-booking-form-section-summary {
		@media (max-width: $wide - 1px) {
			border-bottom-width: 1px;
		}
	}

	/* The booking form's summary as the rail's lines */

	.em-booking-summary {
		.em-bs-section {
			margin: 0;
			padding: 0;
			border: 0;
		}

		.em-bs-row {
			display: flex;
			align-items: baseline;
			justify-content: space-between;
			gap: 16px;
			margin: 0;
			padding: 0;
			border: 0;
		}

		.em-bs-cell-desc {
			flex: 1 1 auto;
			min-width: 0;
		}

		.em-bs-cell-price {
			flex: none;
			text-align: end;
			white-space: nowrap;
			font-variant-numeric: tabular-nums;
		}

		.em-bs-section-items {
			display: grid;
			gap: 4px;
			margin-top: 10px;
			margin-inline-start: 78px;
		}

		.em-bs-row-item {
			gap: 0;

			.em-bs-cell-desc {
				flex: 0 1 auto;
			}

			.em-bs-qty-x {
				display: none;
			}

			.em-bs-cell-qty {
				order: 1;
				flex: 1 1 auto;
				color: var(--em-checkout-muted);
				white-space: nowrap;

				&::before {
					content: "\00a0\00d7\00a0";
				}
			}

			.em-bs-cell-price {
				order: 2;
				margin-inline-start: 12px;
			}
		}

		.em-bs-section-subtotals,
		.em-bs-section-payment-plan,
		.em-bs-section-balance {
			display: grid;
			gap: 8px;
		}

		.em-bs-section-subtotals {
			margin-top: 20px;
		}

		.em-bs-subtitle {
			color: var(--em-checkout-muted);
			font-size: 12px;
		}

		.em-bs-row-discount .em-bs-cell-price {
			color: var(--em-checkout-success);
		}

		.em-bs-section-total {
			margin-top: 16px;
			padding-top: 16px;
			border-top: 1px solid var(--em-checkout-border);

			.em-bs-cell-desc {
				color: var(--em-checkout-text-strong);
				font-size: 19px;
				font-weight: 600;
			}

			.em-bs-cell-price {
				color: var(--em-checkout-text-strong);
				font-size: 21px;
				font-weight: 600;
			}

			.em-bs-total-taxes-inc {
				display: block;
				margin-top: 2px;
				color: var(--em-checkout-muted);
				font-size: 12px;
				font-weight: 400;
			}
		}

		.em-bs-section-payment-plan,
		.em-bs-section-balance {
			margin-top: 12px;
		}

		.em-bs-row-paid {
			color: var(--em-checkout-muted);
		}

		.em-bs-row-due {
			color: var(--em-checkout-text-strong);
			font-size: 16px;
			font-weight: 600;
		}

		.em-icon-info {
			vertical-align: middle;
		}
	}

	.em-booking-summary.skeleton .em-bs-row .item.text {
		flex: 1;
	}

	/* Tickets: the booking form's stepper list (forms/bookingform/tickets-stepper.php, styled in the main stylesheet) in the checkout's colors and type */

	.em-tickets-stepper {
		border-color: var(--em-checkout-border) !important;
		border-radius: var(--em-checkout-radius);
		background: var(--em-checkout-surface);

		.em-ticket {
			border-top-color: var(--em-checkout-border);
		}

		.em-ticket-name,
		.em-ticket-price,
		.em-ticket-spaces-fixed {
			color: var(--em-checkout-text-strong);
		}

		.em-ticket-desc,
		.em-ticket-unavailable {
			color: var(--em-checkout-muted);
		}

		.em-ticket-stepper {
			border-color: var(--em-checkout-border);
			border-radius: var(--em-checkout-radius);
			background: var(--em-checkout-surface);
		}

		.em-ticket-stepper-button {
			border-radius: var(--em-checkout-radius) !important;
			color: var(--em-checkout-accent) !important;

			&:hover {
				background: var(--em-checkout-accent-tint) !important;
			}

			&:disabled {
				background: none !important;
				color: #c4c4c4 !important;
			}
		}

		.em-ticket-stepper-count {
			color: var(--em-checkout-text-strong);
			font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
		}
	}

	// the shell's script marks the checkout ready before the booking form script has set the steppers up, so the steppers keep their place unseen until then rather than the selects showing first
	&.ready .em-tickets-stepper:not(.ready) {
		.em-ticket-stepper {
			display: inline-flex;
			visibility: hidden;
		}

		.em-ticket-spaces > select.em-ticket-select {
			display: none !important;
		}
	}

	.em-booking-checkout-places-left {
		margin: 8px 0 0 !important;
		color: var(--em-checkout-muted);
		font-size: 12px;

		&:empty {
			display: none;
		}
	}

	/* Your details: the booking form fields, core's or a custom booking form's */

	.em-booking-form-details {
		display: grid;
		gap: 12px;

		> p, > div, .input-group, .input-user-field, .input-type {
			margin: 0 !important;
		}

		label {
			display: block;
			margin: 0 0 4px !important;
			color: var(--em-checkout-text) !important;
			font-size: 13px !important;
			font-weight: 500 !important;
			line-height: 18px !important;
		}

		.input-group, .input-user-field, .input-type, > p {
			position: relative;
		}

		// core's own fields (forms/bookingform/booking-fields.php) put Phone and Email side by side from 600px, in the order the template prints them, with the other fields across both columns
		@media (min-width: 600px) {
			&:has(> p:not([class]) > [name="user_email"]):has(> p:not([class]) > [name="dbem_phone"]) {
				grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
				column-gap: 16px;

				> * {
					grid-column: 1 / -1;
				}

				> p:not([class]):has(> [name="user_email"]),
				> p:not([class]):has(> [name="dbem_phone"]) {
					grid-column: auto;
				}
			}
		}
	}

	&.input .em-booking-form-details {
		input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="url"], input[type="password"], input[type="date"], select, div.input-wrap {
			box-sizing: border-box;
			width: 100% !important;
			height: 46px !important;
			margin: 0 !important;
			padding: 0 12px !important;
			border: 1px solid var(--em-checkout-border) !important;
			border-radius: var(--em-checkout-radius) !important;
			background-color: #fff !important;
			color: var(--em-checkout-text-strong) !important;
			font-size: 15px !important;
			line-height: 44px !important;
			box-shadow: none !important;
		}

		textarea {
			box-sizing: border-box;
			width: 100% !important;
			min-height: 92px;
			margin: 0 !important;
			padding: 10px 12px !important;
			border: 1px solid var(--em-checkout-border) !important;
			border-radius: var(--em-checkout-radius) !important;
			background-color: #fff !important;
			color: var(--em-checkout-text-strong) !important;
			font-size: 15px !important;
			box-shadow: none !important;
		}

		input, select, textarea {
			&:focus {
				border-color: var(--em-checkout-accent) !important;
				box-shadow: 0 0 0 1px var(--em-checkout-accent) !important;
				outline: none !important;
			}
		}

		input[type="checkbox"], input[type="radio"] {
			flex: none;
			margin: 2px 0 0 !important;
			accent-color: var(--em-checkout-accent);
		}

		// the phone field's country picker sits inside the input
		.iti {
			display: block;
			width: 100%;
		}
	}

	// checkboxes such as consent: the box beside its text
	.em-booking-form-details .input-checkbox label,
	.em-booking-form-details .em-consent-checkbox label,
	label.em-checkout-check {
		position: relative;
		display: block !important;
		margin: 2px 0 0 !important;
		padding-inline-start: 26px;
		color: var(--em-checkout-text) !important;
		font-size: 13px !important;
		font-weight: 400 !important;
		line-height: 20px !important;
		cursor: pointer;

		input[type="checkbox"], input[type="radio"] {
			position: absolute !important;
			top: 2px !important;
			inset-inline-start: 0 !important;
			width: 16px !important;
			height: 16px !important;
			margin: 0 !important;
		}

		a {
			color: var(--em-checkout-accent) !important;
		}
	}

	.invalid {
		input:not([type="checkbox"]):not([type="radio"]), select, textarea {
			border-color: var(--em-checkout-error) !important;
			box-shadow: 0 0 0 1px var(--em-checkout-error) !important;
		}
	}

	.em-booking-checkout-field-error {
		display: block;
		margin: 4px 0 0 !important;
		color: var(--em-checkout-error);
		font-size: 13px;
		line-height: 18px;
	}

	/* Payment and the button: the booking form's own button (forms/bookingform/button.php) as the checkout's pay button */

	.em-booking-form-section-confirm {
		> .em-booking-gateway,
		> .em-payment-gateways {
			margin-top: 0 !important;
		}
	}

	.em-booking-form-buttons {
		position: relative;
		margin: 16px 0 0 !important;
		padding: 0 !important;

		@media (min-width: $wide) {
			margin-top: 24px !important;
		}

		&.loading {
			@include pay-button-processing;
		}
	}

	&.input .em-booking-form-buttons input[type="submit"].em-booking-submit {
		@include pay-button;

		&[aria-busy="true"] {
			cursor: progress;
		}
	}

	// what the booking intent says, such as why places could not be held, spaced only when it says something
	.em-booking-intent-feedback {
		margin-top: 0;

		.em-notice, .em-booking-message {
			margin: 16px 0 0 !important;
		}

		// the summary rail shows how long places are held
		.em-booking-intent-hold {
			display: none !important;
		}
	}

	/* Summary rail additions */

	.em-booking-checkout-hold {
		display: flex;
		align-items: center;
		gap: 8px;
		margin: 20px 0 0 !important;
		padding: 9px 12px;
		border-radius: var(--em-checkout-radius);
		background: rgba(0, 0, 0, 0.05);
		color: var(--em-checkout-text);
		font-size: 13px;
		line-height: 18px;

		.em-icon {
			flex: none;
			color: var(--em-checkout-muted);
			@include icon-size(16px);
			@include icon-mask(--icon-clock);
		}

		b {
			color: var(--em-checkout-text-strong);
			font-variant-numeric: tabular-nums;
		}

		&[hidden] {
			display: none !important;
		}
	}

	/* Confirmation */

	.em-booking-checkout-confirmation {
		margin-top: 28px;

		&[hidden] {
			display: none !important;
		}

		// the booking's feedback or the gateway's thank you, which may be paragraphs of HTML
		.em-checkout-notice-message {
			p {
				margin: 0 !important;
			}

			p + p {
				margin-top: 4px !important;
			}
		}
	}

	// once a booking is made in the page, the confirmation replaces the form and the rail keeps only the booking's summary
	&.booked {
		> .em-checkout-main > .em-checkout-main-inner > .em-event-booking-form > :not(form),
		> .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-form > .em-event-booking-form > :not(form),
		> .em-checkout-main > .em-checkout-main-inner > .em-event-booking-form > form.em-booking-form > :not(.em-booking-form-section-summary),
		> .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-form > .em-event-booking-form > form.em-booking-form > :not(.em-booking-form-section-summary),
		> .em-checkout-main > .em-checkout-main-inner > .em-event-booking-form > form.em-booking-form > .em-booking-form-section-summary > :not(.em-booking-form-summary):not(.em-checkout-items):not(h3),
		> .em-checkout-main > .em-checkout-main-inner > .em-booking-recurring > .em-booking-recurrence-form > .em-event-booking-form > form.em-booking-form > .em-booking-form-section-summary > :not(.em-booking-form-summary):not(.em-checkout-items):not(h3) {
			display: none !important;
		}

		.em-checkout-summary-toggle-amount {
			color: var(--em-checkout-text-strong);
		}
	}

	.em-booking-checkout-done-mark {
		display: flex;
		align-items: center;
		gap: 14px;
		margin: 0 0 4px;
	}

	.em-booking-checkout-done-icon {
		display: flex;
		flex: none;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		border: 2px solid var(--em-checkout-success);
		border-radius: 50%;
		color: var(--em-checkout-success);

		.em-icon {
			@include icon-size(24px);
			@include icon-mask(--icon-checkmark);
		}
	}

	.em-booking-checkout-done-title {
		color: var(--em-checkout-text-strong);
		font-size: 21px;
		font-weight: 600;
		line-height: 1.3 !important;
	}

	.em-booking-checkout-done-event {
		color: var(--em-checkout-muted);
		font-size: 13px;
	}

	a.em-checkout-notice-action.em-checkout-notice-action-primary,
	.em-checkout-notice-action-html.em-checkout-notice-action-primary > button.em-tooltip-ddm {
		background: var(--em-checkout-accent) !important;
		color: #fff !important;

		&:hover {
			background: var(--em-checkout-accent-hover) !important;
		}
	}

	.em-checkout-notice-action-html.em-checkout-notice-action-primary > button.em-tooltip-ddm .em-icon {
		filter: brightness(0) invert(1);
	}

	// white whatever the notice's own color, so it reads as a button on the green of a confirmation too
	a.em-checkout-notice-action.em-checkout-notice-action-secondary,
	.em-checkout-notice-action-html.em-checkout-notice-action-secondary > button.em-tooltip-ddm {
		border-color: #c4c4c4 !important;
		background: #fff !important;
		color: var(--em-checkout-text) !important;

		&:hover {
			background: #f2f2f2 !important;
		}

		&:focus-visible {
			outline: 2px solid var(--em-checkout-accent) !important;
			outline-offset: 2px;
		}
	}

	/* Places where pixelbones or the theme would otherwise leak in */

	.em-checkout-brand {
		color: var(--em-checkout-text-strong);
	}
}
