/*
 * The visitor page.
 *
 * Scoped under .tsn so it cannot reach into whatever theme the salon is
 * running, and built on an accent colour the salon sets in Settings rather
 * than on anything hard-coded - a salon's brand is its own.
 *
 * The slot grid is the part that matters. It is a radio group styled as
 * buttons, so it keeps real keyboard behaviour and real form semantics; a
 * grid of divs with click handlers is how a booking form stops working for
 * somebody using a screen reader, and they book hair appointments too.
 */

.tsn {
	--tsn-accent: #7a3b6a;
	--tsn-ink: #241f22;
	--tsn-soft: #6b6067;
	--tsn-line: #e3dce0;
	--tsn-wash: #faf7f9;
	--tsn-paper: #fff;
	color: var(--tsn-ink);
	line-height: 1.55;
	margin: 0 auto;
	max-width: 62rem;
}

@media (prefers-color-scheme: dark) {
	.tsn:not([data-theme="light"]) {
		--tsn-ink: #f2edef;
		--tsn-soft: #b6a9b0;
		--tsn-line: #3a3237;
		--tsn-wash: #241f22;
		--tsn-paper: #1a1619;
	}
}

.tsn h2,
.tsn h3,
.tsn h4 {
	color: var(--tsn-ink);
	line-height: 1.25;
	margin: 0 0 0.4rem;
}

.tsn-hero {
	border-bottom: 2px solid var(--tsn-accent);
	margin: 0 0 1.5rem;
	padding: 0 0 1rem;
}

.tsn-strapline {
	color: var(--tsn-accent);
	font-size: 1.1rem;
	font-weight: 600;
	margin: 0 0 0.6rem;
}

.tsn-intro {
	color: var(--tsn-soft);
	margin: 0;
}

.tsn-flash {
	border-left: 4px solid var(--tsn-accent);
	background: var(--tsn-wash);
	border-radius: 0 6px 6px 0;
	margin: 0 0 1.2rem;
	padding: 0.7rem 1rem;
}

.tsn-flash-error {
	border-left-color: #b3261e;
}

/* ── the price list ──────────────────────────────────────────────────── */

.tsn-prices,
.tsn-team,
.tsn-visit,
.tsn-book,
.tsn-appointments,
.tsn-packages,
.tsn-loyalty {
	margin: 0 0 2rem;
}

.tsn-group {
	margin: 0 0 1.4rem;
}

.tsn-group-blurb {
	color: var(--tsn-soft);
	font-size: 0.93rem;
	margin: 0 0 0.6rem;
}

.tsn-service-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

/*
 * Name on the left, time and price on the right, description underneath on
 * its own row. A grid rather than a table because it has to stack cleanly on
 * a phone, and a salon price list is read on a phone more than anywhere else.
 */
.tsn-service {
	border-bottom: 1px solid var(--tsn-line);
	display: grid;
	gap: 0 0.9rem;
	grid-template-columns: 1fr auto auto;
	padding: 0.55rem 0;
}

.tsn-service-name {
	font-weight: 600;
	min-width: 0;
}

.tsn-service-time {
	color: var(--tsn-soft);
	font-size: 0.88rem;
	white-space: nowrap;
}

.tsn-service-price {
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	white-space: nowrap;
}

.tsn-service-desc,
.tsn-service-note {
	color: var(--tsn-soft);
	font-size: 0.88rem;
	grid-column: 1 / -1;
}

.tsn-service-note {
	color: var(--tsn-accent);
}

@media (max-width: 30rem) {
	.tsn-service {
		grid-template-columns: 1fr auto;
	}

	.tsn-service-time {
		grid-column: 1 / -1;
	}
}

/* ── the team ────────────────────────────────────────────────────────── */

.tsn-team-list {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.tsn-person {
	background: var(--tsn-wash);
	border: 1px solid var(--tsn-line);
	border-radius: 10px;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 0.9rem 1rem;
}

.tsn-person-name {
	font-weight: 700;
}

.tsn-person-level {
	color: var(--tsn-accent);
	font-size: 0.85rem;
	font-weight: 600;
}

.tsn-person-bio,
.tsn-person-skills {
	color: var(--tsn-soft);
	font-size: 0.9rem;
}

/* ── booking ─────────────────────────────────────────────────────────── */

.tsn-book-find {
	align-items: end;
	background: var(--tsn-wash);
	border: 1px solid var(--tsn-line);
	border-radius: 10px;
	display: flex;
	flex-wrap: wrap;
	gap: 0.8rem;
	padding: 1rem;
}

.tsn-book-find label,
.tsn-fields label {
	display: flex;
	flex: 1 1 12rem;
	flex-direction: column;
	font-size: 0.9rem;
	font-weight: 600;
	gap: 0.25rem;
}

.tsn-book-find select,
.tsn-book-find input,
.tsn-fields input,
.tsn-fields textarea {
	border: 1px solid var(--tsn-line);
	border-radius: 6px;
	background: var(--tsn-paper);
	color: var(--tsn-ink);
	font: inherit;
	padding: 0.45rem 0.6rem;
	width: 100%;
}

.tsn-button {
	background: var(--tsn-accent);
	border: 0;
	border-radius: 6px;
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	padding: 0.55rem 1.2rem;
}

.tsn-button-primary {
	font-size: 1.05rem;
	margin-top: 1rem;
	padding: 0.7rem 1.6rem;
}

.tsn-slots {
	margin: 1.2rem 0 0;
}

.tsn-slots-lead {
	color: var(--tsn-soft);
	margin: 0 0 0.8rem;
}

.tsn-slot-grid {
	border: 0;
	display: grid;
	gap: 0.5rem;
	grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
	margin: 0 0 1.2rem;
	padding: 0;
}

.tsn-slot-grid legend {
	font-weight: 600;
	margin: 0 0 0.5rem;
	padding: 0;
}

/*
 * The radio itself is taken out of the flow rather than display:none, so it
 * stays focusable. :focus-visible on the label keeps the focus ring where
 * somebody tabbing can actually see it.
 */
.tsn-slot input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.tsn-slot {
	background: var(--tsn-paper);
	border: 1px solid var(--tsn-line);
	border-radius: 8px;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	padding: 0.5rem 0.6rem;
	text-align: center;
}

.tsn-slot:has(input:checked) {
	background: var(--tsn-accent);
	border-color: var(--tsn-accent);
	color: #fff;
}

.tsn-slot:has(input:focus-visible) {
	outline: 3px solid var(--tsn-accent);
	outline-offset: 2px;
}

.tsn-slot-time {
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}

.tsn-slot-who {
	font-size: 0.8rem;
	opacity: 0.85;
}

.tsn-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 0.8rem;
}

.tsn-patch-note,
.tsn-terms {
	background: var(--tsn-wash);
	border-left: 4px solid var(--tsn-accent);
	border-radius: 0 6px 6px 0;
	font-size: 0.9rem;
	margin: 1rem 0 0;
	padding: 0.7rem 1rem;
}

.tsn-none {
	color: var(--tsn-soft);
	font-style: italic;
}

/* ── the client's own page ───────────────────────────────────────────── */

.tsn-patch {
	border-left: 4px solid var(--tsn-line);
	border-radius: 0 6px 6px 0;
	background: var(--tsn-wash);
	padding: 0.7rem 1rem;
}

.tsn-patch.ok {
	border-left-color: #2e7d32;
}

.tsn-patch.warn {
	border-left-color: #b26a00;
}

.tsn-patch.bad {
	border-left-color: #b3261e;
	font-weight: 600;
}

.tsn-appt-list,
.tsn-appt-past {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tsn-appt-list li {
	border-bottom: 1px solid var(--tsn-line);
	padding: 0.6rem 0;
}

.tsn-appt-when {
	font-weight: 700;
}

.tsn-appt-who,
.tsn-appt-what,
.tsn-appt-note {
	color: var(--tsn-soft);
}

.tsn-cancel {
	color: var(--tsn-accent);
	font-size: 0.9rem;
}
