/**
 * ResBook Frontend Form CSS
 * White minimal clean and professional theme.
 */

:root {
	--resb-neutral-dark:   #1a1a1a;
	--resb-neutral-light:  #f9f9f9;
	--resb-neutral-border: #e0e0e0;
	--resb-text-main:      #333333;
	--resb-text-muted:     #666666;
	--resb-error-color:    #d93025;
	--resb-success-color:  #188038;
	--resb-radius-main:    8px;
	--resb-radius-sm:      6px;
	--resb-font-stack:     -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ── Container ───────────────────────────────────────────────────────────────── */

.resb-form-wrap {
	font-family: var(--resb-font-stack);
	color: var(--resb-text-main);
	max-width: 600px;
	margin: 0 auto;
	padding: 24px;
	background: #ffffff;
	border: 1px solid var(--resb-neutral-border);
	border-radius: var(--resb-radius-main);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
	box-sizing: border-box;
}

.resb-form-wrap * {
	box-sizing: border-box;
}

/* ── Progress Bar ───────────────────────────────────────────────────────────── */

.resb-progress {
	position: relative;
	margin-bottom: 32px;
	padding: 0 10px;
}

.resb-progress__track {
	position: absolute;
	top: 14px;
	left: 10px;
	right: 10px;
	height: 3px;
	background: #f0f0f0;
	z-index: 1;
	border-radius: 2px;
}

.resb-progress__fill {
	height: 100%;
	background: var(--resb-neutral-dark);
	width: 0%;
	transition: width 0.3s ease;
	border-radius: 2px;
}

.resb-progress__dots {
	position: relative;
	display: flex;
	justify-content: space-between;
	z-index: 2;
}

.resb-progress__dot {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #ffffff;
	border: 2px solid var(--resb-neutral-border);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	color: var(--resb-text-muted);
	transition: all 0.3s ease;
}

.resb-progress__dot.is-active {
	border-color: var(--resb-neutral-dark);
	color: var(--resb-neutral-dark);
	box-shadow: 0 0 0 4px rgba(26, 26, 26, 0.08);
}

.resb-progress__dot.is-complete {
	background: var(--resb-neutral-dark);
	border-color: var(--resb-neutral-dark);
	color: #ffffff;
}

.resb-progress__labels {
	display: flex;
	justify-content: space-between;
	margin-top: 8px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--resb-text-muted);
}

.resb-progress__labels span {
	width: 132px;
	text-align: center;
}

.resb-progress__labels span:first-child {
	text-align: left;
}

.resb-progress__labels span:last-child {
	text-align: right;
}

/* ── Step Panels ────────────────────────────────────────────────────────────── */

/* ── Step Panels ────────────────────────────────────────────────────────────── */

.resb-step-panel {
	display: none;
}

.resb-step-panel.is-active {
	display: flex;
	flex-wrap: wrap;
	row-gap: 14px;
	column-gap: 16px;
	animation: resbFadeIn 0.25s ease;
}

@keyframes resbFadeIn {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ── Fields & Labels ────────────────────────────────────────────────────────── */

.resb-field-group {
	margin-bottom: 0;
}

.resb-field-group--100 {
	width: 100%;
}

.resb-field-group--50 {
	width: calc(50% - 8px);
}

@media (max-width: 480px) {
	.resb-field-group--50 {
		width: 100%;
	}
}

.resb-label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	color: var(--resb-neutral-dark);
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	text-align: left;
}

.resb-required {
	color: var(--resb-error-color);
	margin-left: 2px;
}

.resb-input {
	display: block;
	width: 100%;
	height: 40px;
	padding: 0 12px;
	border: 1px solid #cbd5e1;
	border-radius: 4px;
	font-size: 14px;
	color: var(--resb-text-main);
	background-color: #ffffff;
	transition: border-color 0.15s ease-in-out;
	box-shadow: none;
}

.resb-input:focus {
	outline: none;
	border-color: var(--resb-neutral-dark);
}

.resb-input.resb-input--error {
	border-color: var(--resb-error-color);
	background-color: #fff8f8;
}

.resb-textarea {
	display: block;
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 4px;
	font-size: 14px;
	font-family: inherit;
	color: var(--resb-text-main);
	background-color: #ffffff;
	resize: vertical;
	transition: border-color 0.15s ease-in-out;
	box-shadow: none;
}

.resb-textarea:focus {
	outline: none;
	border-color: var(--resb-neutral-dark);
}

.resb-field-error {
	font-size: 12px;
	color: var(--resb-error-color);
	margin-top: 4px;
	min-height: 0;
	text-align: left;
}

.resb-field-error:empty {
	display: none;
}

/* ── Inline Calendar ────────────────────────────────────────────────────────── */

.resb-inline-calendar {
	width: 100%;
	margin-bottom: 20px;
}

/* ── Time Slots Grid ────────────────────────────────────────────────────────── */

.resb-time-slots-wrap {
	min-height: 50px;
}

.resb-time-placeholder,
.resb-slots-loading,
.resb-no-slots {
	font-size: 13px;
	color: var(--resb-text-muted);
	background: var(--resb-neutral-light);
	border: 1px solid var(--resb-neutral-border);
	padding: 12px 14px;
	border-radius: var(--resb-radius-sm);
	margin: 0;
	display: flex;
	align-items: center;
	gap: 8px;
}

.resb-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(0, 0, 0, 0.1);
	border-top-color: var(--resb-neutral-dark);
	border-radius: 50%;
	animation: resbSpin 0.6s linear infinite;
}

@keyframes resbSpin {
	to { transform: rotate(360deg); }
}

.resb-slot-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: 8px;
}

.resb-slot-pill {
	position: relative;
}

.resb-slot-pill input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.resb-slot-pill__label {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 40px;
	border: 1px solid var(--resb-neutral-border);
	border-radius: var(--resb-radius-sm);
	font-size: 13px;
	font-weight: 600;
	color: var(--resb-text-main);
	background: #ffffff;
	cursor: pointer;
	transition: all 0.2s ease;
	user-select: none;
}

.resb-slot-pill__label:hover {
	border-color: var(--resb-neutral-dark);
	background: var(--resb-neutral-light);
}

.resb-slot-pill input[type="radio"]:checked ~ .resb-slot-pill__label {
	background: var(--resb-neutral-dark);
	border-color: var(--resb-neutral-dark);
	color: #ffffff;
}

.resb-slot-pill input[type="radio"]:focus-visible ~ .resb-slot-pill__label {
	outline: 2px solid var(--resb-neutral-dark);
	outline-offset: 2px;
}

/* ── Navigation ─────────────────────────────────────────────────────────────── */

.resb-nav {
	display: flex;
	justify-content: space-between;
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid var(--resb-neutral-border);
}

.resb-nav button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 42px;
	padding: 0 20px;
	font-size: 14px;
	font-weight: 600;
	border-radius: var(--resb-radius-sm);
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: inherit;
}

.resb-nav__prev {
	background: none;
	border: 1px solid var(--resb-neutral-border);
	color: var(--resb-text-muted);
}

.resb-nav__prev:hover {
	border-color: var(--resb-neutral-dark);
	color: var(--resb-neutral-dark);
	background: var(--resb-neutral-light);
}

.resb-nav__next,
.resb-nav__submit {
	background: var(--resb-neutral-dark);
	border: none;
	color: #ffffff;
	margin-left: auto; /* Push to right when back is hidden */
}

.resb-nav__next:hover,
.resb-nav__submit:hover {
	background: #333333;
}

.resb-nav__submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.resb-submit__loader {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.2);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: resbSpin 0.6s linear infinite;
	margin-left: 8px;
}

.resb-submit-btn--loading .resb-submit__loader {
	display: inline-block;
}

.resb-submit-btn--loading .resb-submit__text {
	opacity: 0.8;
}

/* ── Global Messages ─────────────────────────────────────────────────────────── */

.resb-global-message {
	margin-top: 16px;
	font-size: 13px;
	border-radius: var(--resb-radius-sm);
	padding: 12px 14px;
	display: none;
	font-weight: 500;
}

.resb-global-message.resb-global-message--error {
	display: block;
	background: #fdf2f2;
	border: 1px solid #f8b4b4;
	color: #9b1c1c;
}

.resb-global-message.resb-global-message--success {
	display: block;
	background: #f3faf7;
	border: 1px solid #def7ec;
	color: #03543f;
}

/* ── Flatpickr LIGHT overrides (Professional White Theme) ────────────────────── */

.flatpickr-calendar {
	background: #ffffff !important;
	border: 1px solid var(--resb-neutral-border) !important;
	border-radius: var(--resb-radius-main) !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box !important;
}

.flatpickr-innerContainer {
	width: 100% !important;
}

.flatpickr-rContainer {
	width: 100% !important;
	max-width: 100% !important;
}

.flatpickr-days {
	width: 100% !important;
	max-width: 100% !important;
}

.dayContainer {
	width: 100% !important;
	min-width: 100% !important;
	max-width: 100% !important;
	display: flex !important;
	flex-wrap: wrap !important;
	justify-content: space-around !important;
}

.flatpickr-day {
	width: 14.28% !important;
	max-width: none !important;
	height: 38px !important;
	line-height: 38px !important;
	border-radius: var(--resb-radius-sm) !important;
	margin: 2px 0 !important;
	border-color: transparent !important;
	color: var(--resb-text-main) !important;
	font-weight: 500 !important;
}

.flatpickr-day:hover {
	background: var(--resb-neutral-light) !important;
	border-color: transparent !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
	background: var(--resb-neutral-dark) !important;
	color: #ffffff !important;
	border-color: transparent !important;
}

.flatpickr-day.today {
	border-color: var(--resb-neutral-dark) !important;
	font-weight: 700 !important;
}

.flatpickr-day.today.selected {
	color: #ffffff !important;
}

.flatpickr-months {
	background: #ffffff !important;
	border-bottom: 1px solid var(--resb-neutral-border) !important;
	padding: 0 !important;
	position: relative !important;
	height: 46px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
}

.flatpickr-month {
	color: var(--resb-neutral-dark) !important;
	fill: var(--resb-neutral-dark) !important;
	height: auto !important;
}

.flatpickr-current-month {
	color: var(--resb-neutral-dark) !important;
	font-size: 14px !important;
	position: static !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 6px !important;
	width: auto !important;
	height: auto !important;
	padding: 0 !important;
	margin: 0 !important;
}

.flatpickr-current-month input.cur-year {
	color: var(--resb-neutral-dark) !important;
	font-weight: 700 !important;
	padding: 2px 0 !important;
	margin: 0 !important;
	border: none !important;
	box-shadow: none !important;
	background: transparent !important;
	width: 100% !important;
	height: auto !important;
	line-height: 1.2 !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
	color: var(--resb-neutral-dark) !important;
	font-weight: 700 !important;
	padding: 2px 6px !important;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	margin: 0 !important;
	width: auto !important;
	height: auto !important;
	line-height: 1.2 !important;
}

.flatpickr-current-month .numInputWrapper {
	display: inline-flex !important;
	align-items: center !important;
	width: 65px !important;
	position: relative !important;
}

.flatpickr-prev-month,
.flatpickr-next-month {
	color: var(--resb-text-muted) !important;
	fill: var(--resb-text-muted) !important;
	position: absolute !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	height: 30px !important;
	width: 30px !important;
	padding: 0 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	z-index: 99 !important;
}

.flatpickr-prev-month {
	left: 12px !important;
}

.flatpickr-next-month {
	right: 12px !important;
}

.flatpickr-prev-month svg,
.flatpickr-next-month svg {
	width: 14px !important;
	height: 14px !important;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
	color: var(--resb-neutral-dark) !important;
	fill: var(--resb-neutral-dark) !important;
}

.flatpickr-weekdays {
	background: #ffffff !important;
	border-bottom: 1px solid var(--resb-neutral-border) !important;
	padding: 4px 0 !important;
}

span.flatpickr-weekday {
	color: var(--resb-text-muted) !important;
	font-weight: 600 !important;
	font-size: 11px !important;
	text-transform: uppercase !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
	color: #c0c0c0 !important;
	background: transparent !important;
	cursor: not-allowed !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
	color: #b0b0b0 !important;
}

@media (max-width: 480px) {
	.resb-form-wrap {
		padding: 16px;
	}
	.resb-progress__labels {
		display: none;
	}
	.flatpickr-day {
		height: 32px !important;
		line-height: 32px !important;
	}
}
