/* ==========================================================================
   Doxa Booking — public scheduler
   Scoped to .dxb so nothing leaks into the theme. Falls back to the site's
   --dx-* tokens when the Doxa design system is present.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

.dxb {
	--dxb-accent: var(--dx-primary, #0F4C81);
	--dxb-accent-soft: var(--dx-primary-soft, #EAF1F8);
	--dxb-ink: var(--dx-ink, #16222F);
	--dxb-ink-2: var(--dx-ink-2, #55636F);
	--dxb-ink-3: #8A97A3;
	--dxb-line: var(--dx-line, #E2E8EF);
	--dxb-surface: #FFFFFF;
	--dxb-surface-2: #F7F9FB;
	--dxb-danger: #B4243C;
	--dxb-radius: 14px;
	--dxb-radius-sm: 9px;
	--dxb-shadow: 0 1px 2px rgba(22, 34, 47, .04), 0 14px 40px -18px rgba(22, 34, 47, .22);
	--dxb-font-display: var(--dx-font-display, 'Sora', system-ui, sans-serif);
	--dxb-font-body: var(--dx-font-body, 'Inter', system-ui, sans-serif);

	font-family: var(--dxb-font-body);
	color: var(--dxb-ink);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	container-type: inline-size;
}

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

.dxb-empty {
	padding: 24px;
	border: 1px dashed var(--dxb-line);
	border-radius: var(--dxb-radius);
	color: var(--dxb-ink-2);
	text-align: center;
}

/* ---------- Shell ------------------------------------------------------- */

.dxb-shell {
	display: grid;
	grid-template-columns: minmax(240px, 300px) 1fr;
	background: var(--dxb-surface);
	border: 1px solid var(--dxb-line);
	border-radius: var(--dxb-radius);
	box-shadow: var(--dxb-shadow);
	overflow: hidden;
}

/* ---------- Summary rail ------------------------------------------------ */

.dxb-rail {
	background: var(--dxb-surface-2);
	border-right: 1px solid var(--dxb-line);
	padding: 28px 26px;
	display: flex;
	flex-direction: column;
}

.dxb-rail-brand {
	margin: 0 0 14px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--dxb-accent);
}

.dxb-rail-title {
	margin: 0 0 8px;
	font-family: var(--dxb-font-display);
	font-size: 26px;
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -.01em;
	color: var(--dxb-ink);
}

.dxb-rail-sub {
	margin: 0 0 22px;
	font-size: 14px;
	color: var(--dxb-ink-2);
}

.dxb-summary {
	margin: 0;
	padding: 18px 0 0;
	border-top: 1px solid var(--dxb-line);
	display: grid;
	gap: 14px;
}

.dxb-summary-row { margin: 0; }

.dxb-summary dt {
	margin: 0 0 2px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--dxb-ink-3);
}

.dxb-summary dd {
	margin: 0;
	font-size: 15px;
	font-weight: 500;
	color: var(--dxb-ink);
	transition: color .18s ease;
}

.dxb-summary dd.dxb-pending {
	color: var(--dxb-ink-3);
	font-weight: 400;
}

.dxb-summary-row.is-set dd {
	color: var(--dxb-accent);
	font-weight: 600;
}

.dxb-rail-tz {
	margin: auto 0 0;
	padding-top: 20px;
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--dxb-ink-3);
}

/* ---------- Working pane ------------------------------------------------ */

.dxb-pane { padding: 28px 30px 30px; min-width: 0; }

.dxb-steps {
	list-style: none;
	display: flex;
	gap: 8px;
	margin: 0 0 24px;
	padding: 0;
	counter-reset: dxb-step;
}

.dxb-step {
	counter-increment: dxb-step;
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	font-weight: 500;
	color: var(--dxb-ink-3);
	padding-right: 8px;
}

.dxb-step::before {
	content: counter(dxb-step);
	width: 22px;
	height: 22px;
	flex: 0 0 22px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	border: 1px solid var(--dxb-line);
	background: var(--dxb-surface);
	font-size: 11px;
	font-weight: 600;
	transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.dxb-step.is-active { color: var(--dxb-ink); }

.dxb-step.is-active::before,
.dxb-step.is-done::before {
	background: var(--dxb-accent);
	border-color: var(--dxb-accent);
	color: #fff;
}

.dxb-step.is-done { color: var(--dxb-ink-2); }

.dxb-panel { display: none; }
.dxb-panel.is-active { display: block; animation: dxb-fade .24s ease both; }

@keyframes dxb-fade {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

/* ---------- Form controls ---------------------------------------------- */

.dxb-label {
	display: block;
	margin: 0 0 7px;
	font-size: 13px;
	font-weight: 600;
	color: var(--dxb-ink);
}

.dxb-optional {
	font-weight: 400;
	color: var(--dxb-ink-3);
	font-size: 12px;
	margin-left: 4px;
}

.dxb-select-wrap { position: relative; }

.dxb-select-arrow {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
	color: var(--dxb-ink-2);
}

.dxb-input,
.dxb-select {
	width: 100%;
	font-family: inherit;
	font-size: 15px;
	color: var(--dxb-ink);
	background: var(--dxb-surface);
	border: 1px solid var(--dxb-line);
	border-radius: var(--dxb-radius-sm);
	padding: 12px 14px;
	transition: border-color .16s ease, box-shadow .16s ease;
	appearance: none;
	-webkit-appearance: none;
}

.dxb-select { padding-right: 40px; cursor: pointer; }

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

.dxb-input.dxb-invalid {
	border-color: var(--dxb-danger);
	box-shadow: 0 0 0 3px rgba(180, 36, 60, .1);
}

.dxb-textarea { resize: vertical; min-height: 84px; }

.dxb-type-desc {
	margin: 12px 0 0;
	padding: 12px 14px;
	background: var(--dxb-accent-soft);
	border-radius: var(--dxb-radius-sm);
	font-size: 14px;
	color: var(--dxb-ink-2);
}

.dxb-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.dxb-field-wide { grid-column: 1 / -1; }

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

.dxb-consent {
	margin: 16px 0 0;
	font-size: 12.5px;
	color: var(--dxb-ink-3);
}

.dxb-error {
	margin: 16px 0 0;
	padding: 11px 14px;
	border-radius: var(--dxb-radius-sm);
	background: rgba(180, 36, 60, .07);
	border: 1px solid rgba(180, 36, 60, .2);
	color: var(--dxb-danger);
	font-size: 14px;
}

/* ---------- Buttons ----------------------------------------------------- */

.dxb-actions { margin-top: 24px; display: flex; }
.dxb-actions-split { justify-content: space-between; gap: 12px; }

.dxb-btn {
	font-family: inherit;
	font-size: 14.5px;
	font-weight: 600;
	border-radius: var(--dxb-radius-sm);
	padding: 12px 22px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background .16s ease, color .16s ease, border-color .16s ease, transform .12s ease;
}

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

.dxb-btn-primary { background: var(--dxb-accent); color: #fff; }
.dxb-btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.dxb-btn-primary:active:not(:disabled) { transform: translateY(1px); }

.dxb-btn-ghost {
	background: transparent;
	color: var(--dxb-ink-2);
	border-color: var(--dxb-line);
}

.dxb-btn-ghost:hover { color: var(--dxb-ink); border-color: var(--dxb-ink-3); }

.dxb-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Scheduler --------------------------------------------------- */

.dxb-scheduler {
	display: grid;
	grid-template-columns: 1fr 220px;
	gap: 26px;
	align-items: start;
}

.dxb-cal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.dxb-cal-title {
	margin: 0;
	font-family: var(--dxb-font-display);
	font-size: 16px;
	font-weight: 600;
	color: var(--dxb-ink);
}

.dxb-nav {
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	border-radius: 8px;
	border: 1px solid var(--dxb-line);
	background: var(--dxb-surface);
	color: var(--dxb-ink-2);
	cursor: pointer;
	transition: border-color .16s ease, color .16s ease;
}

.dxb-nav:hover:not(:disabled) { color: var(--dxb-accent); border-color: var(--dxb-accent); }
.dxb-nav:disabled { opacity: .35; cursor: not-allowed; }

.dxb-cal-dow,
.dxb-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 4px;
}

.dxb-cal-dow {
	margin-bottom: 6px;
}

.dxb-cal-dow span {
	text-align: center;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--dxb-ink-3);
	padding: 4px 0;
}

.dxb-day {
	aspect-ratio: 1 / 1;
	min-height: 38px;
	display: grid;
	place-items: center;
	border-radius: var(--dxb-radius-sm);
	border: 1px solid transparent;
	background: transparent;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	color: var(--dxb-ink-3);
	cursor: default;
	position: relative;
	transition: background .14s ease, color .14s ease, border-color .14s ease;
}

.dxb-day.is-open {
	background: var(--dxb-accent-soft);
	color: var(--dxb-accent);
	font-weight: 600;
	cursor: pointer;
}

.dxb-day.is-open:hover { border-color: var(--dxb-accent); }

.dxb-day.is-selected {
	background: var(--dxb-accent);
	color: #fff;
	border-color: var(--dxb-accent);
}

.dxb-day.is-today::after {
	content: '';
	position: absolute;
	bottom: 5px;
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: currentColor;
	opacity: .55;
}

.dxb-day:disabled { cursor: not-allowed; }
.dxb-day.is-empty { visibility: hidden; }

.dxb-cal-loading { opacity: .45; pointer-events: none; }

/* Times column */

.dxb-times-title {
	margin: 0 0 12px;
	font-size: 13px;
	font-weight: 600;
	color: var(--dxb-ink-2);
	min-height: 32px;
	display: flex;
	align-items: center;
}

.dxb-times-list {
	display: grid;
	gap: 7px;
	max-height: 296px;
	overflow-y: auto;
	padding-right: 4px;
	scrollbar-width: thin;
}

.dxb-slot {
	width: 100%;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	padding: 10px 12px;
	border-radius: var(--dxb-radius-sm);
	border: 1px solid var(--dxb-line);
	background: var(--dxb-surface);
	color: var(--dxb-ink);
	cursor: pointer;
	text-align: center;
	transition: border-color .14s ease, background .14s ease, color .14s ease;
}

.dxb-slot:hover { border-color: var(--dxb-accent); color: var(--dxb-accent); }

.dxb-slot.is-selected {
	background: var(--dxb-accent);
	border-color: var(--dxb-accent);
	color: #fff;
}

.dxb-times-note {
	font-size: 13.5px;
	color: var(--dxb-ink-3);
	padding: 14px 0;
}

/* ---------- Confirmation ------------------------------------------------ */

.dxb-done { text-align: center; padding: 26px 0 8px; }

.dxb-check { color: var(--dxb-accent); margin-bottom: 16px; }

.dxb-check-ring {
	stroke-dasharray: 152;
	stroke-dashoffset: 152;
	animation: dxb-draw .5s ease forwards;
}

.dxb-check-mark {
	stroke-dasharray: 40;
	stroke-dashoffset: 40;
	animation: dxb-draw .35s .38s ease forwards;
}

@keyframes dxb-draw { to { stroke-dashoffset: 0; } }

.dxb-done-title {
	margin: 0 0 8px;
	font-family: var(--dxb-font-display);
	font-size: 22px;
	font-weight: 600;
	color: var(--dxb-ink);
}

.dxb-done-body {
	margin: 0 auto 22px;
	max-width: 44ch;
	font-size: 15px;
	color: var(--dxb-ink-2);
}

.dxb-receipt {
	display: inline-grid;
	gap: 10px;
	text-align: left;
	padding: 18px 22px;
	border: 1px solid var(--dxb-line);
	border-radius: var(--dxb-radius-sm);
	background: var(--dxb-surface-2);
	min-width: min(320px, 100%);
}

.dxb-receipt-row { display: flex; justify-content: space-between; gap: 24px; font-size: 14px; }
.dxb-receipt-row span:first-child { color: var(--dxb-ink-3); }
.dxb-receipt-row span:last-child { font-weight: 600; text-align: right; }

/* ---------- Responsive -------------------------------------------------- */

@container (max-width: 860px) {
	.dxb-shell { grid-template-columns: 1fr; }
	.dxb-rail { border-right: none; border-bottom: 1px solid var(--dxb-line); }
	.dxb-scheduler { grid-template-columns: 1fr; }
	.dxb-times-list { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); max-height: none; }
}

@media (max-width: 860px) {
	.dxb-shell { grid-template-columns: 1fr; }
	.dxb-rail { border-right: none; border-bottom: 1px solid var(--dxb-line); padding: 24px 22px; }
	.dxb-rail-tz { margin-top: 18px; }
	.dxb-summary { grid-template-columns: repeat(2, 1fr); display: grid; }
	.dxb-scheduler { grid-template-columns: 1fr; gap: 20px; }
	.dxb-times-list { grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); max-height: none; }
	.dxb-pane { padding: 22px 20px 24px; }
	.dxb-fields { grid-template-columns: 1fr; }
	.dxb-step span { display: none; }
	.dxb-step { padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.dxb *, .dxb *::before, .dxb *::after {
		animation-duration: .001ms !important;
		transition-duration: .001ms !important;
	}
	.dxb-check-ring, .dxb-check-mark { stroke-dashoffset: 0; }
}

/* ---------- Address + directions ---------------------------------------- */

.dxb-summary-address {
	margin: 4px 0 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--dxb-ink-2);
	white-space: pre-line;
}

.dxb-receipt-row span:last-child { white-space: pre-line; }

.dxb-directions {
	display: inline-block;
	margin-top: 4px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--dxb-accent);
	text-decoration: none;
	border-bottom: 1px solid currentColor;
	padding-bottom: 1px;
}

.dxb-directions:hover { opacity: .8; }

/* ---------- Standalone cancellation page -------------------------------- */

body.dxb-standalone {
	margin: 0;
	background: var(--dxb-surface-2, #F7F9FB);
	font-family: 'Inter', system-ui, sans-serif;
}

.dxb-standalone-wrap {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 32px 20px;
}

.dxb-standalone-card {
	width: 100%;
	max-width: 480px;
	background: var(--dxb-surface);
	border: 1px solid var(--dxb-line);
	border-top: 3px solid var(--dxb-accent);
	border-radius: var(--dxb-radius);
	box-shadow: var(--dxb-shadow);
	padding: 32px 30px;
	text-align: center;
}

.dxb-mode-expired { border-top-color: #B4243C; }
.dxb-mode-done { border-top-color: #24A05A; }

.dxb-standalone-title {
	margin: 0 0 10px;
	font-family: var(--dxb-font-display);
	font-size: 23px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--dxb-ink);
}

.dxb-standalone-body {
	margin: 0 0 22px;
	font-size: 15px;
	color: var(--dxb-ink-2);
}

.dxb-receipt-block {
	display: grid;
	text-align: left;
	margin: 0 0 24px;
	width: 100%;
}

.dxb-standalone-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	margin: 0;
}

.dxb-standalone-actions .dxb-btn { text-decoration: none; display: inline-block; }

.dxb-btn-danger { background: #B4243C; color: #fff; }
.dxb-btn-danger:hover { filter: brightness(1.08); }
