/**
 * Component-level styles for the reusable booking components documented
 * in docs/development/FRONTEND-COMPONENTS.md. One block per component,
 * in the same order as that document, so the two stay easy to cross-
 * reference.
 */

/* --- Button (BookingNavigation, generic actions) --- */
.tscb-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--tscb-space-2);
	font-weight: var(--tscb-font-weight-medium);
	font-size: var(--tscb-font-size-base);
	border-radius: var(--tscb-radius-md);
	border: 1px solid transparent;
	padding: var(--tscb-space-3) var(--tscb-space-5);
	min-height: 44px; /* real touch-target minimum, not decorative */
	cursor: pointer;
	transition: background-color var(--tscb-duration-fast) var(--tscb-easing),
		border-color var(--tscb-duration-fast) var(--tscb-easing);
}

.tscb-button--primary {
	background: var(--tscb-color-primary);
	color: var(--tscb-color-primary-contrast);
}

.tscb-button--primary:hover:not(:disabled) {
	filter: brightness(0.92);
}

/* The page's one submit action: full width on phones, easy to find. */
.tscb-button--submit {
	width: 100%;
	min-height: 52px;
	font-size: var(--tscb-font-size-lg);
	margin-top: var(--tscb-space-3);
}

@container tscb (min-width: 520px) {
	.tscb-button--submit {
		width: auto;
		min-width: 18rem;
	}
}

.tscb-button--secondary {
	background: transparent;
	border-color: var(--tscb-color-border-strong);
	color: var(--tscb-color-text);
}

.tscb-button--secondary:hover:not(:disabled) {
	background: var(--tscb-color-surface-hover);
}

.tscb-button:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.tscb-button--link {
	background: transparent;
	border: none;
	padding: var(--tscb-space-1) var(--tscb-space-2);
	min-height: auto;
	color: var(--tscb-color-primary);
	text-decoration: underline;
	font-weight: var(--tscb-font-weight-medium);
}

.tscb-button--link:hover:not(:disabled) {
	filter: brightness(0.92);
}

/* --- Review step summary header (title + Edit action) --- */
.tscb-summary__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--tscb-space-3);
}

.tscb-summary__header p {
	margin: 0;
}

/* --- ServiceCard / SelectionCard --- */
.tscb-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: var(--tscb-space-2);
	text-align: left;
	background: var(--tscb-color-background);
	border: 2px solid var(--tscb-color-border);
	border-radius: var(--tscb-radius-lg);
	padding: var(--tscb-space-4);
	cursor: pointer;
	width: 100%;
	transition: border-color var(--tscb-duration-fast) var(--tscb-easing),
		box-shadow var(--tscb-duration-fast) var(--tscb-easing);
}

.tscb-card:hover:not(:disabled) {
	border-color: var(--tscb-color-border-strong);
	box-shadow: var(--tscb-shadow-sm);
}

.tscb-card[aria-pressed='true'] {
	border-color: var(--tscb-color-primary);
	box-shadow: var(--tscb-shadow-md);
}

/* Selection is communicated by border weight/colour AND an explicit
   check icon + "Selected" text below — never colour alone. */
.tscb-card__selected-indicator {
	display: none;
	align-items: center;
	gap: var(--tscb-space-1);
	font-size: var(--tscb-font-size-sm);
	font-weight: var(--tscb-font-weight-medium);
	color: var(--tscb-color-primary);
}

.tscb-card[aria-pressed='true'] .tscb-card__selected-indicator {
	display: inline-flex;
}

.tscb-card:disabled,
.tscb-card[aria-disabled='true'] {
	opacity: 0.5;
	cursor: not-allowed;
}

.tscb-card__media {
	border-radius: var(--tscb-radius-md);
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: var(--tscb-color-surface);
}

.tscb-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Approved fallback treatment when a service/category has no assigned
   media-library image — a plain, restrained surface-coloured block with
   a centred, decorative icon, never a placeholder photo or a repeated
   stock image standing in for a real one. */
.tscb-card__media--empty {
	display: flex;
	align-items: center;
	justify-content: center;
}

.tscb-card__media--empty::after {
	content: '';
	width: 2rem;
	height: 2rem;
	border-radius: var(--tscb-radius-sm);
	border: 2px solid var(--tscb-color-border-strong);
	opacity: 0.6;
}

.tscb-card__title {
	font-weight: var(--tscb-font-weight-bold);
	font-size: var(--tscb-font-size-lg);
	margin: 0;
}

.tscb-card__description {
	color: var(--tscb-color-text-muted);
	font-size: var(--tscb-font-size-sm);
	margin: 0;
}

.tscb-card__booking-method {
	display: inline-block;
	align-self: flex-start;
	font-size: var(--tscb-font-size-sm);
	font-weight: var(--tscb-font-weight-medium);
	color: var(--tscb-color-secondary);
	background: var(--tscb-color-surface);
	border-radius: var(--tscb-radius-sm);
	padding: var(--tscb-space-1) var(--tscb-space-2);
}

/* --- AddOnCard (Stage 3, Prompt 4) --- */
.tscb-addon-card {
	display: flex;
	flex-direction: column;
	gap: var(--tscb-space-3);
}

.tscb-addon-card__controls {
	background: var(--tscb-color-background);
	border: 1px solid var(--tscb-color-border);
	border-radius: var(--tscb-radius-md);
	padding: var(--tscb-space-4);
	display: flex;
	flex-direction: column;
	gap: var(--tscb-space-3);
}

/* --- Membership plan card inclusions (Stage 3, Prompt 9) --- */
.tscb-plan-inclusions {
	margin: 0;
	padding-left: var(--tscb-space-4);
	font-size: var(--tscb-font-size-sm);
	color: var(--tscb-color-text-muted);
	text-align: left;
}

/* --- QuantityControl --- */
.tscb-quantity {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--tscb-space-4);
}

.tscb-quantity__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	font-size: var(--tscb-font-size-lg);
	font-weight: var(--tscb-font-weight-bold);
	line-height: 1;
	border: 1px solid var(--tscb-color-border-strong);
	border-radius: var(--tscb-radius-full);
	background: var(--tscb-color-surface);
	color: var(--tscb-color-text);
	cursor: pointer;
}

.tscb-quantity__button:hover:not(:disabled) {
	background: var(--tscb-color-surface-hover);
}

.tscb-quantity__button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.tscb-quantity__value {
	min-width: 4rem;
	text-align: center;
	font-weight: var(--tscb-font-weight-medium);
	font-variant-numeric: tabular-nums;
}

/* --- Form fields (FormField, TextInput, TextArea, SelectField) --- */
.tscb-field {
	display: flex;
	flex-direction: column;
	gap: var(--tscb-space-1);
	margin-bottom: var(--tscb-space-4);
}

.tscb-field__label {
	font-weight: var(--tscb-font-weight-medium);
	font-size: var(--tscb-font-size-sm);
}

.tscb-field__required {
	color: var(--tscb-color-error);
	margin-left: var(--tscb-space-1);
}

.tscb-field__control {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	font-family: inherit;
	font-size: var(--tscb-font-size-base);
	padding: var(--tscb-space-3);
	border: 1px solid var(--tscb-color-border-strong);
	border-radius: var(--tscb-radius-md);
	background: var(--tscb-color-background);
	color: var(--tscb-color-text);
	min-height: 44px;
}

.tscb-field__control:focus-visible {
	border-color: var(--tscb-color-focus-ring);
}

.tscb-field[data-invalid='true'] .tscb-field__control {
	border-color: var(--tscb-color-error);
}

textarea.tscb-field__control {
	min-height: 6rem;
	resize: vertical;
}

.tscb-field__help {
	font-size: var(--tscb-font-size-sm);
	color: var(--tscb-color-text-muted);
	margin: 0;
}

/* Questions rendered as a <fieldset>/<legend> (single/multi-select,
   radio, checkbox, yes/no — brief §22's "semantic fieldsets... correct
   legends") reset the browser's native fieldset chrome so they sit
   flush with every other field inside the same .tscb-field wrapper. */
.tscb-field fieldset {
	border: 0;
	padding: 0;
	margin: 0;
	min-width: 0;
}

.tscb-field legend {
	padding: 0;
	width: 100%;
}

/* --- RadioGroup / CheckboxGroup --- */
.tscb-option-group {
	display: flex;
	flex-direction: column;
	gap: var(--tscb-space-2);
}

.tscb-option {
	display: flex;
	align-items: flex-start;
	gap: var(--tscb-space-2);
	padding: var(--tscb-space-3);
	border: 1px solid var(--tscb-color-border);
	border-radius: var(--tscb-radius-md);
	cursor: pointer;
}

.tscb-option:has(input:checked) {
	border-color: var(--tscb-color-primary);
	background: var(--tscb-color-surface);
}

.tscb-option-group__yesno {
	display: contents;
}

.tscb-option input {
	margin-top: 0.2rem;
	width: 1.1rem;
	height: 1.1rem;
	flex-shrink: 0;
}

/* --- Priority pill (Stage 3, Prompt 7 room/area priority grid) --- */
.tscb-option-group--pills {
	flex-direction: row;
	flex-wrap: wrap;
}

.tscb-option--pill {
	padding: var(--tscb-space-2) var(--tscb-space-3);
	border-radius: var(--tscb-radius-full);
	min-height: 44px;
}

/* --- ValidationMessage --- */
.tscb-validation-message {
	display: flex;
	align-items: center;
	gap: var(--tscb-space-1);
	font-size: var(--tscb-font-size-sm);
	color: var(--tscb-color-error);
}

/* --- ErrorNotice / status notices --- */
.tscb-notice {
	display: flex;
	gap: var(--tscb-space-2);
	padding: var(--tscb-space-4);
	border-radius: var(--tscb-radius-md);
	border: 1px solid;
	margin-bottom: var(--tscb-space-4);
	font-size: var(--tscb-font-size-sm);
}

.tscb-notice--error {
	background: var(--tscb-color-error-surface);
	border-color: var(--tscb-color-error);
	color: var(--tscb-color-error);
}

.tscb-notice--warning {
	background: var(--tscb-color-warning-surface);
	border-color: var(--tscb-color-warning);
	color: var(--tscb-color-warning);
}

.tscb-notice--success {
	background: var(--tscb-color-success-surface);
	border-color: var(--tscb-color-success);
	color: var(--tscb-color-success);
}

/* --- LoadingIndicator --- */
.tscb-spinner {
	display: inline-block;
	width: 1.25rem;
	height: 1.25rem;
	border: 2px solid var(--tscb-color-border);
	border-top-color: var(--tscb-color-primary);
	border-radius: 50%;
	animation: tscb-spin 700ms linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
	.tscb-spinner {
		animation: none;
		border-top-color: var(--tscb-color-border);
	}
}

.tscb-loading-region {
	display: flex;
	align-items: center;
	gap: var(--tscb-space-2);
	color: var(--tscb-color-text-muted);
	padding: var(--tscb-space-5);
	justify-content: center;
}

/* --- Empty state --- */
.tscb-empty-state {
	text-align: center;
	padding: var(--tscb-space-7) var(--tscb-space-4);
	color: var(--tscb-color-text-muted);
}

/* --- Live estimate (Stage 4, Prompt 3) ---
   Labels flex and wrap; amounts stay compact, right-aligned and in
   tabular figures so a column of prices lines up at phone width too. */
.tscb-estimate__lines {
	grid-template-columns: minmax(0, 1fr) auto;
}

.tscb-estimate__lines dd {
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.tscb-estimate__detail {
	display: block;
	font-size: var(--tscb-font-size-sm);
	font-weight: var(--tscb-font-weight-normal);
}

.tscb-estimate__total > dt,
.tscb-estimate__total > dd {
	margin-top: var(--tscb-space-2);
	padding-top: var(--tscb-space-2);
	border-top: 1px solid var(--tscb-color-border);
	color: inherit;
	font-weight: var(--tscb-font-weight-bold);
}

.tscb-estimate__notice {
	margin: var(--tscb-space-3) 0 0;
	font-weight: var(--tscb-font-weight-medium);
}

/* --- Available times (12-prompt plan, Prompt 6) -------------------------- */
.tscb-slots__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.25rem 0 0.5rem;
}

.tscb-slots__slot {
	min-width: 5.5rem;
	min-height: 44px; /* comfortable touch target on phones */
}

.tscb-slots__slot[aria-pressed="true"] {
	background: var(--tscb-color-primary);
	border-color: var(--tscb-color-primary);
	color: var(--tscb-color-primary-contrast);
	font-weight: 600;
}

.tscb-slots__slot:focus-visible,
.tscb-result:focus-visible {
	outline: 3px solid var(--tscb-color-focus, #1d4ed8);
	outline-offset: 2px;
}

.tscb-send {
	margin-top: 1rem;
}

/* 2026-11-07: the phone and email under a form error, so no lead is lost. */
.tscb-notice__contact { flex-basis: 100%; margin: 8px 0 0; font-weight: 400; }
.tscb-notice__contact a { color: inherit; font-weight: 700; text-decoration: underline; white-space: nowrap; }
.tscb-notice--error { flex-wrap: wrap; align-items: center; }
