/*
 * Klinik Foli booking widget.
 * Self-hosted fonts (no request to Google at runtime — avoids sending visitor
 * IPs to a third party, per GDPR): Fraunces for headings, Work Sans for UI text.
 * Both are variable fonts, so one file each covers the weight range used here.
 */

@font-face {
	font-family: 'KFB Display';
	src: url('../fonts/fraunces-latin.woff2') format('woff2');
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'KFB Body';
	src: url('../fonts/work-sans-latin.woff2') format('woff2');
	font-weight: 300 700;
	font-style: normal;
	font-display: swap;
}

.kfb-booking-widget {
	--kfb-surface: #ffffff;
	--kfb-surface-sunken: #eef4fa;
	--kfb-ink: #142433;
	--kfb-muted: #5b7086;
	--kfb-accent: #12579c;
	--kfb-accent-strong: #0e4175;
	--kfb-accent-soft: #e4eef8;
	--kfb-border: #d7e2ec;
	--kfb-danger: #a23b2e;
	--kfb-danger-soft: #f5e7e4;
	--kfb-radius-lg: 18px;
	--kfb-radius-md: 12px;
	--kfb-radius-sm: 8px;
	--kfb-font-display: 'KFB Display', ui-serif, Georgia, serif;
	--kfb-font-body: 'KFB Body', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

	max-width: 560px;
	background: var(--kfb-surface);
	color: var(--kfb-ink);
	font-family: var(--kfb-font-body);
	font-size: 16px;
	line-height: 1.45;
	border: 1px solid var(--kfb-border);
	border-radius: var(--kfb-radius-lg);
	padding: 28px;
	box-shadow: 0 1px 2px rgba(20, 36, 51, 0.05), 0 12px 32px -16px rgba(20, 36, 51, 0.2);
	box-sizing: border-box;
}

.kfb-booking-widget *,
.kfb-booking-widget *::before,
.kfb-booking-widget *::after {
	box-sizing: border-box;
}

.kfb-booking-widget button {
	font-family: inherit;
}

/* ---------- Progress rail ---------- */

.kfb-progress {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	margin-bottom: 28px;
}

.kfb-progress__step {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	text-align: center;
}

.kfb-progress__step::before {
	content: '';
	position: absolute;
	top: 11px;
	left: -50%;
	width: 100%;
	height: 2px;
	background: var(--kfb-border);
	z-index: 0;
}

.kfb-progress__step:first-child::before {
	display: none;
}

.kfb-progress__step[data-state='done']::before,
.kfb-progress__step[data-state='current']::before {
	background: var(--kfb-accent);
}

.kfb-progress__dot {
	position: relative;
	z-index: 1;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--kfb-surface);
	border: 2px solid var(--kfb-border);
	color: var(--kfb-muted);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.kfb-progress__step[data-state='current'] .kfb-progress__dot {
	border-color: var(--kfb-accent);
	color: var(--kfb-accent);
}

.kfb-progress__step[data-state='done'] .kfb-progress__dot {
	border-color: var(--kfb-accent);
	background: var(--kfb-accent);
	color: #fff;
}

.kfb-progress__label {
	font-size: 12px;
	letter-spacing: 0.02em;
	color: var(--kfb-muted);
}

.kfb-progress__step[data-state='current'] .kfb-progress__label {
	color: var(--kfb-ink);
	font-weight: 600;
}

/* ---------- Shared step chrome ---------- */

.kfb-heading {
	font-family: var(--kfb-font-display);
	font-weight: 600;
	font-size: 1.25em;
	margin: 0 0 4px;
	text-wrap: balance;
}

.kfb-subtext {
	color: var(--kfb-muted);
	margin: 0 0 16px;
	font-size: 0.92em;
}

.kfb-panel {
	animation: kfb-fade-in 0.25s ease both;
}

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

@media (prefers-reduced-motion: reduce) {
	.kfb-panel {
		animation: none;
	}
}

.kfb-summary-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	background: var(--kfb-surface-sunken);
	border-radius: var(--kfb-radius-md);
	margin-bottom: 12px;
}

.kfb-summary-row__text {
	font-size: 0.95em;
}

.kfb-summary-row__label {
	color: var(--kfb-muted);
	margin-right: 6px;
}

.kfb-summary-row__value {
	font-weight: 600;
}

.kfb-link-btn {
	background: none;
	border: none;
	color: var(--kfb-accent-strong);
	font-weight: 600;
	font-size: 0.9em;
	text-decoration: underline;
	cursor: pointer;
	padding: 4px;
	flex-shrink: 0;
}

.kfb-link-btn:hover {
	color: var(--kfb-accent);
}

/* ---------- Step 1: treatment cards ---------- */

.kfb-treatment-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
}

.kfb-treatment-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	text-align: left;
	background: var(--kfb-surface);
	border: 1.5px solid var(--kfb-border);
	border-radius: var(--kfb-radius-md);
	padding: 14px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.kfb-treatment-card:hover {
	border-color: var(--kfb-accent);
}

.kfb-treatment-card[aria-pressed='true'] {
	border-color: var(--kfb-accent);
	background: var(--kfb-accent-soft);
}

.kfb-treatment-card__name {
	font-family: var(--kfb-font-display);
	font-weight: 600;
	font-size: 1em;
}

.kfb-treatment-card__duration {
	font-size: 0.85em;
	color: var(--kfb-muted);
	font-variant-numeric: tabular-nums;
}

/* ---------- Step 2: week schedule ---------- */

.kfb-nav-btn {
	width: 30px;
	height: 30px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--kfb-surface);
	border: 1px solid var(--kfb-border);
	border-radius: 50%;
	cursor: pointer;
	color: var(--kfb-ink);
}

.kfb-nav-btn:hover:not(:disabled) {
	border-color: var(--kfb-accent);
	color: var(--kfb-accent-strong);
}

.kfb-nav-btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.kfb-nav-btn svg {
	width: 14px;
	height: 14px;
}

.kfb-week-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 14px;
}

.kfb-week-label {
	font-weight: 600;
	font-size: 0.92em;
	text-transform: capitalize;
	text-align: center;
}

.kfb-week-grid {
	display: grid;
	grid-template-columns: repeat(var(--kfb-week-columns, 5), minmax(84px, 1fr));
	gap: 8px;
	overflow-x: auto;
	padding-bottom: 4px;
}

.kfb-week-day {
	background: var(--kfb-surface-sunken);
	border-radius: var(--kfb-radius-md);
	padding: 10px 6px;
	min-width: 0;
}

.kfb-week-day--today {
	box-shadow: inset 0 0 0 1.5px var(--kfb-accent);
}

.kfb-week-day__header {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 8px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--kfb-border);
}

.kfb-week-day__name {
	font-size: 0.72em;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--kfb-muted);
}

.kfb-week-day__date {
	font-size: 1em;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.kfb-week-day__times {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.kfb-week-day__empty {
	text-align: center;
	color: var(--kfb-muted);
	font-size: 0.85em;
	margin: 10px 0 0;
}

/* ---------- Time chips (used in the week grid) ---------- */

.kfb-time-chip {
	padding: 8px 14px;
	border: 1.5px solid var(--kfb-border);
	border-radius: 999px;
	background: var(--kfb-surface);
	color: var(--kfb-ink);
	cursor: pointer;
	font-size: 0.9em;
	font-variant-numeric: tabular-nums;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.kfb-time-chip:hover {
	border-color: var(--kfb-accent);
}

.kfb-time-chip[aria-pressed='true'] {
	background: var(--kfb-accent);
	border-color: var(--kfb-accent);
	color: #fff;
	font-weight: 600;
}

.kfb-time-chip--compact {
	width: 100%;
	padding: 6px 4px;
	font-size: 0.82em;
	text-align: center;
}

/* ---------- Step 4: contact form ---------- */

.kfb-hold-countdown {
	display: inline-block;
	margin: 0 0 16px;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--kfb-accent-soft);
	color: var(--kfb-accent-strong);
	font-size: 0.85em;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.kfb-field {
	margin-bottom: 12px;
}

.kfb-field label {
	display: block;
	font-size: 0.85em;
	font-weight: 600;
	margin-bottom: 5px;
}

.kfb-field-help {
	font-size: 0.82em;
	color: var(--kfb-muted);
	margin: 0 0 6px;
}

.kfb-field input,
.kfb-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1.5px solid var(--kfb-border);
	border-radius: var(--kfb-radius-sm);
	font-size: 1em;
	font-family: inherit;
	color: var(--kfb-ink);
	background: var(--kfb-surface);
}

.kfb-field input:focus,
.kfb-field textarea:focus {
	outline: 2px solid var(--kfb-accent);
	outline-offset: 1px;
	border-color: var(--kfb-accent);
}

.kfb-field textarea {
	resize: vertical;
	min-height: 64px;
}

.kfb-honeypot {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.kfb-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 18px;
}

.kfb-submit {
	padding: 11px 22px;
	border: none;
	border-radius: 999px;
	background: var(--kfb-accent);
	color: #fff;
	cursor: pointer;
	font-size: 0.95em;
	font-weight: 600;
	transition: background 0.15s ease;
}

.kfb-submit:hover:not(:disabled) {
	background: var(--kfb-accent-strong);
}

.kfb-submit:disabled {
	opacity: 0.6;
	cursor: default;
}

.kfb-back-btn {
	background: none;
	border: none;
	color: var(--kfb-muted);
	font-weight: 600;
	cursor: pointer;
	font-size: 0.9em;
	padding: 8px 4px;
}

.kfb-back-btn:hover {
	color: var(--kfb-ink);
}

/* ---------- Feedback ---------- */

.kfb-error {
	color: var(--kfb-danger);
	background: var(--kfb-danger-soft);
	border-radius: var(--kfb-radius-sm);
	padding: 10px 12px;
	font-size: 0.88em;
	margin-top: 10px;
}

.kfb-loading,
.kfb-empty {
	color: var(--kfb-muted);
	font-size: 0.9em;
	padding: 8px 0;
}

.kfb-success {
	text-align: center;
	padding: 12px 0 4px;
}

.kfb-success__icon {
	width: 52px;
	height: 52px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: var(--kfb-accent-soft);
	color: var(--kfb-accent-strong);
	display: flex;
	align-items: center;
	justify-content: center;
}

.kfb-success__icon svg {
	width: 24px;
	height: 24px;
}

.kfb-success__title {
	font-family: var(--kfb-font-display);
	font-weight: 600;
	font-size: 1.3em;
	margin: 0 0 6px;
}

.kfb-success__body {
	color: var(--kfb-muted);
	margin: 0;
}

/* ---------- Small screens ---------- */

@media (max-width: 420px) {
	.kfb-booking-widget {
		padding: 20px;
		border-radius: var(--kfb-radius-md);
	}

	.kfb-treatment-grid {
		grid-template-columns: 1fr;
	}

	.kfb-progress__label {
		font-size: 10.5px;
	}
}
