/**
 * Northline Booking — form, availability grid, styles.
 * Every visual value comes from CSS custom properties set by Elementor controls.
 */

.nlm-bk {
	/*
	 * Brand tokens, one level up.
	 *
	 * The template's design system lives on :root as --Paper / --Ink / --Muted /
	 * --Rule / --Signal-Blue. Until now this widget carried its own copy of those
	 * values, so a brand swap on the page left the booking form in the old
	 * palette — the one thing on the page that did not follow.
	 *
	 * Each line now reads the page's token first and keeps the old literal as the
	 * fallback, so the widget is unchanged on a site that never defines them, and
	 * follows the brand on one that does. An Elementor style control on the widget
	 * still wins over both, because it writes --nlm-* inline on the wrapper.
	 */
	--nlm-accent: var(--Signal-Blue, #1F5AFF);
	--nlm-ink: var(--Ink, #0B1220);
	--nlm-paper: var(--Card, #FFFFFF);
	--nlm-muted: var(--Muted, #5A6472);
	--nlm-rule: var(--Rule, rgba(11, 18, 32, 0.14));
	--nlm-radius: 2px;
	--nlm-font: inherit;
	--nlm-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

	box-sizing: border-box;
	/* Fill the column: the form sits in a flex parent that otherwise sizes this
	   to its content width, which shrinks the card when the review step shows. */
	width: 100%;
	max-width: 100%;
	/* Default breathing room. The widget's Padding control writes its own
	   `padding` onto this element and, loading later, overrides this value. */
	padding: var(--nlm-pad, 32px);
	background: var(--nlm-bg, transparent);
	border-radius: var(--nlm-radius);
	color: var(--nlm-text, var(--nlm-ink));
	font-family: var(--nlm-font);
}

@media (max-width: 767px) {
	.nlm-bk {
		padding: var(--nlm-pad, 20px);
	}
}

.nlm-bk *,
.nlm-bk *::before,
.nlm-bk *::after {
	box-sizing: border-box;
}

/* Inside a row-flex Elementor container the widget wrapper sizes itself to its
   content, so the card shrank when the review step replaced the wider field
   grid. Keep the wrapper full width on any site. */
.elementor-widget-nlb-booking,
.elementor-widget-nlb-booking .elementor-widget-container {
	width: 100%;
	max-width: 100%;
}

/* ---------------------------------------------------------------- header */
.nlm-bk__title {
	margin: 0 0 6px;
	font-size: var(--nlm-title-size, 28px);
	line-height: 1.1;
	letter-spacing: -0.02em;
	font-weight: var(--nlm-title-weight, 400);
	color: var(--nlm-title-color, var(--nlm-ink));
}

.nlm-bk__subtitle {
	margin: 0 0 var(--nlm-gap, 24px);
	font-size: var(--nlm-sub-size, 15px);
	line-height: 1.55;
	color: var(--nlm-sub-color, var(--nlm-muted));
	max-width: 52ch;
}

/* ------------------------------------------------------------ date strip */
.nlm-bk__step {
	margin-bottom: var(--nlm-gap, 24px);
}

.nlm-bk__step-label {
	display: block;
	font-family: var(--nlm-mono);
	font-size: var(--nlm-label-size, 11px);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--nlm-label-color, var(--nlm-muted));
	margin-bottom: 10px;
}

.nlm-bk__dates {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	padding-bottom: 6px;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.nlm-bk__dates::-webkit-scrollbar {
	display: none;
}

.nlm-bk__date {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	min-width: 64px;
	padding: 10px 12px;
	border: 1px solid var(--nlm-input-border, var(--nlm-rule));
	border-radius: var(--nlm-radius);
	background: var(--nlm-input-bg, transparent);
	color: var(--nlm-input-text, var(--nlm-ink));
	font-family: inherit;
	font-size: 13px;
	line-height: 1.15;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nlm-bk__date:hover {
	border-color: var(--nlm-date-hover-border, var(--nlm-accent));
	background: var(--nlm-date-hover-bg, transparent);
}

.nlm-bk__date .dow {
	font-family: var(--nlm-mono);
	font-size: 10px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	opacity: 0.65;
}

.nlm-bk__date .num {
	font-size: 17px;
	font-weight: 500;
}

.nlm-bk__date[aria-pressed="true"] {
	background: var(--nlm-accent, #1F5AFF);
	border-color: var(--nlm-accent, #1F5AFF);
	color: var(--nlm-accent-text, #FFFFFF);
}

.nlm-bk__date[aria-pressed="true"] .dow {
	opacity: 0.85;
}

/* A day with nothing left. It still takes clicks — the server is the only honest
   source of truth, and a stale page must never strand a visitor. */
.nlm-bk__date.is-full {
	opacity: 0.5;
}

.nlm-bk__date.is-full:hover {
	opacity: 0.8;
}

.nlm-bk__date.is-full .num {
	text-decoration: line-through;
	text-decoration-thickness: 1px;
}

.nlm-bk__no-days {
	margin-top: 10px;
	font-size: 13px;
}

/* ------------------------------------------------------------ slot grid */
.nlm-bk__slots {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
	gap: 8px;
}

.nlm-bk__slot {
	padding: 12px 10px;
	border: 1px solid var(--nlm-input-border, var(--nlm-rule));
	border-radius: var(--nlm-radius);
	background: var(--nlm-input-bg, transparent);
	color: var(--nlm-input-text, var(--nlm-ink));
	font-family: inherit;
	font-size: 14px;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nlm-bk__slot:hover:not([disabled]) {
	border-color: var(--nlm-slot-hover-border, var(--nlm-accent));
	background: var(--nlm-slot-hover-bg, transparent);
}

.nlm-bk__slot[aria-pressed="true"] {
	background: var(--nlm-accent, #1F5AFF);
	border-color: var(--nlm-accent, #1F5AFF);
	color: var(--nlm-accent-text, #FFFFFF);
}

.nlm-bk__slot[disabled] {
	opacity: 0.42;
	cursor: not-allowed;
	text-decoration: line-through;
}

.nlm-bk__empty {
	font-size: 14px;
	color: var(--nlm-sub-color, var(--nlm-muted));
	margin: 0;
}

/* ---------------------------------------------------------------- fields */
.nlm-bk__fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
	margin-top: var(--nlm-gap, 24px);
}

.nlm-bk__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.nlm-bk__field--full {
	grid-column: 1 / -1;
}

.nlm-bk__label {
	font-family: var(--nlm-mono);
	font-size: var(--nlm-label-size, 11px);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--nlm-label-color, var(--nlm-muted));
}

.nlm-bk__input,
.nlm-bk__textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--nlm-input-border, var(--nlm-rule));
	border-radius: var(--nlm-radius);
	background: var(--nlm-input-bg, transparent);
	color: var(--nlm-input-text, var(--nlm-ink));
	font-family: inherit;
	font-size: 15px;
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nlm-bk__input::placeholder,
.nlm-bk__textarea::placeholder {
	color: var(--nlm-placeholder, var(--nlm-muted));
	opacity: 1;
}

.nlm-bk__input:focus,
.nlm-bk__textarea:focus {
	outline: none;
	border-color: var(--nlm-accent);
	box-shadow: 0 0 0 3px var(--nlm-focus-ring, rgba(31, 90, 255, 0.18));
}

.nlm-bk__textarea {
	min-height: 96px;
	resize: vertical;
}

/* ---------------------------------------------------------------- submit */
.nlm-bk__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-top: var(--nlm-gap, 24px);
	padding: var(--nlm-btn-pad, 16px 28px);
	border: 0;
	border-radius: var(--nlm-btn-radius, var(--nlm-radius));
	background: var(--nlm-btn-bg, var(--nlm-accent, #1F5AFF));
	color: var(--nlm-btn-text, #FFFFFF);
	font-family: inherit;
	font-size: var(--nlm-btn-size, 16px);
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.18s ease, opacity 0.18s ease;
}

.nlm-bk__submit:hover:not([disabled]) {
	background: var(--nlm-btn-bg-hover, var(--nlm-ink));
	color: var(--nlm-btn-text-hover, var(--nlm-btn-text, #fff));
}

.nlm-bk__submit[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

.nlm-bk__summary {
	margin: 0;
	padding: 0;
	display: grid;
	border-top: 1px solid var(--nlm-input-border, rgba(11, 18, 32, 0.14));
	font-size: 14px;
	color: var(--nlm-sub-color, var(--nlm-muted));
}

/* ---------------------------------------------------------------- notices */
.nlm-bk__notice {
	display: none;
	margin-top: 16px;
	padding: 14px 16px;
	border-radius: var(--nlm-radius);
	font-size: 14px;
	line-height: 1.5;
	border: 1px solid transparent;
}

.nlm-bk__notice.is-visible {
	display: block;
}

.nlm-bk__notice--ok {
	background: var(--nlm-ok-bg, #E6F2EA);
	border-color: var(--nlm-ok-border, #BFDCCB);
	color: var(--nlm-ok-text, #175C39);
}

.nlm-bk__notice--err {
	background: var(--nlm-err-bg, #FBEAEA);
	border-color: var(--nlm-err-border, #E7C7C7);
	color: var(--nlm-err-text, #8B1E1E);
}

/* honeypot, hidden from humans and screen readers */
.nlm-bk__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 600px) {
	.nlm-bk__fields {
		grid-template-columns: 1fr;
	}

	.nlm-bk__slots {
		grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	.nlm-bk * {
		transition: none !important;
	}
}

/* ---------------------------------------------------------- review step */

.nlm-bk__details[hidden],
.nlm-bk__review[hidden] {
	display: none !important;
}

.nlm-bk__review {
	display: grid;
	gap: calc(var(--nlm-gap, 24px) * 0.75);
}

.nlm-bk__review-heading {
	margin: 0;
	outline: none;
}

.nlm-bk__summary-row {
	display: grid;
	grid-template-columns: minmax(88px, 32%) minmax(0, 1fr);
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--nlm-input-border, rgba(11, 18, 32, 0.14));
}

.nlm-bk__summary dt,
.nlm-bk__summary dd {
	min-width: 0;
}

.nlm-bk__summary dt {
	color: var(--nlm-label-color, inherit);
	opacity: 0.72;
}

.nlm-bk__summary dd {
	margin: 0;
	color: var(--nlm-input-text, inherit);
	overflow-wrap: anywhere;
}

.nlm-bk__summary-row[hidden] {
	display: none;
}

.nlm-bk__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: center;
}

.nlm-bk__back {
	background: none;
	border: 0;
	padding: 10px 0;
	color: var(--nlm-back-color, var(--nlm-accent, #1F5AFF));
	font: inherit;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.nlm-bk__back:hover {
	opacity: 0.72;
}

.nlm-bk__back:focus-visible {
	outline: 2px solid var(--nlm-focus-ring, var(--nlm-accent, #1F5AFF));
	outline-offset: 3px;
}

/* ---------------------------------------------------------------- services */
/* Radio cards: the whole row is the target, and the price sits directly under
   the name, where the eye lands after reading what the job is. */
.nlm-bk__services {
	display: grid;
	gap: 8px;
	margin-top: 10px;
}

.nlm-bk__service {
	position: relative;
	display: block;
	cursor: pointer;
}

.nlm-bk__service input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.nlm-bk__service-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px 14px;
	border: 1px solid rgba(11, 18, 32, 0.16);
	border-radius: 10px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nlm-bk__service:hover .nlm-bk__service-body {
	border-color: rgba(11, 18, 32, 0.34);
}

.nlm-bk__service input:checked + .nlm-bk__service-body {
	border-color: #1f5aff;
	box-shadow: inset 0 0 0 1px #1f5aff;
}

.nlm-bk__service input:focus-visible + .nlm-bk__service-body {
	outline: 2px solid #1f5aff;
	outline-offset: 2px;
}

.nlm-bk__service-name {
	font-weight: 600;
	line-height: 1.3;
}

.nlm-bk__service-meta {
	font-size: 13px;
	opacity: 0.7;
	line-height: 1.4;
}
