/**
 * Slotify booking wizard – step-by-step form
 * Mobile-friendly, accessible, no external dependencies.
 */

/* ---- Layout ---- */
.slotify-booking-wizard {
	--slotify-max: 100%;
	--slotify-radius: 10px;
	--slotify-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	--slotify-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.1);
	--slotify-primary: #2563eb;
	--slotify-primary-hover: #1d4ed8;
	--slotify-primary-focus: rgba(37, 99, 235, 0.25);
	--slotify-secondary: #64748b;
	--slotify-border: #e2e8f0;
	--slotify-bg: #f8fafc;
	--slotify-text: #1e293b;
	--slotify-text-muted: #64748b;
	--slotify-success: #059669;
	--slotify-error: #dc2626;
	--slotify-focus-ring: 2px solid var(--slotify-primary);

	width: var(--slotify-max);
	max-width: 100%;
	margin: 1.5rem 0;
	padding: 0 1rem;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, sans-serif;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--slotify-text);
	box-sizing: border-box;
}

.slotify-booking-wizard *,
.slotify-booking-wizard *::before,
.slotify-booking-wizard *::after {
	box-sizing: border-box;
}

/* ---- Progress steps ---- */
.slotify-wizard-steps {
	margin-bottom: 1.5rem;
}

.slotify-wizard-steps__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: step;
}

.slotify-wizard-steps__item {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	flex: 1;
	min-width: 0;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--slotify-text-muted);
	transition: color 0.2s ease;
}

.slotify-wizard-steps__item[aria-current="step"] {
	color: var(--slotify-primary);
}

.slotify-wizard-steps__item.is-completed {
	color: var(--slotify-success);
}

.slotify-wizard-steps__number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	background: var(--slotify-border);
	color: var(--slotify-text-muted);
	font-size: 0.875rem;
	flex-shrink: 0;
	transition: background 0.2s ease, color 0.2s ease;
}

.slotify-wizard-steps__item[aria-current="step"] .slotify-wizard-steps__number {
	background: var(--slotify-primary);
	color: #fff;
}

.slotify-wizard-steps__item.is-completed .slotify-wizard-steps__number {
	background: var(--slotify-success);
	color: #fff;
}

.slotify-wizard-steps__label {
	flex: 1;
	min-width: 0;
	white-space: normal;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

@media (max-width: 480px) {
	.slotify-wizard-steps__label {
		display: none;
	}
	.slotify-wizard-steps__item {
		justify-content: center;
	}
}

/* ---- Panels: no-js show all, with JS show only active ---- */
.slotify-booking-wizard.no-js .slotify-wizard__panel {
	display: block;
	margin-bottom: 1.5rem;
}

.slotify-booking-wizard.no-js .slotify-wizard-actions {
	display: none;
}

.slotify-booking-wizard:not(.no-js) .slotify-wizard__panel {
	display: none;
}

.slotify-booking-wizard:not(.no-js) .slotify-wizard__panel.is-active {
	display: block;
	animation: slotify-fadeIn 0.25s ease;
}

@keyframes slotify-fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* ---- Card ---- */
.slotify-wizard-card {
	background: #fff;
	border-radius: var(--slotify-radius);
	box-shadow: var(--slotify-shadow);
	padding: 1.5rem;
	margin-bottom: 1rem;
	border: 1px solid var(--slotify-border);
}

.slotify-wizard-card__title {
	margin: 0 0 1.25rem;
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--slotify-text);
}

/* ---- Fields ---- */
.slotify-wizard-field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin-bottom: 1rem;
}

.slotify-wizard-field:last-child {
	margin-bottom: 0;
}

.slotify-wizard-field label {
	font-weight: 500;
	color: var(--slotify-text);
}

.slotify-wizard-required {
	color: var(--slotify-error);
}

.slotify-booking-wizard select,
.slotify-booking-wizard input[type="text"],
.slotify-booking-wizard input[type="email"],
.slotify-booking-wizard input[type="tel"],
.slotify-booking-wizard input[type="date"] {
	width: 100%;
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--slotify-border);
	border-radius: 8px;
	background: #fff;
	font-size: 1rem;
	font-family: inherit;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.slotify-booking-wizard select:focus,
.slotify-booking-wizard input:focus {
	outline: none;
	border-color: var(--slotify-primary);
	box-shadow: 0 0 0 3px var(--slotify-primary-focus);
}

.slotify-booking-wizard select:disabled,
.slotify-booking-wizard input:disabled {
	background: var(--slotify-bg);
	color: var(--slotify-text-muted);
	cursor: not-allowed;
}

.slotify-wizard-field input.is-invalid {
	border-color: var(--slotify-error);
}

.slotify-wizard-error {
	font-size: 0.875rem;
	color: var(--slotify-error);
	min-height: 1.25rem;
}

/* ---- Fieldset (Staff) ---- */
.slotify-wizard-fieldset {
	border: none;
	margin: 0 0 1rem;
	padding: 0;
}

.slotify-wizard-legend {
	font-weight: 500;
	color: var(--slotify-text);
	margin-bottom: 0.75rem;
	display: block;
}

.slotify-wizard-staff-choice {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: 0.75rem;
}

.slotify-wizard-radio-wrap {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.slotify-wizard-radio-wrap input[type="radio"] {
	width: 1.125rem;
	height: 1.125rem;
	accent-color: var(--slotify-primary);
}

.slotify-wizard-radio-wrap label {
	margin: 0;
	font-weight: 500;
	cursor: pointer;
}

.slotify-wizard-staff-select-wrap {
	margin-top: 0.75rem;
}

.slotify-wizard-staff-select-wrap select {
	width: 100%;
	max-width: 20rem;
}

/* Staff cards (when photos enabled) */
.slotify-wizard-staff-cards {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1rem;
}

.slotify-wizard-staff-cards[hidden] {
	display: none !important;
}

.slotify-wizard-staff-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	padding: 0.6rem;
	min-width: 5rem;
	border: 2px solid var(--slotify-border);
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	font-size: 0.875rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.slotify-wizard-staff-card:hover {
	border-color: var(--slotify-secondary);
}

.slotify-wizard-staff-card.is-selected {
	border-color: var(--slotify-primary);
	box-shadow: 0 0 0 1px var(--slotify-primary);
}

.slotify-wizard-staff-card__photo {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--slotify-bg);
}

.slotify-wizard-staff-card__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.slotify-wizard-staff-card__photo--placeholder {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--slotify-text-muted);
}

.slotify-wizard-staff-card__name {
	text-align: center;
	line-height: 1.2;
	color: var(--slotify-text);
	font-weight: 500;
}

/* ---- Slots ---- */
.slotify-wizard-slots-wrap {
	margin-top: 1rem;
}

.slotify-wizard-slots-label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 500;
}

.slotify-wizard-slots-loading {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem;
	color: var(--slotify-text-muted);
	font-size: 0.875rem;
}

.slotify-wizard-slots-loading[hidden] {
	display: none !important;
}

.slotify-wizard-slots-loading::before {
	content: "";
	width: 1.25rem;
	height: 1.25rem;
	border: 2px solid var(--slotify-border);
	border-top-color: var(--slotify-primary);
	border-radius: 50%;
	animation: slotify-spin 0.7s linear infinite;
}

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

.slotify-wizard-slots-empty {
	padding: 1rem;
	text-align: center;
	color: var(--slotify-text-muted);
	font-size: 0.875rem;
	background: var(--slotify-bg);
	border-radius: 8px;
}

.slotify-wizard-slots {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.slotify-wizard-slot {
	display: inline-block;
	padding: 0.5rem 1rem;
	border: 2px solid var(--slotify-border);
	border-radius: 999px;
	background: #fff;
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--slotify-text);
	cursor: pointer;
	transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.slotify-wizard-slot:hover:not(:disabled) {
	border-color: var(--slotify-primary);
	background: var(--slotify-bg);
}

.slotify-wizard-slot.is-selected {
	border-color: var(--slotify-primary);
	background: var(--slotify-primary);
	color: #fff;
}

.slotify-wizard-slot:focus {
	outline: none;
	box-shadow: 0 0 0 3px var(--slotify-primary-focus);
}

.slotify-wizard-slot:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ---- Summary (Review) ---- */
.slotify-wizard-summary {
	background: var(--slotify-bg);
	border-radius: 8px;
	padding: 1.25rem;
	margin-bottom: 1.25rem;
	font-size: 0.9375rem;
}

.slotify-wizard-summary__row {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.35rem 0;
	border-bottom: 1px solid var(--slotify-border);
}

.slotify-wizard-summary__row:last-child {
	border-bottom: none;
}

.slotify-wizard-summary__label {
	color: var(--slotify-text-muted);
	font-weight: 500;
}

.slotify-wizard-summary__value {
	color: var(--slotify-text);
	text-align: right;
}

/* ---- Buttons ---- */
.slotify-wizard-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.25rem;
	justify-content: space-between;
}

.slotify-wizard-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.625rem 1.25rem;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 500;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
	border: none;
	min-height: 2.75rem;
}

.slotify-wizard-btn:focus {
	outline: none;
	box-shadow: 0 0 0 3px var(--slotify-primary-focus);
}

.slotify-wizard-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.slotify-wizard-btn--primary {
	background: var(--slotify-primary);
	color: #fff;
}

.slotify-wizard-btn--primary:hover:not(:disabled) {
	background: var(--slotify-primary-hover);
}

.slotify-wizard-btn--secondary {
	background: #fff;
	color: var(--slotify-secondary);
	border: 1px solid var(--slotify-border);
}

.slotify-wizard-btn--secondary:hover:not(:disabled) {
	background: var(--slotify-bg);
	border-color: var(--slotify-secondary);
}

.slotify-wizard-submit-wrap {
	margin-top: 0.5rem;
}

.slotify-wizard-submit-wrap .slotify-wizard-btn {
	min-width: 10rem;
}

.slotify-wizard-spinner {
	display: inline-block;
	width: 1.25rem;
	height: 1.25rem;
	border: 2px solid rgba(255,255,255,0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: slotify-spin 0.7s linear infinite;
}

.slotify-wizard-spinner[hidden] {
	display: none !important;
}

/* ---- Message ---- */
.slotify-wizard-message {
	margin-top: 1rem;
	padding: 0.75rem 1rem;
	border-radius: 8px;
	font-size: 0.9375rem;
	min-height: 2.5rem;
}

.slotify-wizard-message.is-success {
	background: #d1fae5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}

.slotify-wizard-message.is-error {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

/* ---- Accessibility ---- */
.slotify-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.slotify-wizard-noscript {
	margin-top: 1rem;
	padding: 0.75rem 1rem;
	background: #fef3c7;
	border: 1px solid #f59e0b;
	border-radius: 8px;
	color: #92400e;
	font-size: 0.9375rem;
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
	.slotify-booking-wizard {
		padding: 0 0.75rem;
		font-size: 16px; /* prevents zoom on focus on iOS */
	}
	.slotify-wizard-card {
		padding: 1.25rem;
	}
	.slotify-wizard-slots {
		justify-content: center;
	}
}
