/**
 * BookMaster Public Booking Form — Multi-Step Wizard
 *
 * Uses CSS custom property --bm-primary for themeable accent color.
 *
 * @package BookMaster
 */

/* ================================================================
   Variables & Container
   ================================================================ */
.bookmaster-booking-form {
	--bm-primary: #2563eb;
	--bm-primary-hover: #1d4ed8;
	--bm-primary-light: #eff6ff;
	--bm-primary-50: #dbeafe;
	--bm-radius: 16px;
	--bm-radius-sm: 10px;
	--bm-radius-xs: 6px;
	--bm-shadow: 0 4px 32px rgba(0, 0, 0, 0.06);
	--bm-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--bm-gray-50: #f9fafb;
	--bm-gray-100: #f3f4f6;
	--bm-gray-200: #e5e7eb;
	--bm-gray-300: #d1d5db;
	--bm-gray-400: #9ca3af;
	--bm-gray-500: #6b7280;
	--bm-gray-600: #4b5563;
	--bm-gray-700: #374151;
	--bm-gray-800: #1f2937;
	--bm-gray-900: #111827;
	--bm-success: #16a34a;
	--bm-danger: #dc2626;
	--bm-paypal: #0070ba;
	--bm-stripe: #635bff;

	font-family: var(--bm-font);
	max-width: 960px;
	margin: 32px auto;
	color: var(--bm-gray-800);
	-webkit-font-smoothing: antialiased;
}

/* ================================================================
   Main Card
   ================================================================ */
.bm-booking-card {
	background: #fff;
	border: 1px solid var(--bm-gray-200);
	border-radius: var(--bm-radius);
	box-shadow: var(--bm-shadow);
	overflow: hidden;
}

/* ================================================================
   Layout: Steps + Summary Sidebar
   ================================================================ */
.bm-booking-layout {
	display: flex;
	min-height: 520px;
}

.bm-booking-main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	padding: 32px 36px 24px;
}

.bm-booking-summary {
	width: 280px;
	flex-shrink: 0;
	background: var(--bm-gray-50);
	border-left: 1px solid var(--bm-gray-200);
	padding: 28px 24px;
}

/* ================================================================
   Stepper
   ================================================================ */
.bm-stepper {
	display: flex;
	align-items: center;
	margin-bottom: 28px;
}

.bm-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	position: relative;
}

.bm-step-circle {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 2px solid var(--bm-gray-300);
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	transition: all 0.3s;
	position: relative;
}

.bm-step-num {
	font-size: 13px;
	font-weight: 600;
	color: var(--bm-gray-400);
}

.bm-step-check {
	display: none;
	color: #fff;
}

.bm-step-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--bm-gray-400);
	text-transform: uppercase;
	letter-spacing: 0.3px;
	white-space: nowrap;
}

/* Active step */
.bm-step.active .bm-step-circle {
	border-color: var(--bm-primary);
	background: var(--bm-primary);
	box-shadow: 0 0 0 4px var(--bm-primary-light);
}

.bm-step.active .bm-step-num {
	color: #fff;
}

.bm-step.active .bm-step-label {
	color: var(--bm-primary);
	font-weight: 700;
}

/* Completed step */
.bm-step.completed .bm-step-circle {
	border-color: var(--bm-primary);
	background: var(--bm-primary);
}

.bm-step.completed .bm-step-num {
	display: none;
}

.bm-step.completed .bm-step-check {
	display: flex;
}

.bm-step.completed .bm-step-label {
	color: var(--bm-primary);
}

/* Step line */
.bm-step-line {
	flex: 1;
	height: 2px;
	background: var(--bm-gray-200);
	margin: 0 4px;
	margin-bottom: 20px;
	transition: background 0.3s;
}

.bm-step.completed + .bm-step-line {
	background: var(--bm-primary);
}

/* ================================================================
   Step Header
   ================================================================ */
.bm-step-header {
	margin-bottom: 24px;
}

.bm-step-title {
	font-size: 22px;
	font-weight: 700;
	color: var(--bm-gray-900);
	margin: 0 0 4px;
}

.bm-step-subtitle {
	font-size: 14px;
	color: var(--bm-gray-500);
	margin: 0;
}

/* ================================================================
   Step Content
   ================================================================ */
.bm-step-content {
	flex: 1;
	overflow-y: auto;
}

/* ================================================================
   Service / Staff List (Step 1 & 2)
   ================================================================ */
.bm-svc-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 340px;
	overflow-y: auto;
	padding-right: 4px;
}

.bm-svc-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	border: 1px solid var(--bm-gray-200);
	border-radius: var(--bm-radius-sm);
	cursor: pointer;
	transition: all 0.2s;
	background: #fff;
}

.bm-svc-item:hover {
	border-color: var(--bm-primary);
	background: var(--bm-primary-light);
}

.bm-svc-item.selected {
	border-color: var(--bm-primary);
	background: var(--bm-primary);
	color: #fff;
}

.bm-svc-item-img {
	width: 44px;
	height: 44px;
	border-radius: var(--bm-radius-xs);
	background: var(--bm-gray-100);
	overflow: hidden;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bm-svc-item-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bm-svc-item-img .bm-svc-item-initial {
	font-size: 16px;
	font-weight: 700;
	color: var(--bm-gray-400);
}

.bm-svc-item.selected .bm-svc-item-initial {
	color: rgba(255, 255, 255, 0.6);
}

.bm-svc-item-info {
	flex: 1;
	min-width: 0;
}

.bm-svc-item-name {
	font-size: 14px;
	font-weight: 600;
	color: var(--bm-gray-800);
	display: block;
}

.bm-svc-item.selected .bm-svc-item-name {
	color: #fff;
}

.bm-svc-item-meta {
	font-size: 12px;
	color: var(--bm-gray-500);
	display: block;
	margin-top: 2px;
}

.bm-svc-item.selected .bm-svc-item-meta {
	color: rgba(255, 255, 255, 0.7);
}

.bm-svc-item-price {
	font-size: 15px;
	font-weight: 700;
	color: var(--bm-primary);
	flex-shrink: 0;
}

.bm-svc-item.selected .bm-svc-item-price {
	color: #fff;
}

/* Staff item avatar */
.bm-staff-item-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.bm-dropdown-loading {
	text-align: center;
	padding: 24px;
	color: var(--bm-gray-400);
	font-size: 13px;
}

/* ================================================================
   Date & Time Layout
   ================================================================ */
.bm-datetime-layout {
	display: flex;
	gap: 24px;
}

.bm-datetime-calendar {
	flex: 0 0 auto;
	width: 260px;
}

.bm-datetime-slots {
	flex: 1;
	min-width: 0;
}

/* ── Mini Calendar ── */
.bm-mini-calendar {
	background: #fff;
	border: 1px solid var(--bm-gray-200);
	border-radius: var(--bm-radius-sm);
	padding: 16px;
}

.bm-cal-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.bm-cal-nav-btn {
	width: 30px;
	height: 30px;
	border: none;
	background: var(--bm-gray-100);
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--bm-gray-500);
	transition: all 0.15s;
}

.bm-cal-nav-btn:hover {
	background: var(--bm-primary-light);
	color: var(--bm-primary);
}

.bm-cal-month-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--bm-gray-800);
}

.bm-cal-weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
	text-align: center;
	margin-bottom: 4px;
}

.bm-cal-weekdays span {
	font-size: 11px;
	font-weight: 600;
	color: var(--bm-gray-400);
	padding: 4px 0;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.bm-cal-days {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
}

.bm-cal-day {
	width: 100%;
	aspect-ratio: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s;
	color: var(--bm-gray-700);
	border: none;
	background: none;
	padding: 0;
	font-family: var(--bm-font);
}

.bm-cal-day:hover:not(.bm-cal-day-disabled):not(.bm-cal-day-empty) {
	background: var(--bm-primary-light);
	color: var(--bm-primary);
}

.bm-cal-day.bm-cal-day-today {
	font-weight: 700;
	color: var(--bm-primary);
}

.bm-cal-day.bm-cal-day-selected {
	background: var(--bm-primary);
	color: #fff;
	font-weight: 700;
}

.bm-cal-day.bm-cal-day-disabled {
	color: var(--bm-gray-300);
	cursor: not-allowed;
}

.bm-cal-day.bm-cal-day-empty {
	cursor: default;
}

/* ── Slots Header ── */
.bm-slots-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
	color: var(--bm-gray-700);
	font-size: 14px;
	font-weight: 600;
}

.bm-slots-header svg {
	color: var(--bm-primary);
}

/* ── Time Slots (card list) ── */
.bm-time-slots {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 320px;
	overflow-y: auto;
	padding-right: 4px;
}

.bm-time-slot-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	border: 1px solid var(--bm-gray-200);
	border-radius: var(--bm-radius-sm);
	cursor: pointer;
	transition: all 0.2s;
	background: #fff;
}

.bm-time-slot-card:hover:not(.bm-slot-booked) {
	border-color: var(--bm-primary);
	background: var(--bm-primary-light);
}

.bm-time-slot-card.selected {
	background: var(--bm-primary);
	color: #fff;
	border-color: var(--bm-primary);
}

.bm-slot-time {
	font-size: 14px;
	font-weight: 600;
	color: var(--bm-gray-800);
}

.bm-time-slot-card.selected .bm-slot-time {
	color: #fff;
}

.bm-slot-right {
	display: flex;
	align-items: center;
	gap: 8px;
}

.bm-slot-duration {
	font-size: 12px;
	color: var(--bm-gray-400);
	font-weight: 500;
}

.bm-time-slot-card.selected .bm-slot-duration {
	color: rgba(255, 255, 255, 0.7);
}

.bm-slot-selected-badge {
	display: none;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	font-weight: 600;
	color: #fff;
}

.bm-time-slot-card.selected .bm-slot-selected-badge {
	display: flex;
}

.bm-time-slot-card.selected .bm-slot-duration {
	display: none;
}

.bm-slot-booked {
	opacity: 0.45;
	cursor: not-allowed;
}

.bm-slot-booked .bm-slot-duration {
	color: var(--bm-gray-400);
}

.bm-slot-booked-label {
	font-size: 12px;
	font-weight: 500;
	color: var(--bm-gray-400);
	font-style: italic;
}

.bm-hint {
	color: var(--bm-gray-400);
	font-size: 13px;
	text-align: center;
	padding: 40px 16px;
}

.bm-loading-text {
	color: var(--bm-gray-400);
	font-size: 13px;
	text-align: center;
	padding: 40px 16px;
}

.bm-no-slots {
	color: var(--bm-danger);
	font-size: 13px;
	text-align: center;
	padding: 24px 16px;
}

/* ================================================================
   Details Form (Step 3/4)
   ================================================================ */
.bm-details-form {
	max-width: 460px;
}

.bm-details-form .bm-form-group {
	margin-bottom: 16px;
}

.bm-details-form label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--bm-gray-700);
	margin-bottom: 6px;
}

.bm-required {
	color: var(--bm-danger);
}

.bm-details-form input,
.bm-details-form textarea {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--bm-gray-200);
	border-radius: var(--bm-radius-xs);
	font-size: 14px;
	font-family: var(--bm-font);
	color: var(--bm-gray-800);
	background: #fff;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
}

.bm-details-form input:focus,
.bm-details-form textarea:focus {
	border-color: var(--bm-primary);
	outline: none;
	box-shadow: 0 0 0 3px var(--bm-primary-light);
}

.bm-details-form input::placeholder,
.bm-details-form textarea::placeholder {
	color: var(--bm-gray-400);
}

.bm-form-row-2 {
	display: flex;
	gap: 12px;
}

.bm-form-row-2 .bm-form-group {
	flex: 1;
}

/* ================================================================
   Payment Options (Step 4/5)
   ================================================================ */
.bm-payment-options {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 460px;
}

.bm-payment-option {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 18px;
	border: 1px solid var(--bm-gray-200);
	border-radius: var(--bm-radius-sm);
	background: #fff;
	cursor: pointer;
	transition: all 0.2s;
	font-family: var(--bm-font);
	text-align: left;
}

.bm-payment-option:hover {
	border-color: var(--bm-primary);
	background: var(--bm-primary-light);
}

.bm-payment-option-icon {
	width: 42px;
	height: 42px;
	border-radius: var(--bm-radius-xs);
	background: var(--bm-gray-100);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--bm-gray-600);
	flex-shrink: 0;
}

.bm-payment-option-info {
	flex: 1;
}

.bm-payment-option-name {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--bm-gray-800);
}

.bm-payment-option-desc {
	display: block;
	font-size: 12px;
	color: var(--bm-gray-500);
	margin-top: 2px;
}

.bm-payment-option-arrow {
	color: var(--bm-gray-300);
	flex-shrink: 0;
}

/* ================================================================
   Step Footer (Back / Next)
   ================================================================ */
.bm-step-footer {
	display: flex;
	align-items: center;
	padding-top: 20px;
	margin-top: auto;
	border-top: 1px solid var(--bm-gray-100);
}

.bm-step-footer-spacer {
	flex: 1;
}

.bm-back-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 16px;
	border: none;
	background: none;
	color: var(--bm-gray-600);
	font-size: 14px;
	font-weight: 500;
	font-family: var(--bm-font);
	cursor: pointer;
	transition: color 0.2s;
	border-radius: var(--bm-radius-xs);
}

.bm-back-btn:hover {
	color: var(--bm-gray-800);
	background: var(--bm-gray-50);
}

.bm-next-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 12px 28px;
	border: none;
	border-radius: var(--bm-radius-sm);
	background: var(--bm-primary);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	font-family: var(--bm-font);
	cursor: pointer;
	transition: all 0.2s;
}

.bm-next-btn:hover {
	background: var(--bm-primary-hover);
}

.bm-next-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ================================================================
   Booking Summary Sidebar
   ================================================================ */
.bm-summary-label {
	font-size: 11px;
	font-weight: 700;
	color: var(--bm-gray-400);
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 20px;
}

.bm-summary-service {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--bm-gray-200);
}

.bm-summary-svc-img {
	width: 52px;
	height: 52px;
	border-radius: var(--bm-radius-xs);
	background: var(--bm-gray-200);
	overflow: hidden;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bm-summary-svc-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bm-summary-svc-info {
	min-width: 0;
}

.bm-summary-svc-info strong {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: var(--bm-gray-900);
	line-height: 1.3;
}

.bm-summary-svc-info span {
	display: block;
	font-size: 12px;
	color: var(--bm-gray-500);
	margin-top: 2px;
}

/* Summary detail rows */
.bm-summary-details {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--bm-gray-200);
}

.bm-summary-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.bm-summary-row-icon {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--bm-gray-100);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	color: var(--bm-gray-500);
}

.bm-summary-row-label {
	display: block;
	font-size: 10px;
	font-weight: 600;
	color: var(--bm-gray-400);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.bm-summary-row-value {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: var(--bm-gray-800);
	margin-top: 1px;
}

/* Pricing */
.bm-summary-pricing {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.bm-summary-price-row {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
	color: var(--bm-gray-500);
}

.bm-summary-price-total {
	display: flex;
	justify-content: space-between;
	font-size: 14px;
	font-weight: 700;
	color: var(--bm-gray-800);
	padding-top: 8px;
	border-top: 1px solid var(--bm-gray-200);
	margin-top: 4px;
}

.bm-summary-price-total span:last-child {
	font-size: 18px;
	color: var(--bm-primary);
}

/* ================================================================
   Trust Badges
   ================================================================ */
.bm-trust-badges {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 24px;
	padding: 16px 0 0;
	flex-wrap: wrap;
}

.bm-trust-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--bm-gray-400);
	font-weight: 500;
}

.bm-trust-badge svg {
	color: var(--bm-gray-300);
}

/* ================================================================
   Success Overlay
   ================================================================ */
.bm-success-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.3);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
}

.bm-success-card {
	background: #fff;
	border-radius: var(--bm-radius);
	padding: 40px 32px;
	text-align: center;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
	max-width: 400px;
	width: 90%;
	animation: bmFadeIn 0.3s ease-out;
	position: relative;
}

@keyframes bmFadeIn {
	from { opacity: 0; transform: scale(0.95); }
	to { opacity: 1; transform: scale(1); }
}

.bm-success-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--bm-success);
	color: #fff;
	font-size: 32px;
	margin-bottom: 16px;
}

.bm-success-close {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 32px;
	height: 32px;
	border: none;
	background: var(--bm-gray-100);
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	color: var(--bm-gray-500);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.15s;
}

.bm-success-close:hover {
	background: #fee2e2;
	color: var(--bm-danger);
}

.bm-success-card h3 {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 8px;
	color: var(--bm-gray-800);
}

.bm-success-card p {
	font-size: 14px;
	color: var(--bm-gray-500);
	margin: 0 0 24px;
}

.bm-success-actions {
	display: flex;
	gap: 10px;
	justify-content: center;
}

.bm-pay-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	border: none;
	border-radius: var(--bm-radius-sm);
	font-size: 14px;
	font-weight: 600;
	font-family: var(--bm-font);
	cursor: pointer;
	transition: all 0.2s;
	white-space: nowrap;
}

.bm-pay-confirm {
	background: var(--bm-primary);
	color: #fff;
}

.bm-pay-confirm:hover {
	background: var(--bm-primary-hover);
}

.bm-success-done {
	background: var(--bm-gray-100) !important;
	color: var(--bm-gray-700) !important;
}

.bm-success-done:hover {
	background: var(--bm-gray-200) !important;
}

/* Button loading spinner */
.bm-btn-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: bm-spin 0.6s linear infinite;
	vertical-align: middle;
}

@keyframes bm-spin {
	to { transform: rotate(360deg); }
}

/* ================================================================
   Error
   ================================================================ */
.bm-error {
	background: #fee2e2;
	color: #991b1b;
	border-radius: var(--bm-radius-sm);
	padding: 12px 16px;
	margin-top: 12px;
	font-size: 13px;
	max-width: 960px;
	margin-left: auto;
	margin-right: auto;
}

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 768px) {
	.bookmaster-booking-form {
		margin: 16px;
	}

	.bm-booking-layout {
		flex-direction: column;
	}

	.bm-booking-main {
		padding: 24px 20px 16px;
	}

	.bm-booking-summary {
		width: 100%;
		border-left: none;
		border-top: 1px solid var(--bm-gray-200);
	}

	.bm-datetime-layout {
		flex-direction: column;
		gap: 16px;
	}

	.bm-datetime-calendar {
		width: 100%;
	}

	.bm-form-row-2 {
		flex-direction: column;
		gap: 0;
	}

	.bm-stepper {
		overflow-x: auto;
		padding-bottom: 4px;
	}

	.bm-step-label {
		font-size: 10px;
	}

	.bm-trust-badges {
		gap: 12px;
	}
}

@media (max-width: 480px) {
	.bm-step-footer {
		flex-wrap: wrap;
		gap: 8px;
	}

	.bm-next-btn {
		width: 100%;
		justify-content: center;
	}
}
