/* Termelle booking form. Inherits the theme font; colours come from --tm-accent. */
.termelle-booking {
	--tm-accent: #22313a;
	--tm-text: currentColor;
	--tm-muted: color-mix(in srgb, currentColor 62%, transparent);
	--tm-line: color-mix(in srgb, currentColor 16%, transparent);
	--tm-soft: color-mix(in srgb, var(--tm-accent) 7%, transparent);
	--tm-radius: 10px;
	max-width: 880px;
	margin-inline: auto;
	font-size: 1rem;
	line-height: 1.5;
}

.termelle-booking *,
.termelle-booking *::before,
.termelle-booking *::after {
	box-sizing: border-box;
}

.termelle-booking button {
	font: inherit;
	color: inherit;
	cursor: pointer;
}

.termelle-booking button:disabled {
	cursor: default;
}

.termelle-booking :focus-visible {
	outline: 2px solid var(--tm-accent);
	outline-offset: 2px;
}

.tm-title {
	margin: 0 0 1rem;
	font-size: 1.25em;
	line-height: 1.3;
}

.tm-muted {
	color: var(--tm-muted);
	margin: 0;
}

.tm-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.tm-step + .tm-step {
	margin-top: 2rem;
}

/* Summary of choices */
.tm-summary {
	list-style: none;
	margin: 0 0 2rem;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	border: 1px solid var(--tm-line);
	background: var(--tm-surface, transparent);
	overflow: hidden;
}

.tm-summary li {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-areas: "label change" "value change";
	align-items: center;
	gap: .25rem 1rem;
	margin: 0 !important;
	padding: .9rem 1.1rem !important;
	border-left: 1px solid var(--tm-line);
	margin-left: -1px !important;
	border-top: 1px solid var(--tm-line);
	margin-top: -1px !important;
}

.tm-summary li::before,
.tm-summary li::marker { content: none; }

.tm-summary__label {
	grid-area: label;
	font-size: .75em;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--tm-muted);
	line-height: 1.2;
}

.tm-summary strong {
	grid-area: value;
	font-weight: 500;
	line-height: 1.35;
}

.tm-summary .tm-link {
	grid-area: change;
	align-self: center;
	line-height: 1;
}

.tm-link {
	background: none;
	border: 0;
	padding: 0;
	font-size: .875em;
	text-decoration: underline;
	text-underline-offset: 3px;
	color: var(--tm-accent) !important;
}

/* Services */
.tm-services {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: .75rem;
}

@media (min-width: 640px) {
	.tm-services {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.tm-service {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	gap: .35rem;
	text-align: left;
	padding: 1.1rem 1.25rem;
	background: transparent;
	border: 1px solid var(--tm-line);
	border-radius: var(--tm-radius);
	transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}

.tm-service:hover {
	border-color: var(--tm-accent);
	background: var(--tm-soft);
}

.tm-service__name {
	font-weight: 600;
}

.tm-service__desc {
	font-size: .9em;
	color: var(--tm-muted);
}

.tm-service__meta {
	margin-top: auto;
	padding-top: .35rem;
	font-size: .875em;
	color: var(--tm-accent);
}

.tm-service__note {
	font-size: .8em;
	color: var(--tm-muted);
}

/* Chips (staff, times) */
.tm-chips {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

.tm-chip {
	padding: .55rem 1rem;
	min-width: 4.5rem;
	border: 1px solid var(--tm-line);
	border-radius: 999px;
	background: transparent;
	transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.tm-chip:hover {
	border-color: var(--tm-accent);
	background: var(--tm-accent);
	color: #fff !important;
}

/* Calendar */
.tm-date {
	display: grid;
	gap: 1.5rem;
}

@media (min-width: 720px) {
	.tm-date {
		grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
		align-items: start;
	}
}

.tm-cal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: .75rem;
}

.tm-cal__title {
	text-transform: capitalize;
}

.tm-cal__nav {
	width: 2.25rem;
	height: 2.25rem;
	border: 1px solid var(--tm-line);
	border-radius: 50%;
	background: transparent;
	font-size: 1.2em;
	line-height: 1;
}

.tm-cal__nav:disabled {
	opacity: .35;
}

.tm-cal__grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 4px;
	text-align: center;
}

.tm-cal__dow {
	font-size: .75em;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--tm-muted);
	padding-bottom: .35rem;
}

.tm-cal__day {
	aspect-ratio: 1;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--tm-muted) !important;
	opacity: .55;
	font-variant-numeric: tabular-nums;
}

.tm-cal__day.is-open {
	opacity: 1;
	color: inherit !important;
	background: var(--tm-soft);
	font-weight: 600;
}

.tm-cal__day.is-open:hover {
	outline: 1px solid var(--tm-accent);
}

.tm-cal__day.is-selected {
	background: var(--tm-accent);
	color: #fff !important;
}

.tm-day {
	margin: 0 0 .75rem;
	font-weight: 600;
}

.tm-chips--times .tm-chip {
	font-variant-numeric: tabular-nums;
}

/* Form */
.tm-form {
	display: grid;
	gap: 1rem;
}

.tm-row {
	display: grid;
	gap: 1rem;
}

@media (min-width: 640px) {
	.tm-row {
		grid-template-columns: 1fr 1fr;
	}
}

.tm-field label {
	display: block;
	font-size: .9em;
	margin-bottom: .3rem;
}

.tm-optional {
	color: var(--tm-muted);
}

.tm-field input,
.tm-field select,
.tm-field textarea {
	width: 100%;
	padding: .7rem .85rem;
	font: inherit;
	color: inherit;
	background: transparent;
	border: 1px solid var(--tm-line);
	border-radius: 8px;
}

.tm-field input:focus,
.tm-field select:focus,
.tm-field textarea:focus {
	border-color: var(--tm-accent);
	outline: none;
	box-shadow: 0 0 0 3px var(--tm-soft);
}

.tm-field [aria-invalid="true"],
.tm-check [aria-invalid="true"] {
	border-color: #b3261e;
	outline-color: #b3261e;
}

.tm-error {
	display: block;
	font-size: .85em;
	color: #b3261e;
	min-height: 0;
}

.tm-error:empty {
	display: none;
}

.tm-check {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: .6rem;
	align-items: start;
	font-size: .9em;
}

.tm-check input {
	margin-top: .2em;
	width: 1.05rem;
	height: 1.05rem;
	accent-color: var(--tm-accent);
}

.tm-check .tm-error {
	grid-column: 2;
}

.tm-check a {
	color: inherit;
	text-decoration: underline;
}

.tm-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Buttons */
.tm-actions {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem;
	justify-content: space-between;
	margin-top: 1.25rem;
}

.tm-step > .tm-actions {
	justify-content: flex-start;
}

.tm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	padding: .8rem 1.5rem;
	min-height: 44px;
	border: 1px solid var(--tm-accent);
	border-radius: 999px;
	background: var(--tm-accent);
	color: #fff !important;
	font-weight: 600;
	transition: opacity .2s ease, background-color .2s ease;
}

.tm-btn:hover {
	opacity: .88;
}

.tm-btn--ghost {
	background: transparent;
	color: inherit !important;
	border-color: var(--tm-line);
	font-weight: 400;
}

.tm-btn--ghost:hover {
	border-color: var(--tm-accent);
	opacity: 1;
}

.tm-btn--danger {
	background: #b3261e;
	border-color: #b3261e;
}

.tm-btn.is-busy {
	opacity: .6;
	pointer-events: none;
}

/* Notices */
.tm-notice {
	margin: 0;
	padding: .85rem 1rem;
	border-radius: 8px;
	background: var(--tm-soft);
}

.tm-notice--error {
	background: color-mix(in srgb, #b3261e 10%, transparent);
	color: #8c1d18;
}

/* Done / manage */
.tm-done,
.tm-manage {
	display: grid;
	gap: 1rem;
	justify-items: start;
}

.tm-done:focus {
	outline: none;
}

.tm-done__icon {
	width: 3rem;
	height: 3rem;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--tm-accent);
	color: #fff;
	font-size: 1.4rem;
}

.tm-card {
	display: grid;
	gap: .2rem;
	padding: 1rem 1.25rem;
	border-left: 3px solid var(--tm-accent);
	background: var(--tm-soft);
	border-radius: 0 8px 8px 0;
	min-width: min(100%, 22rem);
}

.tm-card__service {
	font-size: 1.05em;
}

.tm-confirm {
	padding: 1rem 1.25rem;
	border: 1px solid var(--tm-line);
	border-radius: var(--tm-radius);
}

.tm-confirm p {
	margin: 0;
}

.tm-next {
	display: grid;
	gap: .75rem;
	justify-items: start;
	padding: 1rem 1.25rem;
	border: 1px solid var(--tm-line);
	border-radius: var(--tm-radius);
}

.tm-next p {
	margin: 0;
}

.tm-btn:link,
.tm-btn:visited {
	text-decoration: none;
}

/* Loading */
.tm-loading {
	height: 3rem;
	background: linear-gradient(90deg, var(--tm-soft), transparent, var(--tm-soft));
	background-size: 200% 100%;
	border-radius: 8px;
	animation: tm-pulse 1.2s ease-in-out infinite;
}

@keyframes tm-pulse {
	from {
		background-position: 100% 0;
	}

	to {
		background-position: -100% 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tm-loading {
		animation: none;
	}

	.termelle-booking * {
		transition: none !important;
	}
}
.tm-datelink { margin-top: 1rem; }
.tm-waitlist__intro { margin: 0 0 1.25rem; }

.tm-groups { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.25rem; }
.tm-group {
	padding: .55rem 1.1rem;
	border: 1px solid var(--tm-line, rgba(0,0,0,.18));
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
}
.tm-group.is-active { background: var(--tm-accent, #22313a); border-color: var(--tm-accent, #22313a); color: #fff; }
.tm-group:focus-visible { outline: 2px solid var(--tm-accent, #22313a); outline-offset: 2px; }

.tm-redirect {
	display: grid;
	justify-items: center;
	gap: 1rem;
	padding: 3rem 1rem;
	text-align: center;
}

.tm-redirect p {
	margin: 0;
}

.tm-redirect__spinner {
	width: 2rem;
	height: 2rem;
	border: 2px solid var(--tm-line);
	border-top-color: var(--tm-accent);
	border-radius: 50%;
	animation: tm-spin .8s linear infinite;
}

@keyframes tm-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.tm-redirect__spinner { animation-duration: 2.4s; }
}

.tm-chip.is-taken,
.tm-chip.is-taken:hover {
	cursor: not-allowed;
	opacity: .45;
	text-decoration: line-through;
	background: transparent;
	color: inherit;
	border-style: dashed;
}

.tm-taken-note {
	margin: .75rem 0 0;
	font-size: .85em;
}

/* Extras (add to the appointment) */
.tm-extras__intro {
	margin: -.5rem 0 1rem;
}

.tm-extras {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: .5rem;
}

.tm-extra {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: .9rem;
	align-items: center;
	padding: .9rem 1.1rem;
	border: 1px solid var(--tm-line);
	border-radius: var(--tm-radius);
	cursor: pointer;
	transition: border-color .2s ease, background-color .2s ease;
}

.tm-extra:hover,
.tm-extra.is-checked {
	border-color: var(--tm-accent);
}

.tm-extra.is-checked {
	background: var(--tm-soft);
}

.tm-extra input {
	width: 1.1rem;
	height: 1.1rem;
	margin: 0;
	accent-color: var(--tm-accent);
}

.tm-extra__body,
.tm-extra__meta {
	display: flex;
	flex-direction: column;
	gap: .15rem;
}

.tm-extra__name {
	font-weight: 600;
}

.tm-extra__desc,
.tm-extra__dur {
	font-size: .875em;
	color: var(--tm-muted);
}

.tm-extra__meta {
	align-items: flex-end;
	text-align: right;
	white-space: nowrap;
}

.tm-extras__total {
	margin: 1rem 0 0;
	font-size: .9em;
	color: var(--tm-muted);
}

.tm-extras-box {
	margin: 0 0 2rem;
}

.tm-extras__head {
	margin: 0 0 .6rem;
	font-weight: 600;
}

@media (min-width: 720px) {
	.tm-extras-box .tm-extras {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
