/**
 * Public booking wizard styles for Advanced Appointment Booking Pro.
 * Colors are driven by CSS custom properties generated from Settings > Theme Colors.
 */

:root {
	--aabp-primary: #4f46e5;
	--aabp-secondary: #0ea5e9;
	--aabp-accent: #f59e0b;
	--aabp-button: #4f46e5;
	--aabp-button-hover: #4338ca;
	--aabp-text: #1f2937;
	--aabp-background: #ffffff;
	--aabp-border: #e5e7eb;
	--aabp-success: #16a34a;
	--aabp-danger: #dc2626;
	--aabp-warning: #f59e0b;
	--aabp-input-border: #d1d5db;
	--aabp-input-focus: #4f46e5;
	--aabp-calendar: #4f46e5;
	--aabp-time-slot: #4f46e5;
	--aabp-progress-step: #4f46e5;
}

.aabp-wizard {
	max-width: 780px;
	margin: 0 auto;
	background: var(--aabp-background);
	color: var(--aabp-text);
	border: 1px solid var(--aabp-border);
	border-radius: 18px;
	padding: 28px;
	box-shadow: 0 8px 30px rgba(17, 24, 39, 0.06);
	font-family: inherit;
}

.aabp-wizard * { box-sizing: border-box; }

.aabp-progress {
	display: flex;
	justify-content: space-between;
	margin-bottom: 28px;
	position: relative;
}

.aabp-progress::before {
	content: '';
	position: absolute;
	top: 16px;
	left: 5%;
	right: 5%;
	height: 2px;
	background: var(--aabp-border);
	z-index: 0;
}

.aabp-progress-step {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	flex: 1;
	text-align: center;
}

.aabp-progress-step span {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--aabp-background);
	border: 2px solid var(--aabp-border);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 13px;
	color: #9ca3af;
	transition: all 0.25s ease;
}

.aabp-progress-step label {
	font-size: 11px;
	color: #9ca3af;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

.aabp-progress-step.active span,
.aabp-progress-step.completed span {
	border-color: var(--aabp-progress-step);
	background: var(--aabp-progress-step);
	color: #fff;
}

.aabp-progress-step.active label { color: var(--aabp-text); font-weight: 600; }

.aabp-step { display: none; animation: aabp-fade-in 0.3s ease; }
.aabp-step.active { display: block; }

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

.aabp-step-title {
	margin: 0 0 18px;
	font-size: 19px;
	font-weight: 700;
}

.aabp-wizard-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: var(--aabp-danger);
	padding: 10px 14px;
	border-radius: 10px;
	margin-bottom: 16px;
	font-size: 14px;
}

/* Plans */
.aabp-plans-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
}

.aabp-plan-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 6px;
	border: 2px solid var(--aabp-border);
	border-radius: 14px;
	padding: 18px;
	cursor: pointer;
	transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
	background: var(--aabp-background);
}

.aabp-plan-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(17,24,39,0.08); }

.aabp-plan-card input { position: absolute; opacity: 0; }

.aabp-plan-card.selected {
	border-color: var(--aabp-primary);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.aabp-plan-image { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; }

.aabp-plan-tag {
	position: absolute;
	top: 10px;
	right: 10px;
	font-size: 10px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 999px;
	text-transform: uppercase;
	background: var(--aabp-accent);
	color: #fff;
}

.aabp-plan-tag-popular { background: var(--aabp-success); right: auto; left: 10px; }

.aabp-plan-name { font-weight: 700; font-size: 16px; }
.aabp-plan-desc { font-size: 13px; color: #6b7280; flex-grow: 1; }
.aabp-plan-price { font-size: 20px; font-weight: 800; color: var(--aabp-primary); }
.aabp-plan-price del { font-size: 13px; color: #9ca3af; font-weight: 400; margin-right: 6px; }
.aabp-plan-duration { font-size: 12px; color: #9ca3af; }

/* Calendar & slots */
.aabp-calendar-wrap {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

@media (max-width: 640px) {
	.aabp-calendar-wrap { grid-template-columns: 1fr; }
}

.aabp-calendar-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
	font-weight: 700;
}

.aabp-calendar-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
	text-align: center;
}

.aabp-calendar-grid .aabp-day-label {
	font-size: 11px;
	color: #9ca3af;
	padding-bottom: 4px;
}

.aabp-calendar-day {
	padding: 8px 0;
	border-radius: 8px;
	cursor: pointer;
	font-size: 13px;
	border: 1px solid transparent;
}

.aabp-calendar-day:hover:not(.disabled) { background: rgba(79,70,229,0.08); }
.aabp-calendar-day.disabled { color: #d1d5db; cursor: not-allowed; }
.aabp-calendar-day.selected { background: var(--aabp-calendar); color: #fff; font-weight: 700; }
.aabp-calendar-day.empty { visibility: hidden; }

.aabp-slots { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }

.aabp-slot-btn {
	border: 1px solid var(--aabp-input-border);
	background: var(--aabp-background);
	border-radius: 10px;
	padding: 10px;
	cursor: pointer;
	font-size: 13px;
	text-align: center;
	transition: all 0.15s ease;
}

.aabp-slot-btn:hover:not(:disabled) { border-color: var(--aabp-time-slot); }
.aabp-slot-btn.selected { background: var(--aabp-time-slot); border-color: var(--aabp-time-slot); color: #fff; }
.aabp-slot-btn:disabled { opacity: 0.4; cursor: not-allowed; text-decoration: line-through; }

.aabp-slots-placeholder { color: #9ca3af; font-size: 13px; }

/* Fields */
.aabp-fields-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.aabp-field, .aabp-field-heading, .aabp-field-divider { width: 100%; }
.aabp-w-25 { width: calc(25% - 11px); }
.aabp-w-50 { width: calc(50% - 7px); }
.aabp-w-75 { width: calc(75% - 4px); }
.aabp-w-100 { width: 100%; }

@media (max-width: 560px) {
	.aabp-w-25, .aabp-w-50, .aabp-w-75 { width: 100%; }
}

.aabp-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.aabp-required { color: var(--aabp-danger); }

.aabp-field input[type="text"],
.aabp-field input[type="email"],
.aabp-field input[type="tel"],
.aabp-field input[type="number"],
.aabp-field input[type="url"],
.aabp-field input[type="password"],
.aabp-field input[type="date"],
.aabp-field input[type="time"],
.aabp-field input[type="file"],
.aabp-field select,
.aabp-field textarea {
	width: 100%;
	border: 1px solid var(--aabp-input-border);
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
	font-family: inherit;
	transition: border-color 0.15s ease;
}

.aabp-field input:focus,
.aabp-field select:focus,
.aabp-field textarea:focus {
	outline: none;
	border-color: var(--aabp-input-focus);
	box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

.aabp-inline-choice { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; font-size: 13px; }
.aabp-help-text { font-size: 12px; color: #9ca3af; margin: 4px 0 0; }
.aabp-field-invalid input, .aabp-field-invalid select, .aabp-field-invalid textarea { border-color: var(--aabp-danger) !important; }

/* Summary */
.aabp-summary { border: 1px solid var(--aabp-border); border-radius: 12px; overflow: hidden; }
.aabp-summary-row {
	display: flex;
	justify-content: space-between;
	padding: 12px 16px;
	border-bottom: 1px solid var(--aabp-border);
	font-size: 14px;
}
.aabp-summary-row:last-child { border-bottom: none; }
.aabp-summary-row.total { font-weight: 800; font-size: 17px; background: #f9fafb; }
.aabp-summary-row .label { color: #6b7280; }

/* Buttons */
.aabp-step-actions { display: flex; justify-content: space-between; margin-top: 24px; gap: 10px; }
.aabp-btn {
	border: none;
	border-radius: 10px;
	padding: 12px 22px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.1s ease;
}
.aabp-btn:active { transform: scale(0.98); }
.aabp-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.aabp-btn-primary { background: var(--aabp-button); color: #fff; margin-left: auto; }
.aabp-btn-primary:hover:not(:disabled) { background: var(--aabp-button-hover); }
.aabp-btn-ghost { background: transparent; color: var(--aabp-text); border: 1px solid var(--aabp-border); }

/* Payment step */
.aabp-payment-status { text-align: center; padding: 40px 10px; }
.aabp-spinner {
	width: 36px; height: 36px; margin: 0 auto 16px;
	border: 3px solid var(--aabp-border);
	border-top-color: var(--aabp-primary);
	border-radius: 50%;
	animation: aabp-spin 0.8s linear infinite;
}
@keyframes aabp-spin { to { transform: rotate(360deg); } }

.aabp-payment-status.success .aabp-spinner { display: none; }
.aabp-payment-status.success::before {
	content: '✓';
	display: block;
	width: 56px; height: 56px; line-height: 56px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: var(--aabp-success);
	color: #fff;
	font-size: 26px;
}

.aabp-payment-status.error .aabp-spinner { display: none; }
.aabp-payment-status.error::before {
	content: '!';
	display: block;
	width: 56px; height: 56px; line-height: 56px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: var(--aabp-danger);
	color: #fff;
	font-size: 26px;
	font-weight: 800;
}

.aabp-retry-btn { margin-top: 14px; }

/* Skeleton loading */
.aabp-skeleton {
	background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 37%, #f3f4f6 63%);
	background-size: 400% 100%;
	animation: aabp-skeleton 1.4s ease infinite;
	border-radius: 8px;
	height: 40px;
}
@keyframes aabp-skeleton {
	0% { background-position: 100% 50%; }
	100% { background-position: 0 50%; }
}

.aabp-notice {
	padding: 14px 18px;
	background: #fef3c7;
	border: 1px solid #fde68a;
	border-radius: 10px;
	color: #92400e;
}
