/**
 * Qaiyo Smart Appointment Booking — front-end wizard.
 *
 * Visual identity comes from CSS variables (--qsab-accent, --qsab-radius, font)
 * seeded inline from qsab_branding(); the Pro add-on overrides those to apply a
 * site's custom colour / font / logo. Everything else degrades gracefully to the
 * theme's own typography.
 */

.qsab-booking {
	--qsab-accent: #6c5ce7;
	--qsab-accent-hover: #5a4bd1;
	--qsab-accent-text: #fff;
	--qsab-radius: 12px;
	--qsab-border: #e2e8f0;
	--qsab-border-soft: #eef2f7;
	--qsab-bg-soft: #f8fafc;
	--qsab-text: #0f172a;
	--qsab-text-muted: #64748b;

	max-width: 560px;
	margin: 0 auto;
	color: var(--qsab-text);
	box-sizing: border-box;

	/* Base presentation: a boxed card with soft elevation and a brand-coloured
	   stroke along the bottom edge. Shared by every layout. */
	position: relative;
	background: #fff;
	border-radius: 18px;
	padding: 30px 30px 32px;
	box-shadow:
		0 1px 2px rgba(15, 23, 42, 0.05),
		0 20px 44px -18px rgba(15, 23, 42, 0.18);
	overflow: hidden;
}
.qsab-booking::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 4px;
	background: var(--qsab-accent);
}
.qsab-booking *,
.qsab-booking *::before,
.qsab-booking *::after {
	box-sizing: border-box;
}

.qsab-logo {
	text-align: center;
	margin-bottom: 18px;
}
.qsab-logo img {
	max-height: 56px;
	width: auto;
}

/* Step dots */
.qsab-steps {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0;
	list-style: none;
	padding: 0;
	margin: 0 0 24px;
}
.qsab-step-dot {
	display: flex;
	align-items: center;
	color: var(--qsab-text-muted);
}
.qsab-step-num {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	flex: 0 0 30px;
	border-radius: 50%;
	background: var(--qsab-bg-soft);
	border: 1.5px solid var(--qsab-border);
	font-size: 13px;
	font-weight: 600;
}
/* Step labels: hidden in the wizard layout, shown in steps / calendar. */
.qsab-step-label { display: none; }
.qsab-step-dot:not(:last-child)::after {
	content: "";
	width: 34px;
	height: 2px;
	background: var(--qsab-border);
	margin: 0 4px;
}
.qsab-step-dot.is-active .qsab-step-num,
.qsab-step-dot.is-done .qsab-step-num {
	background: var(--qsab-accent);
	border-color: var(--qsab-accent);
	color: var(--qsab-accent-text);
}

/* Panels */
.qsab-panel {
	display: none;
}
.qsab-panel.is-active {
	display: block;
	animation: qsab-fade 0.25s ease;
}
@keyframes qsab-fade {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

.qsab-h {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 16px;
	color: var(--qsab-text);
}

/* Service cards */
.qsab-services {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.qsab-service-card {
	display: flex;
	align-items: stretch;
	gap: 0;
	width: 100%;
	text-align: left;
	background: #fff;
	border: 1.5px solid var(--qsab-border);
	border-radius: var(--qsab-radius);
	padding: 0;
	cursor: pointer;
	overflow: hidden;
	transition: border-color 0.18s, box-shadow 0.18s;
}
.qsab-service-card:hover {
	border-color: var(--qsab-accent);
}
.qsab-service-card.is-selected {
	border-color: var(--qsab-accent);
	box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}
.qsab-service-bar {
	width: 5px;
	flex: 0 0 5px;
	background: var(--qsab-accent);
}
.qsab-service-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px 16px;
	flex: 1;
}
.qsab-service-name {
	font-size: 15px;
	font-weight: 600;
}
.qsab-service-desc {
	font-size: 13px;
	color: var(--qsab-text-muted);
	line-height: 1.4;
}
.qsab-service-meta {
	display: flex;
	gap: 6px;
	margin-top: 4px;
}
.qsab-pill {
	font-size: 12px;
	font-weight: 600;
	padding: 2px 9px;
	border-radius: 20px;
	background: var(--qsab-bg-soft);
	color: var(--qsab-text-muted);
}
.qsab-pill.qsab-price {
	background: rgba(108, 92, 231, 0.1);
	color: var(--qsab-accent);
}

/* Fields */
.qsab-field-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin: 16px 0 6px;
	color: var(--qsab-text);
}
.qsab-field-label:first-child {
	margin-top: 0;
}
.qsab-req {
	color: #d63638;
}

/*
 * Spam trap. Moved off-screen rather than hidden with display:none or
 * visibility:hidden — bots skip fields those properties hide, and this one
 * needs to look real to them while staying invisible to everyone else.
 */
.qsab-hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.qsab-input,
.qsab-select,
.qsab-textarea {
	width: 100%;
	font-size: 15px;
	padding: 11px 13px;
	border: 1.5px solid var(--qsab-border);
	border-radius: var(--qsab-radius);
	background: #fff;
	color: var(--qsab-text);
	transition: border-color 0.18s, box-shadow 0.18s;
}
.qsab-input:focus,
.qsab-select:focus,
.qsab-textarea:focus {
	outline: none;
	border-color: var(--qsab-accent);
	box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}

/* Time slots */
.qsab-slots {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
	gap: 8px;
	min-height: 44px;
}
.qsab-slot {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	font-size: 14px;
	font-weight: 600;
	padding: 10px 4px;
	text-align: center;
	border: 1.5px solid var(--qsab-border);
	border-radius: var(--qsab-radius);
	background: #fff;
	color: var(--qsab-text);
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.qsab-slot:hover {
	border-color: var(--qsab-accent);
}
.qsab-slot.is-selected {
	background: var(--qsab-accent);
	border-color: var(--qsab-accent);
	color: var(--qsab-accent-text);
}
.qsab-slots-empty,
.qsab-slots-loading {
	grid-column: 1 / -1;
	text-align: center;
	color: var(--qsab-text-muted);
	font-size: 14px;
	padding: 18px 0;
}

/* Summary chip in step 4 */
.qsab-summary {
	background: var(--qsab-bg-soft);
	border: 1px solid var(--qsab-border-soft);
	border-radius: var(--qsab-radius);
	padding: 12px 14px;
	font-size: 14px;
	margin-bottom: 16px;
	line-height: 1.5;
}
.qsab-summary strong {
	color: var(--qsab-accent);
}

/* Nav buttons */
.qsab-nav {
	display: flex;
	gap: 10px;
	margin-top: 22px;
}
.qsab-btn {
	font-size: 15px;
	font-weight: 600;
	padding: 12px 22px;
	border-radius: var(--qsab-radius);
	border: 1.5px solid var(--qsab-border);
	background: #fff;
	color: var(--qsab-text);
	cursor: pointer;
	transition: background 0.18s, border-color 0.18s, opacity 0.18s;
}
.qsab-btn:hover {
	border-color: var(--qsab-accent);
}
.qsab-primary {
	margin-left: auto;
	background: var(--qsab-accent);
	border-color: var(--qsab-accent);
	color: var(--qsab-accent-text);
}
.qsab-primary:hover {
	background: var(--qsab-accent-hover);
	border-color: var(--qsab-accent-hover);
}
.qsab-btn[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Alert */
.qsab-alert {
	background: #fef7f7;
	border: 1px solid #f0c5c6;
	color: #b32d2e;
	border-radius: var(--qsab-radius);
	padding: 11px 14px;
	font-size: 14px;
	margin-bottom: 16px;
}

/* Success */
.qsab-done {
	text-align: center;
	padding: 16px 0;
}
.qsab-done.is-active {
	display: block;
}
.qsab-done-icon {
	width: 72px;
	height: 72px;
	margin: 0 auto 16px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(108, 92, 231, 0.1);
	color: var(--qsab-accent);
}
.qsab-done-msg {
	font-size: 16px;
	line-height: 1.5;
	color: var(--qsab-text);
}

.qsab-credit {
	margin-top: 18px;
	text-align: center;
	font-size: 12px;
	color: var(--qsab-text-muted);
}
.qsab-credit a {
	color: var(--qsab-accent);
	text-decoration: none;
}

.qsab-empty {
	text-align: center;
	padding: 28px 16px;
	color: var(--qsab-text-muted, #64748b);
	background: #f8fafc;
	border-radius: 12px;
}

@media (max-width: 480px) {
	.qsab-step-dot:not(:last-child)::after { width: 18px; }
	.qsab-nav { flex-wrap: wrap; }
}

/* Pro waiting-list offer (rendered when the Pro add-on attaches the payload) */
.qsab-waitlist {
	grid-column: 1 / -1;
	margin-top: 14px;
	padding: 16px;
	border: 1px dashed var(--qsab-border, #d9d6ea);
	border-radius: var(--qsab-radius, 12px);
	background: rgba(108, 92, 231, 0.04);
}
.qsab-waitlist-msg { margin: 0 0 10px; font-size: 14px; }
.qsab-waitlist input {
	display: block;
	width: 100%;
	margin-bottom: 8px;
	padding: 9px 11px;
	border: 1px solid var(--qsab-border, #d9d6ea);
	border-radius: 8px;
	box-sizing: border-box;
	font-size: 14px;
}
.qsab-wl-submit {
	border: 0;
	border-radius: 8px;
	padding: 9px 16px;
	background: var(--qsab-accent, #6c5ce7);
	color: var(--qsab-accent-text, #fff);
	font-weight: 600;
	cursor: pointer;
}
.qsab-wl-submit:hover { background: var(--qsab-accent-hover, #5a4bd1); }
.qsab-wl-feedback { margin-top: 8px; font-size: 13px; color: #d63638; }
.qsab-waitlist-ok { margin: 0; font-size: 14px; color: #00824a; }

/* Inline calendar (replaces the native date input) */
.qsab-cal {
	border: 1.5px solid var(--qsab-border);
	border-radius: var(--qsab-radius);
	padding: 12px 14px;
	background: #fff;
	width: 100%;
}
.qsab-cal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}
.qsab-cal-title { font-weight: 600; font-size: 14px; color: var(--qsab-text); }
.qsab-cal-nav {
	border: 0;
	background: transparent;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	color: var(--qsab-accent);
	padding: 2px 8px;
	border-radius: 6px;
}
.qsab-cal-nav:hover:not(:disabled) { background: rgba(108, 92, 231, 0.1); }
.qsab-cal-nav:disabled { color: #cbd5e1; cursor: default; }
.qsab-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
}
.qsab-cal-weekdays span {
	text-align: center;
	font-size: 11px;
	color: var(--qsab-text-muted);
	padding: 2px 0;
}
.qsab-cal-day {
	width: 100%;
	border: 0;
	background: transparent;
	border-radius: 8px;
	padding: 9px 0;
	font-size: 14px;
	text-align: center;
	cursor: pointer;
	color: var(--qsab-text);
}
.qsab-cal-day:hover:not(:disabled) { background: rgba(108, 92, 231, 0.1); }
.qsab-cal-day:disabled { color: #cbd5e1; cursor: default; }
.qsab-cal-day.is-selected {
	background: var(--qsab-accent);
	color: var(--qsab-accent-text);
	font-weight: 600;
}

/* The summary aside belongs to layouts that use it; hidden unless one does. */
.qsab-aside { display: none; }

/* ---------------------------------------------------------------------------
 * Availability calendar ([qsab_availability])
 * A read-only free/busy view. Shares the booking form's accent variable so it
 * picks up the same theme colour without any extra configuration.
 * ------------------------------------------------------------------------ */
.qsab-avail {
	font-size: 15px;
	color: var(--qsab-text, #0f172a);
}
.qsab-avail-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}
.qsab-avail-title {
	margin: 0;
	font-size: 18px;
}
.qsab-avail-nav {
	display: flex;
	gap: 14px;
	font-size: 14px;
}
.qsab-avail-nav-link {
	color: var(--qsab-accent, #6c5ce7);
	text-decoration: none;
}
.qsab-avail-nav-link:hover,
.qsab-avail-nav-link:focus { text-decoration: underline; }

.qsab-avail-days {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 12px;
}
.qsab-avail-day {
	border: 1px solid var(--qsab-border, #e2e8f0);
	border-radius: 10px;
	padding: 12px;
	background: #fff;
}
.qsab-avail-day.is-closed { background: #f8fafc; }
.qsab-avail-date {
	display: flex;
	flex-direction: column;
	margin-bottom: 8px;
	line-height: 1.3;
}
.qsab-avail-dow {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #64748b;
}
.qsab-avail-dom { font-weight: 600; }

.qsab-avail-slots {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}
.qsab-avail-slot {
	font-size: 13px;
	padding: 3px 8px;
	border-radius: 6px;
	background: rgba(108, 92, 231, 0.1);
	color: var(--qsab-accent, #6c5ce7);
}
.qsab-avail-none {
	margin: 0;
	font-size: 13px;
	color: #94a3b8;
}
