/* Listings — contact form + modal. Cascade order is fixed in ListingsModule::STYLES. */

/* Contact form — rendered in the session popup and in the event/coach contact modal. */

/* Session popup, book layout. Only the --split dialog is touched: the contact
   modal shares the .mf-session-modal shell and must keep its single column. */
.mf-session-modal__dialog--split {
	--mf-book-col: 460px;
	width: min(1120px, 100%);
	display: flex;
	flex-direction: column;
	max-height: 88vh;
	padding: 0;
	overflow: hidden;
}

.mf-session-modal__cols {
	flex: 1 1 auto;
	min-height: 0;
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(var(--mf-book-col), 1fr);
	overflow: hidden;
}

.mf-session-modal__main,
.mf-session-modal__side {
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.mf-session-modal__main {
	padding: 26px 30px 28px;
}

.mf-session-modal__side {
	padding: 28px 32px 30px;
	background: var(--mf-page-bg);
	border-left: 1px solid var(--mf-line);
}

.mf-session-modal__main .mf-session-modal__lead,
.mf-session-modal__main .mf-session-modal__desc {
	max-width: 52ch;
}

/* The form's own spacing comes from the panel now. */
.mf-session-modal__form {
	margin: 0;
}

/* Keep the heading clear of the close chip in this corner. */
.mf-session-modal__side .mf-contact-form__title {
	padding-right: 40px;
}

@media (min-width: 900px) {
	.mf-session-modal__main .mf-session-modal__facts {
		margin-top: 22px;
		padding: 6px 18px;
		border-top: 0;
		background: var(--mf-page-bg);
		border: 1px solid var(--mf-line);
		border-radius: 14px;
	}

	/* Stack name/email in the ~400px panel: the side-by-side rule below keys off the
	   VIEWPORT, which can't see this column. */
	.mf-session-modal__side .mf-contact-form__grid {
		grid-template-columns: 1fr;
	}
}

.mf-session-modal__dialog--split .mf-session-modal__close {
	z-index: 2;
	right: 16px;
}

/* Mobile: bottom sheet */
@media (max-width: 899px) {
	.mf-session-modal--book {
		padding: 0;
		align-items: flex-end;
	}

	.mf-session-modal__dialog--split {
		width: 100%;
		max-height: 94vh;
		/* dvh so a browser toolbar sliding in can't push the sheet off screen. */
		max-height: 94dvh;
		border-radius: 20px 20px 0 0;
	}

	.mf-session-modal__cols {
		display: block;
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}

	.mf-session-modal__main,
	.mf-session-modal__side {
		overflow: visible;
	}

	.mf-session-modal__main {
		padding: 26px 20px 22px;
	}

	.mf-session-modal__side {
		padding: 22px 20px 28px;
		border-left: 0;
		border-top: 1px solid var(--mf-line);
	}
}

/* Jump bar — mobile only; session-modal.js hides it once the form is on screen. */
.mf-session-modal__jump {
	flex: 0 0 auto;
	padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
	background: var(--mf-white);
	border-top: 1px solid var(--mf-line);
	box-shadow: 0 -6px 20px rgba(2, 7, 13, 0.08);
}

.mf-session-modal__jump[hidden] {
	display: none;
}

@media (min-width: 900px) {
	.mf-session-modal__jump {
		display: none;
	}
}

.mf-contact-form__title {
	margin: 0 0 6px;
	font-size: 1.35rem;
	letter-spacing: -0.015em;
	color: var(--mf-navy);
}

.mf-contact-form__intro {
	margin: 0 0 16px;
	color: var(--mf-ink);
	font-size: 0.95rem;
	line-height: 1.55;
}

/* Summary */
.mf-contact-form__summary {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0 0 18px;
	padding: 12px 14px;
	border: 1px solid var(--mf-line);
	border-left: 3px solid var(--mf-blue);
	border-radius: 12px;
	background: var(--mf-sky-1);
}

.mf-contact-form__summary-label {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--mf-blue-deep);
}

.mf-contact-form__summary-value {
	font-size: 0.98rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--mf-navy);
}

/* Intent cards. The native radio stays in the DOM (never display:none) for keyboard/screen readers. */
.mf-intent-set {
	margin: 0 0 18px;
	padding: 0;
	border: 0;
}

.mf-intent-set__legend {
	padding: 0;
	margin-bottom: 10px;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--mf-navy);
}

.mf-intent {
	display: block;
	margin-bottom: 8px;
	cursor: pointer;
}

.mf-intent input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.mf-intent__box {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 13px 14px;
	border: 1.5px solid var(--mf-line);
	border-radius: 14px;
	background: var(--mf-white);
	transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.mf-intent:hover .mf-intent__box {
	border-color: var(--mf-sky-3);
	background: var(--mf-sky-1);
}

/* Card keeps the blue selection language; only the tick goes green. */
.mf-intent input:checked + .mf-intent__box {
	border-color: var(--mf-selected) !important;
	background: var(--mf-selected-soft) !important;
	box-shadow: 0 0 0 3px rgba(58, 103, 204, 0.12) !important;
}

/* Keyboard focus ring — the native input is invisible, so the box shows it. */
.mf-intent input:focus-visible + .mf-intent__box {
	outline: 2px solid var(--mf-blue);
	outline-offset: 2px;
}

.mf-intent__icon {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--mf-sky-2);
	color: var(--mf-blue-deep);
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1;
}

.mf-intent input:checked + .mf-intent__box .mf-intent__icon {
	background: var(--mf-selected);
	color: var(--mf-selected-on);
}

.mf-intent__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.mf-intent__label {
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--mf-navy);
}

.mf-intent__hint {
	font-size: 0.82rem;
	line-height: 1.4;
	color: var(--mf-muted);
}

/* Green tick = --mf-confirm, scoped to a settled form choice (see brand.css). */
.mf-intent__check {
	position: relative;
	flex: 0 0 auto;
	margin-left: auto;
	width: 22px;
	height: 22px;
	border: 2px solid var(--mf-line);
	border-radius: 50%;
	background: var(--mf-white);
	transition: border-color 0.15s ease, background 0.15s ease;
}

/* The checkmark: two borders of a rotated box. Hidden until chosen. */
.mf-intent__check::after {
	content: "";
	position: absolute;
	top: 45%;
	left: 50%;
	width: 10px;
	height: 5px;
	border-left: 2.5px solid var(--mf-white);
	border-bottom: 2.5px solid var(--mf-white);
	border-radius: 1px;
	transform: translate(-50%, -50%) rotate(-45deg) scale(0.5);
	opacity: 0;
	transition: opacity 0.14s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mf-intent input:checked + .mf-intent__box .mf-intent__check {
	border-color: var(--mf-confirm);
	background: var(--mf-confirm);
}

.mf-intent input:checked + .mf-intent__box .mf-intent__check::after {
	opacity: 1;
	transform: translate(-50%, -50%) rotate(-45deg) scale(1);
}

@media (prefers-reduced-motion: reduce) {
	.mf-intent__check::after { transition: opacity 0.1s ease; }
	.mf-intent input:checked + .mf-intent__box .mf-intent__check::after {
		transform: translate(-50%, -50%) rotate(-45deg) scale(1);
	}
}

/* stepper */
.mf-field--quantity > span {
	display: block;
	margin-bottom: 6px;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--mf-navy);
}

.mf-stepper {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--mf-line);
	border-radius: 12px;
	overflow: hidden;
	background: var(--mf-white);
}

.mf-stepper__btn {
	width: 42px;
	height: 44px;
	border: 0;
	background: var(--mf-sky-1);
	color: var(--mf-navy);
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease;
}

.mf-stepper__btn:hover {
	background: var(--mf-sky-2);
}

/* The stepper input is inside .mf-field, so it must undo the full-width rule. */
.mf-stepper input[type="number"] {
	width: 62px;
	border: 0;
	border-radius: 0;
	text-align: center;
	font-weight: 600;
	-moz-appearance: textfield;
}

.mf-stepper input[type="number"]::-webkit-outer-spin-button,
.mf-stepper input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.mf-stepper input[type="number"]:focus {
	box-shadow: none;
}

/* Name/email grid */
.mf-contact-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 12px;
}

/* A trailing odd field (phone, when shown) spans the full row. */
.mf-contact-form__grid > .mf-field:nth-child(3) {
	grid-column: 1 / -1;
}

@media (max-width: 520px) {
	.mf-contact-form__grid {
		grid-template-columns: 1fr;
	}
}

.mf-contact-form__reassure {
	margin: 10px 0 0;
	font-size: 0.8rem;
	line-height: 1.45;
	color: var(--mf-muted);
	text-align: center;
}

.mf-field {
	display: block;
	margin-bottom: 14px;
}

.mf-field > span {
	display: block;
	margin-bottom: 6px;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--mf-navy);
}

.mf-field > span em {
	font-weight: 400;
	font-style: normal;
	color: var(--mf-muted);
}

.mf-field input,
.mf-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	border: 1px solid var(--mf-line);
	border-radius: 12px;
	font-family: var(--mf-font);
	font-size: 0.95rem;
	color: var(--mf-ink);
	background: var(--mf-white, #fff);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mf-field input:focus,
.mf-field textarea:focus {
	outline: none;
	border-color: var(--mf-blue);
	box-shadow: 0 0 0 3px rgba(58, 103, 204, 0.15);
}

/* A hidden field must not leave its grid/flow gap behind. */
.mf-field[hidden],
.mf-field--quantity[hidden] {
	display: none;
}

.mf-field textarea {
	resize: vertical;
	min-height: 96px;
}

/* Honeypot — visually hidden but present in the DOM for bots. */
.mf-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.mf-contact-form button[type="submit"] {
	margin-top: 6px;
}

.mf-contact-form__msg {
	margin-bottom: 14px;
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 0.9rem;
	line-height: 1.5;
}

.mf-contact-form__msg.is-error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.mf-contact-form__msg.is-ok {
	background: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
}

.mf-contact-form__done {
	text-align: center;
	padding: 20px 0 8px;
}

.mf-contact-form__check {
	width: 52px;
	height: 52px;
	margin: 0 auto 12px;
	border-radius: 50%;
	background: #dcfce7;
	color: #166534;
	font-size: 1.6rem;
	line-height: 52px;
	font-weight: 700;
}

.mf-contact-form__done p {
	margin: 0;
	color: var(--mf-navy);
	font-size: 1rem;
	font-weight: 600;
}
