/* Fallback values in case the inline :root block (from Settings > Appearance)
   hasn't loaded for some reason — the wizard should never render unstyled. */
.apr-wizard {
	--apr-primary: var(--apr-primary, #1d4ed8);
	--apr-secondary: var(--apr-secondary, #0ea5e9);
	--apr-bg: var(--apr-bg, #f5f8fc);
	--apr-surface: var(--apr-surface, #ffffff);
	--apr-text: var(--apr-text, #0f172a);
	--apr-text-muted: var(--apr-text-muted, #64748b);
	--apr-btn-text: var(--apr-btn-text, #ffffff);
	--apr-success: var(--apr-success, #059669);
	--apr-error: var(--apr-error, #dc2626);
	--apr-radius: var(--apr-radius, 14px);

	max-width: 780px;
	margin: 0 auto;
	background: var(--apr-bg);
	border-radius: calc(var(--apr-radius) + 6px);
	overflow: hidden;
	box-shadow: 0 10px 40px rgba(15, 23, 42, .08);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--apr-text);
}

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

/* ---------- Header ---------- */

.apr-wizard-header {
	background: linear-gradient(135deg, var(--apr-primary), var(--apr-secondary));
	color: #fff;
	padding: 28px 32px;
	display: flex;
	align-items: center;
	gap: 16px;
}

.apr-wizard-header-icon {
	width: 46px;
	height: 46px;
	flex-shrink: 0;
	background: rgba(255, 255, 255, .18);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.apr-wizard-header-icon svg {
	width: 24px;
	height: 24px;
	color: #fff;
	transform: rotate(45deg);
}

.apr-wizard-title {
	margin: 0;
	font-size: 21px;
	font-weight: 700;
}

.apr-wizard-subtitle {
	margin: 4px 0 0;
	font-size: 13px;
	opacity: .9;
}

/* ---------- Stepper (flight-path progress) ---------- */

.apr-stepper {
	background: var(--apr-surface);
	padding: 22px 32px 16px;
}

.apr-stepper-track {
	position: relative;
	height: 2px;
	background: repeating-linear-gradient(to right, var(--apr-text-muted) 0, var(--apr-text-muted) 6px, transparent 6px, transparent 12px);
	opacity: .35;
	margin: 0 18px 14px;
}

.apr-stepper-progress {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 0%;
	background: var(--apr-primary);
	opacity: 1;
	transition: width .35s ease;
}

.apr-stepper-plane {
	position: absolute;
	top: 50%;
	left: 0%;
	width: 22px;
	height: 22px;
	transform: translate(-50%, -50%);
	color: var(--apr-primary);
	transition: left .35s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	filter: drop-shadow(0 2px 3px rgba(0,0,0,.15));
}

.apr-stepper-plane svg {
	width: 20px;
	height: 20px;
	transform: rotate(90deg);
}

.apr-stepper-items {
	display: flex;
	justify-content: space-between;
}

.apr-step-item {
	background: none;
	border: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	padding: 4px;
	color: var(--apr-text-muted);
	flex: 1;
}

.apr-step-circle {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 2px solid var(--apr-text-muted);
	opacity: .5;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 700;
	color: var(--apr-text-muted);
	background: var(--apr-surface);
	transition: all .2s ease;
}

.apr-step-label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .03em;
	opacity: .6;
}

.apr-step-item.is-active .apr-step-circle {
	border-color: var(--apr-primary);
	background: var(--apr-primary);
	color: var(--apr-btn-text);
	opacity: 1;
}

.apr-step-item.is-active .apr-step-label {
	opacity: 1;
	color: var(--apr-primary);
}

.apr-step-item.is-complete .apr-step-circle {
	border-color: var(--apr-primary);
	background: var(--apr-surface);
	color: var(--apr-primary);
	opacity: 1;
}

.apr-step-item.is-complete .apr-step-label {
	opacity: .85;
}

/* ---------- Form body ---------- */

.apr-wizard-form {
	background: var(--apr-surface);
	padding: 8px 32px 32px;
}

.apr-wizard-step {
	display: none;
	animation: apr-fade-in .25s ease;
}

.apr-wizard-step.is-active {
	display: block;
}

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

.apr-step-heading {
	font-size: 17px;
	margin: 20px 0 4px;
}

.apr-step-subheading {
	font-size: 13px;
	color: var(--apr-text-muted);
	margin: 0 0 16px;
}

.apr-grid {
	display: grid;
	gap: 16px;
	margin-top: 16px;
}

.apr-grid-2 {
	grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 640px) {
	.apr-grid-2 {
		grid-template-columns: 1fr;
	}
}

.apr-field label {
	display: block;
	font-weight: 600;
	font-size: 13px;
	margin-bottom: 6px;
}

.apr-field input[type="text"],
.apr-field input[type="email"],
.apr-field input[type="tel"],
.apr-field input[type="number"],
.apr-field select,
.apr-field textarea {
	width: 100%;
	padding: 11px 12px;
	border: 1.5px solid #e2e8f0;
	border-radius: var(--apr-radius);
	font-size: 14px;
	background: var(--apr-surface);
	color: var(--apr-text);
	transition: border-color .15s ease;
}

.apr-field input:focus,
.apr-field select:focus,
.apr-field textarea:focus {
	outline: none;
	border-color: var(--apr-primary);
}

/* ---------- Custom calendar trigger field ---------- */

.apr-calendar-input-wrap {
	position: relative;
}

.apr-calendar-trigger {
	cursor: pointer;
	padding-right: 40px !important;
}

.apr-calendar-icon {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	color: var(--apr-primary);
	pointer-events: none;
}

.apr-calendar-icon svg {
	width: 100%;
	height: 100%;
}

/* ---------- Services (Step 4) ---------- */

.apr-service-cards {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
	margin-top: 16px;
}

@media (max-width: 640px) {
	.apr-service-cards {
		grid-template-columns: 1fr;
	}
}

.apr-service-card {
	border: 1.5px solid #e2e8f0;
	border-radius: var(--apr-radius);
	padding: 14px 16px;
}

.apr-service-card-title {
	margin: 0 0 10px;
	font-size: 14px;
}

.apr-checkbox-pill {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 400;
	margin: 8px 0;
	cursor: pointer;
}

.apr-checkbox-pill input {
	width: 16px;
	height: 16px;
	accent-color: var(--apr-primary);
}

/* ---------- Review (Step 5) ---------- */

.apr-review-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
	margin: 16px 0 24px;
}

@media (max-width: 640px) {
	.apr-review-grid {
		grid-template-columns: 1fr;
	}
}

.apr-review-card {
	border: 1.5px solid #e2e8f0;
	border-radius: var(--apr-radius);
	padding: 14px 16px;
	position: relative;
}

.apr-review-card-title {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--apr-text-muted);
	font-weight: 700;
	margin: 0 0 8px;
}

.apr-review-card p {
	margin: 2px 0;
	font-size: 13px;
}

.apr-review-edit {
	position: absolute;
	top: 12px;
	right: 14px;
	font-size: 12px;
	font-weight: 600;
	color: var(--apr-primary);
	background: none;
	border: none;
	cursor: pointer;
	text-decoration: underline;
}

.apr-summary {
	background: #eff6ff;
	background: color-mix(in srgb, var(--apr-primary) 6%, var(--apr-surface));
	border: 1px solid #dbeafe;
	border: 1px solid color-mix(in srgb, var(--apr-primary) 20%, transparent);
	border-radius: var(--apr-radius);
	padding: 18px 20px;
}

.apr-summary-row {
	display: flex;
	justify-content: space-between;
	padding: 6px 0;
	font-size: 14px;
}

.apr-summary-total {
	font-weight: 700;
	font-size: 17px;
	border-top: 1px solid #e2e8f0;
	margin-top: 6px;
	padding-top: 12px;
}

.apr-payment-note {
	margin: 12px 0 0;
	font-size: 12px;
	color: var(--apr-text-muted);
}

/* ---------- Messages ---------- */

.apr-availability-message,
.apr-form-message {
	margin-top: 14px;
	padding: 11px 14px;
	border-radius: var(--apr-radius);
	font-size: 13px;
	display: none;
}

.apr-availability-message.apr-ok,
.apr-form-message.apr-ok {
	display: block;
	background: #ecfdf5;
	background: color-mix(in srgb, var(--apr-success) 12%, white);
	border: 1px solid #a7f3d0;
	border: 1px solid color-mix(in srgb, var(--apr-success) 30%, transparent);
	color: var(--apr-success);
}

.apr-availability-message.apr-error,
.apr-form-message.apr-error {
	display: block;
	background: #fef2f2;
	background: color-mix(in srgb, var(--apr-error) 10%, white);
	border: 1px solid #fecaca;
	border: 1px solid color-mix(in srgb, var(--apr-error) 30%, transparent);
	color: var(--apr-error);
}

/* ---------- Nav buttons ---------- */

.apr-wizard-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 28px;
	gap: 12px;
}

.apr-btn {
	border: none;
	border-radius: var(--apr-radius);
	padding: 13px 26px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: opacity .15s ease, transform .1s ease;
}

.apr-btn:active {
	transform: scale(.98);
}

.apr-btn:disabled {
	opacity: .5;
	cursor: not-allowed;
}

.apr-btn-primary {
	background: var(--apr-primary);
	color: var(--apr-btn-text);
	margin-left: auto;
}

.apr-btn-ghost {
	background: none;
	color: var(--apr-text-muted);
	border: 1.5px solid #e2e8f0;
}

.apr-btn-ghost.is-hidden {
	visibility: hidden;
}

#apr-submit-btn {
	display: none;
}

/* ---------- Calendar popover (appended to body by JS) ---------- */

.apr-calendar-popover {
	position: absolute;
	z-index: 9999;
	background: var(--apr-surface, #fff);
	border: 1px solid #e2e8f0;
	border-radius: var(--apr-radius, 14px);
	box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
	padding: 16px;
	width: 300px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	display: none;
}

.apr-calendar-popover.is-open {
	display: block;
}

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

.apr-cal-label {
	font-weight: 700;
	font-size: 14px;
	color: var(--apr-text, #0f172a);
}

.apr-cal-nav {
	background: none;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	width: 30px;
	height: 30px;
	font-size: 16px;
	cursor: pointer;
	color: var(--apr-primary, #1d4ed8);
}

.apr-cal-weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	text-align: center;
	font-size: 11px;
	font-weight: 700;
	color: var(--apr-text-muted, #64748b);
	margin-bottom: 6px;
}

.apr-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
}

.apr-cal-day {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 34px;
	border-radius: 8px;
	font-size: 13px;
	cursor: pointer;
	color: var(--apr-text, #0f172a);
}

.apr-cal-day:hover:not(.is-disabled):not(.is-empty) {
	background: color-mix(in srgb, var(--apr-primary, #1d4ed8) 12%, white);
}

.apr-cal-day.is-empty {
	cursor: default;
}

.apr-cal-day.is-disabled {
	color: #cbd5e1;
	cursor: not-allowed;
}

.apr-cal-day.is-today {
	font-weight: 700;
	box-shadow: inset 0 0 0 1.5px var(--apr-primary, #1d4ed8);
}

.apr-cal-day.is-selected {
	background: var(--apr-primary, #1d4ed8);
	color: var(--apr-btn-text, #fff);
	font-weight: 700;
}

@media (max-width: 640px) {
	.apr-wizard-header,
	.apr-stepper,
	.apr-wizard-form {
		padding-left: 18px;
		padding-right: 18px;
	}
	.apr-step-label {
		display: none;
	}
	.apr-wizard-nav {
		flex-wrap: wrap;
	}
	.apr-btn {
		flex: 1;
	}
}
