/* The Calendar Widget: booking + manage pages (light theme, workspace accent). */

:root {
	--ink: #111317;
	--text: #2a2e35;
	--muted: #5b616e; /* 6.1:1 on white */
	--line: #e3e6eb;
	--line-strong: #c4c9d1;
	--surface: #ffffff;
	--page: #eef0f3;
	--soft: #f6f7f9;
	--danger: #b3372f; /* 5.6:1 on white */
	--ok: #2f855a;
	--radius: 14px;
	--radius-sm: 10px;
	--ease: 160ms ease-out;
	--accent: #111317;
	--accent-ink: #ffffff;
	--accent-text: #111317;
	--accent-soft: #e7e7e8;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	padding: 32px 16px 24px;
	min-height: 100vh;
	background: var(--page);
	color: var(--text);
	font: 400 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.tcw-is-embed, .tcw-is-embed body {
	background: transparent;
	min-height: 0;
}
.tcw-is-embed body { padding: 0; }

h1, h2, h3 {
	font-family: "Sora", "Inter", system-ui, sans-serif;
	color: var(--ink);
	letter-spacing: 0.01em;
	line-height: 1.25;
	margin: 0;
}
h2 { font-size: 1.3rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }

a { color: var(--accent-text); text-underline-offset: 2px; }

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

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

/* Card ------------------------------------------------------------------- */

.tcw-card {
	width: 100%;
	max-width: 880px;
	margin: 0 auto;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: 0 1px 2px rgba(17, 19, 23, 0.04), 0 12px 32px rgba(17, 19, 23, 0.06);
	overflow: hidden;
}
.tcw-is-embed .tcw-card {
	max-width: none;
	border: 0;
	box-shadow: none;
	border-radius: var(--radius);
}

.tcw-card__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 20px;
	border-bottom: 1px solid var(--line);
}
.tcw-logo {
	width: 40px; height: 40px;
	border-radius: 10px;
	object-fit: contain;
	flex: none;
}
.tcw-ws-name {
	flex: 1;
	min-width: 0;
	font-weight: 600;
	color: var(--ink);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tcw-close {
	flex: none;
	display: inline-grid;
	place-items: center;
	width: 40px; height: 40px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	color: var(--ink);
	cursor: pointer;
	transition: background var(--ease), border-color var(--ease);
}
.tcw-close:hover { background: var(--soft); border-color: var(--line-strong); }

.tcw-view {
	padding: 24px 20px 28px;
	outline: none;
}
@media (min-width: 560px) {
	.tcw-view { padding: 28px 32px 32px; }
	.tcw-card__head { padding: 18px 32px; }
}

.tcw-powered {
	text-align: center;
	font-size: 0.8rem;
	color: var(--muted);
	margin-top: 16px;
}
.tcw-powered a { color: var(--muted); }

.tcw-loading {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--muted);
	padding: 24px 0;
}
.tcw-spinner {
	width: 18px; height: 18px;
	border: 2px solid var(--line);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: tcw-spin 800ms linear infinite;
}
@keyframes tcw-spin { to { transform: rotate(360deg); } }

/* Step header ------------------------------------------------------------- */

.tcw-step-head {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 20px;
}
.tcw-step-head__text { flex: 1; min-width: 0; }
.tcw-step-head p { color: var(--muted); margin-top: 4px; }

.tcw-back {
	flex: none;
	display: inline-grid;
	place-items: center;
	width: 36px; height: 36px;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--ink);
	cursor: pointer;
	margin-top: -2px;
}
.tcw-back:hover { background: var(--soft); }

.tcw-progress {
	display: flex;
	gap: 6px;
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
}
.tcw-progress li {
	flex: 1;
	height: 4px;
	border-radius: 999px;
	background: var(--line);
}
.tcw-progress li.is-done { background: var(--accent); }

/* Service list ------------------------------------------------------------ */

.tcw-services {
	display: grid;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}
@media (min-width: 640px) {
	.tcw-services { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
.tcw-service {
	display: flex;
	flex-direction: column;
	gap: 6px;
	width: 100%;
	height: 100%;
	text-align: left;
	padding: 16px 18px;
	border: 1.5px solid var(--line-strong);
	border-color: color-mix(in srgb, var(--svc, var(--accent)) 55%, var(--surface));
	border-radius: var(--radius);
	background: var(--surface);
	color: inherit;
	font: inherit;
	cursor: pointer;
	transition: border-color var(--ease), box-shadow var(--ease), background-color var(--ease);
}
.tcw-service:hover,
.tcw-service:focus-visible {
	border-color: var(--svc, var(--accent));
	background: color-mix(in srgb, var(--svc, var(--accent)) 4%, var(--surface));
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--svc, var(--accent)) 16%, transparent);
	outline: none;
}
.tcw-service__name { font-weight: 600; color: var(--ink); font-size: 1rem; }
.tcw-service__desc { color: var(--muted); font-size: 0.9rem; }
.tcw-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	color: var(--muted);
	font-size: 0.85rem;
	margin: 0;
	padding: 0;
	list-style: none;
}
.tcw-meta li { display: inline-flex; align-items: center; gap: 6px; }
.tcw-meta svg { flex: none; }

/* Date + time picker ------------------------------------------------------ */

.tcw-picker {
	display: grid;
	gap: 24px;
}
@media (min-width: 640px) {
	.tcw-picker { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; }
}

.tcw-month__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 12px;
}
.tcw-month__title { font-size: 1rem; }
.tcw-month__nav { display: flex; gap: 6px; }

.tcw-icon-btn {
	display: inline-grid;
	place-items: center;
	width: 36px; height: 36px;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--ink);
	cursor: pointer;
}
.tcw-icon-btn:hover:not(:disabled) { background: var(--soft); }
.tcw-icon-btn:disabled { color: var(--line-strong); cursor: not-allowed; }

.tcw-grid {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}
.tcw-grid th {
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--muted);
	padding: 0 0 8px;
	text-align: center;
}
.tcw-grid td { padding: 2px; text-align: center; }
.tcw-day {
	width: 100%;
	max-width: 44px;
	aspect-ratio: 1;
	min-height: 36px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-size: 0.9rem;
	cursor: default;
	position: relative;
}
.tcw-day.is-open {
	background: var(--accent-soft);
	color: var(--accent-text);
	font-weight: 600;
	cursor: pointer;
}
.tcw-day.is-open:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.tcw-day[aria-pressed="true"] {
	background: var(--accent);
	color: var(--accent-ink);
}
.tcw-day.is-today::after {
	content: "";
	position: absolute;
	left: 50%; bottom: 4px;
	width: 4px; height: 4px;
	margin-left: -2px;
	border-radius: 50%;
	background: currentColor;
}
.tcw-day:disabled { color: #8a909b; }

.tcw-times__head { margin-bottom: 12px; }
.tcw-times__head h3 { font-size: 1rem; }
.tcw-tz {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	font-size: 0.85rem;
	color: var(--muted);
	margin-top: 6px;
}
.tcw-tz select {
	max-width: 100%;
	font: inherit;
	font-size: 0.85rem;
	color: var(--ink);
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 4px 6px;
	background: var(--surface);
}
.tcw-slots {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
	max-height: 360px;
	overflow-y: auto;
	padding-right: 2px;
}
.tcw-slot {
	width: 100%;
	padding: 10px 8px;
	border: 1px solid var(--accent);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--accent-text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background var(--ease), color var(--ease);
}
.tcw-slot small {
	display: block;
	font-weight: 400;
	font-size: 0.75rem;
	color: var(--muted);
}
.tcw-slot:hover, .tcw-slot[aria-pressed="true"] {
	background: var(--accent);
	color: var(--accent-ink);
}
.tcw-slot:hover small, .tcw-slot[aria-pressed="true"] small { color: inherit; }

.tcw-empty {
	padding: 20px;
	border: 1px dashed var(--line-strong);
	border-radius: var(--radius-sm);
	color: var(--muted);
	text-align: center;
}

/* Forms ------------------------------------------------------------------- */

.tcw-form { display: grid; gap: 16px; }
@media (min-width: 640px) {
	.tcw-form--two { grid-template-columns: 1fr 1fr; }
	.tcw-form--two .tcw-span { grid-column: 1 / -1; }
}
.tcw-field { display: grid; gap: 6px; align-content: start; }
.tcw-field label, .tcw-label {
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--ink);
}
.tcw-field .tcw-opt { font-weight: 400; color: var(--muted); }
.tcw-field input, .tcw-field select, .tcw-field textarea {
	width: 100%;
	font: inherit;
	color: var(--ink);
	background: var(--surface);
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-sm);
	padding: 11px 12px;
	transition: border-color var(--ease), box-shadow var(--ease);
}
.tcw-field textarea { min-height: 96px; resize: vertical; }
.tcw-field input:focus, .tcw-field select:focus, .tcw-field textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 2px var(--accent);
}
.tcw-field [aria-invalid="true"] { border-color: var(--danger); }
.tcw-hint { font-size: 0.8rem; color: var(--muted); }
.tcw-err { font-size: 0.85rem; color: var(--danger); font-weight: 500; }

.tcw-alert {
	padding: 12px 14px;
	border-radius: var(--radius-sm);
	background: #fdf0ef;
	border: 1px solid #f1c6c2;
	color: var(--danger);
	margin-bottom: 16px;
}
.tcw-alert--ok { background: #eef8f2; border-color: #bfe3cf; color: #23663f; }

.tcw-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 20px;
}

.tcw-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 20px;
	border-radius: 999px;
	border: 1px solid var(--accent);
	background: var(--accent);
	color: var(--accent-ink);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: filter var(--ease), background var(--ease);
}
.tcw-btn:hover { filter: brightness(0.94); }
.tcw-btn:disabled { opacity: 0.6; cursor: progress; }
.tcw-btn--ghost {
	background: var(--surface);
	color: var(--ink);
	border-color: var(--line-strong);
}
.tcw-btn--ghost:hover { background: var(--soft); filter: none; }
.tcw-btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.tcw-btn--block { width: 100%; }

/* Summary + success ------------------------------------------------------- */

.tcw-summary {
	display: grid;
	gap: 10px;
	margin: 0 0 4px;
	padding: 16px 18px;
	background: var(--soft);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}
.tcw-summary div {
	display: grid;
	grid-template-columns: 110px 1fr;
	gap: 12px;
}
.tcw-summary dt { color: var(--muted); font-size: 0.9rem; }
.tcw-summary dd { margin: 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 380px) {
	.tcw-summary div { grid-template-columns: 1fr; gap: 0; }
}

.tcw-done { text-align: center; }
.tcw-done__icon {
	display: inline-grid;
	place-items: center;
	width: 56px; height: 56px;
	border-radius: 50%;
	background: var(--accent);
	color: var(--accent-ink);
	margin-bottom: 14px;
}
.tcw-done h2 { margin-bottom: 6px; }
.tcw-done > p { color: var(--muted); margin-bottom: 20px; }
.tcw-done .tcw-summary { text-align: left; }
.tcw-done .tcw-actions { justify-content: center; }

.tcw-status {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 600;
	background: var(--soft);
	border: 1px solid var(--line);
	color: var(--ink);
}
.tcw-status--cancelled { color: var(--danger); border-color: #f1c6c2; background: #fdf0ef; }
.tcw-status--confirmed { color: #23663f; border-color: #bfe3cf; background: #eef8f2; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation-duration: 1ms !important; }
}

/* Headings get focus programmatically so screen readers announce each step; no ring needed. */
[tabindex="-1"]:focus { outline: none; }
