/**
 * Hvar Bookings — front-end wizard.
 *
 * Typography inherits from the host theme (font: inherit everywhere).
 * Colors flow from two CSS variables (--hvar-accent, --hvar-sidebar) so the
 * whole UI re-themes from one place; accent falls back to the theme link color.
 */

.hvar-booking {
	--hvar-accent: #1f5fa6;
	--hvar-sidebar: #0a93b5;
	--hvar-ink: #1f2d3d;
	--hvar-muted: #6b7a8d;
	--hvar-line: #e4e9f0;
	--hvar-soft: #f4f7fb;
	--hvar-radius: 14px;
	--hvar-shadow: 0 10px 40px -12px rgba(20, 40, 80, .18);
	--hvar-ease: cubic-bezier(.22, .61, .36, 1);

	font: inherit;
	font-size: calc(1em * var(--hvar-fs-body, 1));
	color: var(--hvar-ink);
	max-width: 980px;
	margin: 0 auto;
	-webkit-font-smoothing: antialiased;
}

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

/* Ensure the [hidden] attribute always wins over display-setting classes
   (e.g. .hvar-btn) so Back/Submit stay hidden until their step. */
.hvar-booking [hidden] { display: none !important; }

/* ---------- Agreement (step 0) ---------- */
.hvar-agreement { margin: 0; }
.hvar-agreement__intro { margin: 0 0 4px; font-size: calc(1.02em * var(--hvar-fs-agree-intro, 1)); }
.hvar-agreement__links {
	margin: 0 0 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--hvar-line);
	letter-spacing: .04em;
	font-size: calc(.82em * var(--hvar-fs-agree-intro, 1));
}
.hvar-agreement__links a,
.hvar-agreement__links .hvar-doc {
	color: var(--hvar-accent);
	text-decoration: none;
	font-weight: 600;
}
.hvar-agreement__links a:hover { text-decoration: underline; }
.hvar-agreement__links .hvar-sep { color: var(--hvar-line); margin: 0 .35em; }

.hvar-agreement__check {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	cursor: pointer;
	font-size: calc(1.02em * var(--hvar-fs-agree-check, 1));
	line-height: 1.4;
}
.hvar-agreement__check input {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	margin-top: 1px;
	border: 2px solid var(--hvar-line);
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	transition: border-color .2s, background .2s;
	position: relative;
}
.hvar-agreement__check input:checked {
	border-color: var(--hvar-accent);
	background: var(--hvar-accent);
}
.hvar-agreement__check input:checked::after {
	content: "";
	position: absolute;
	left: 6px; top: 2px;
	width: 6px; height: 11px;
	border: solid #fff;
	border-width: 0 2.5px 2.5px 0;
	transform: rotate(45deg);
}
.hvar-agreement__check input:focus-visible { outline: 3px solid color-mix(in srgb, var(--hvar-accent) 35%, transparent); outline-offset: 2px; }

/* ---------- Wizard shell ---------- */
.hvar-wizard {
	display: grid;
	grid-template-columns: 1fr 300px;
	background: #fff;
	border-radius: var(--hvar-radius);
	box-shadow: var(--hvar-shadow);
	overflow: hidden;
}
.hvar-booking[data-state="success"] .hvar-wizard { display: none; }

.hvar-wizard__main {
	padding: 30px 34px 22px;
	display: flex;
	flex-direction: column;
	min-height: 400px;
}

/* ---------- Progress ---------- */
.hvar-progress {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 26px;
}
.hvar-progress__bar {
	position: relative;
	flex: 1;
	height: 4px;
	border-radius: 4px;
	background: var(--hvar-line);
	overflow: hidden;
}
.hvar-progress__bar i {
	position: absolute;
	inset: 0 auto 0 0;
	background: var(--hvar-accent);
	border-radius: 4px;
	transition: width .5s var(--hvar-ease);
}
.hvar-progress__dots { display: flex; gap: 8px; }
.hvar-progress__dots b {
	width: 30px; height: 30px;
	display: grid; place-items: center;
	border-radius: 50%;
	border: 2px solid var(--hvar-line);
	color: var(--hvar-muted);
	font-size: .85em;
	font-weight: 700;
	background: #fff;
	transition: all .3s var(--hvar-ease);
}
.hvar-progress__dots b.is-active {
	border-color: var(--hvar-accent);
	color: var(--hvar-accent);
}
.hvar-progress__dots b.is-done {
	border-color: var(--hvar-accent);
	background: var(--hvar-accent);
	color: #fff;
}
.hvar-progress__dots b svg { width: 15px; height: 15px; }

/* ---------- Steps ---------- */
.hvar-step { flex: 1; }
.hvar-step:not(.is-active) { display: none; }
.hvar-step.is-active { animation: hvar-fade-in .42s var(--hvar-ease) both; }
@keyframes hvar-fade-in {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: none; }
}
.hvar-step__title { margin: 0 0 4px; font-size: calc(1.55em * var(--hvar-fs-title, 1)); font-weight: 700; line-height: 1.15; }
.hvar-step__subtitle { margin: 0 0 4px; color: var(--hvar-muted); font-size: calc(1em * var(--hvar-fs-subtitle, 1)); }
.hvar-step__hint { margin: 0 0 18px; color: var(--hvar-muted); font-size: calc(.92em * var(--hvar-fs-subtitle, 1)); }
.hvar-tznote {
	margin: 0 0 10px;
	font-size: calc(.82em * var(--hvar-fs-subtitle, 1));
	color: var(--hvar-muted);
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* ---------- Service cards ---------- */
.hvar-services { display: grid; gap: 14px; }
.hvar-service {
	position: relative;
	border: 1.5px solid var(--hvar-line);
	border-radius: 12px;
	padding: 18px 20px;
	cursor: pointer;
	transition: border-color .2s, box-shadow .25s, transform .2s var(--hvar-ease);
	animation: hvar-fade-in .4s var(--hvar-ease) both;
}
.hvar-service:hover { border-color: color-mix(in srgb, var(--hvar-accent) 50%, var(--hvar-line)); box-shadow: 0 6px 22px -14px rgba(20,40,80,.4); }
.hvar-service.is-selected {
	border-color: var(--hvar-accent);
	box-shadow: 0 0 0 1px var(--hvar-accent), 0 12px 28px -16px color-mix(in srgb, var(--hvar-accent) 60%, transparent);
}
.hvar-service__head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.hvar-service__label { margin: 0; font-size: 1.08em; font-weight: 600; line-height: 1.3; }
.hvar-service__price { font-size: 1.08em; font-weight: 700; white-space: nowrap; color: var(--hvar-ink); }
.hvar-service__meta { display: inline-flex; align-items: center; gap: 6px; color: var(--hvar-muted); font-size: .85em; margin-top: 8px; }
.hvar-service__desc {
	margin: 10px 0 0;
	color: var(--hvar-muted);
	font-size: .9em;
	line-height: 1.5;
	white-space: pre-line;
	max-height: 0;
	overflow: hidden;
	transition: max-height .35s var(--hvar-ease), margin .35s var(--hvar-ease);
}
.hvar-service.is-open .hvar-service__desc { max-height: 240px; margin-top: 10px; }
.hvar-service__toggle {
	margin-top: 10px;
	background: none; border: 0; padding: 0;
	color: var(--hvar-accent);
	font: inherit; font-weight: 600; font-size: .88em;
	cursor: pointer;
	display: inline-flex; align-items: center; gap: 5px;
}
.hvar-service__toggle svg { width: 12px; height: 12px; transition: transform .3s var(--hvar-ease); }
.hvar-service.is-open .hvar-service__toggle svg { transform: rotate(180deg); }
.hvar-service__radio {
	position: absolute; top: 16px; right: 16px;
	width: 20px; height: 20px; border-radius: 50%;
	border: 2px solid var(--hvar-line);
	display: none;
}

/* ---------- Calendar ---------- */
.hvar-calendar { margin-bottom: 10px; }
.hvar-cal__head {
	display: flex; align-items: center; justify-content: space-between;
	margin-bottom: 8px;
}
.hvar-cal__title { font-weight: 700; font-size: 1.02em; }
.hvar-cal__nav { display: flex; gap: 6px; }
.hvar-cal__nav button {
	width: 28px; height: 28px; border-radius: 8px;
	border: 1.5px solid var(--hvar-line); background: #fff;
	cursor: pointer; color: var(--hvar-ink); font: inherit;
	transition: border-color .2s, background .2s;
}
.hvar-cal__nav button:hover:not(:disabled) { border-color: var(--hvar-accent); color: var(--hvar-accent); }
.hvar-cal__nav button:disabled { opacity: .35; cursor: not-allowed; }
.hvar-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.hvar-cal__wd { text-align: center; font-size: .68em; font-weight: 700; color: var(--hvar-muted); text-transform: uppercase; letter-spacing: .05em; padding-bottom: 2px; }
.hvar-cal__day {
	min-height: 34px;
	border: 0; border-radius: 8px;
	background: var(--hvar-soft);
	color: var(--hvar-ink);
	font: inherit; font-size: .86em;
	cursor: pointer;
	display: grid; place-items: center;
	transition: background .2s, color .2s, transform .15s var(--hvar-ease), box-shadow .2s;
}
.hvar-cal__day:hover:not(:disabled) { background: color-mix(in srgb, var(--hvar-accent) 14%, #fff); transform: translateY(-1px); }
.hvar-cal__day.is-empty { background: transparent; cursor: default; }
.hvar-cal__day:disabled:not(.is-empty) { color: #c2cbd6; cursor: not-allowed; background: #fafbfd; }
.hvar-cal__day.is-today { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--hvar-accent) 45%, transparent); }
.hvar-cal__day.is-selected { background: var(--hvar-accent); color: #fff; font-weight: 700; }
.hvar-cal__day.is-full { background: repeating-linear-gradient(45deg,#f3f5f8,#f3f5f8 4px,#eaeef3 4px,#eaeef3 8px); color: #b3bdca; }

.hvar-cal__legend { display: flex; gap: 14px; margin-top: 8px; font-size: .74em; color: var(--hvar-muted); }
.hvar-cal__legend span { display: inline-flex; align-items: center; gap: 6px; }
.hvar-cal__legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.hvar-cal__legend .l-av { background: var(--hvar-soft); box-shadow: inset 0 0 0 1px var(--hvar-line); }
.hvar-cal__legend .l-bk { background: repeating-linear-gradient(45deg,#f3f5f8,#f3f5f8 3px,#e3e8ee 3px,#e3e8ee 6px); }
.hvar-cal__legend .l-td { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--hvar-accent) 45%, transparent); }

/* ---------- Slots ---------- */
.hvar-slots__head {
	background: var(--hvar-soft);
	border-radius: 9px;
	padding: 7px 12px;
	margin: 4px 0 10px;
	font-size: .88em;
}
.hvar-slots__head b { color: var(--hvar-accent); }
.hvar-slots__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hvar-slot {
	border: 1.5px solid var(--hvar-line);
	border-radius: 9px;
	background: #fff;
	padding: 9px 6px;
	font: inherit; font-size: .92em;
	cursor: pointer;
	text-align: center;
	transition: border-color .18s, background .18s, transform .15s var(--hvar-ease), box-shadow .2s;
	animation: hvar-fade-in .3s var(--hvar-ease) both;
}
.hvar-slot:hover:not(:disabled) { border-color: var(--hvar-accent); transform: translateY(-1px); box-shadow: 0 6px 16px -10px rgba(20,40,80,.4); }
.hvar-slot:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.hvar-slot.is-selected { border-color: var(--hvar-accent); background: color-mix(in srgb, var(--hvar-accent) 10%, #fff); font-weight: 700; box-shadow: 0 0 0 1px var(--hvar-accent); }

/* ---------- Form ---------- */
.hvar-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.hvar-field { position: relative; }
.hvar-field input {
	width: 100%;
	font: inherit;
	padding: 15px 14px 7px;
	border: 1.5px solid var(--hvar-line);
	border-radius: 10px;
	background: #fff;
	color: var(--hvar-ink);
	transition: border-color .2s, box-shadow .2s;
}
.hvar-field input:focus {
	outline: none;
	border-color: var(--hvar-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--hvar-accent) 18%, transparent);
}
.hvar-field label {
	position: absolute;
	left: 14px; top: 13px;
	color: var(--hvar-muted);
	pointer-events: none;
	transition: transform .18s var(--hvar-ease), font-size .18s var(--hvar-ease), color .18s;
	transform-origin: left top;
}
.hvar-field input:focus + label,
.hvar-field input:not(:placeholder-shown) + label {
	transform: translateY(-9px) scale(.74);
	color: var(--hvar-accent);
}
.hvar-field input.hvar-invalid { border-color: #e05260; }
.hvar-field--phone { grid-column: 1 / -1; }
.hvar-field--phone .iti { width: 100%; }
.hvar-field--phone input { padding: 14px 14px; }
.hvar-field--street { grid-column: 1 / -1; margin-top: 2px; }

/* Country dropdown — matches the text inputs + floating label. */
.hvar-field select {
	width: 100%;
	font: inherit;
	padding: 15px 36px 7px 14px;
	border: 1.5px solid var(--hvar-line);
	border-radius: 10px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23888' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
	background-size: 10px 7px;
	color: var(--hvar-ink);
	appearance: none;
	-webkit-appearance: none;
	transition: border-color .2s, box-shadow .2s;
}
.hvar-field select:focus {
	outline: none;
	border-color: var(--hvar-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--hvar-accent) 18%, transparent);
}
/* :valid fires once a real country (non-empty value) is chosen — float the label then. */
.hvar-field select:focus + label,
.hvar-field select:valid + label {
	transform: translateY(-9px) scale(.74);
	color: var(--hvar-accent);
}
.hvar-field select.hvar-invalid { border-color: #e05260; }
.hvar-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Actions ---------- */
.hvar-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-top: 22px;
	margin-top: 18px;
	border-top: 1px solid var(--hvar-line);
}
.hvar-btn {
	font: inherit;
	font-size: calc(1em * var(--hvar-fs-button, 1));
	font-weight: 600;
	border: 0;
	border-radius: 10px;
	padding: 13px 24px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	transition: background .2s, transform .15s var(--hvar-ease), box-shadow .2s, opacity .2s;
}
.hvar-btn--primary {
	background: var(--hvar-accent);
	color: #fff;
	margin-left: auto;
	box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--hvar-accent) 80%, transparent);
}
.hvar-btn--primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 28px -14px color-mix(in srgb, var(--hvar-accent) 80%, transparent); }
.hvar-btn--primary:disabled { background: var(--hvar-line); color: #9aa7b6; box-shadow: none; cursor: not-allowed; }
.hvar-btn--ghost { background: transparent; color: var(--hvar-muted); }
.hvar-btn--ghost:hover { color: var(--hvar-accent); }
.hvar-btn.is-loading { pointer-events: none; opacity: .8; }
.hvar-btn.is-loading::after {
	content: "";
	width: 15px; height: 15px;
	border: 2px solid rgba(255,255,255,.5);
	border-top-color: #fff;
	border-radius: 50%;
	animation: hvar-spin .7s linear infinite;
}
@keyframes hvar-spin { to { transform: rotate(360deg); } }

/* ---------- Summary sidebar ---------- */
.hvar-summary {
	background: var(--hvar-sidebar);
	color: #fff;
	padding: 30px 26px;
	display: flex;
	flex-direction: column;
}
.hvar-summary__title { margin: 0 0 18px; font-size: calc(1.4em * var(--hvar-fs-title, 1)); font-weight: 700; }
.hvar-summary__empty { color: rgba(255,255,255,.85); line-height: 1.55; font-size: .95em; }
.hvar-sum-row { animation: hvar-fade-in .35s var(--hvar-ease) both; }
.hvar-sum-row__top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.hvar-sum-row__label { font-weight: 600; line-height: 1.35; }
.hvar-sum-row__price { font-weight: 700; white-space: nowrap; }
.hvar-sum-row__meta { color: rgba(255,255,255,.85); font-size: .9em; margin-top: 8px; line-height: 1.5; }
.hvar-summary__total {
	margin-top: auto;
	padding-top: 18px;
	border-top: 1px solid rgba(255,255,255,.22);
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}
.hvar-summary__total .t-label { font-size: 1.02em; }
.hvar-summary__total .t-amount { font-size: 1.3em; font-weight: 800; }
.hvar-summary__tax { text-align: right; color: rgba(255,255,255,.8); font-size: .8em; margin-top: 2px; }

/* ---------- Success ---------- */
.hvar-success {
	background: #fff;
	border-radius: var(--hvar-radius);
	box-shadow: var(--hvar-shadow);
	padding: 56px 40px;
	text-align: center;
	animation: hvar-fade-in .5s var(--hvar-ease) both;
}
.hvar-success__icon svg { width: 76px; height: 76px; }
.hvar-success__icon circle { stroke: var(--hvar-accent); stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; animation: hvar-draw .6s var(--hvar-ease) .15s forwards; }
.hvar-success__icon path { stroke: var(--hvar-accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 36; stroke-dashoffset: 36; animation: hvar-draw .4s var(--hvar-ease) .7s forwards; }
@keyframes hvar-draw { to { stroke-dashoffset: 0; } }
.hvar-success__msg { margin: 20px auto 0; max-width: 460px; font-size: 1.12em; line-height: 1.55; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
	.hvar-wizard { grid-template-columns: 1fr; }
	.hvar-summary { order: 2; }
	.hvar-wizard__main { padding: 24px 20px 18px; min-height: 0; }
	.hvar-form { grid-template-columns: 1fr; }
	.hvar-slots__grid { grid-template-columns: repeat(2, 1fr); }
	.hvar-step__title { font-size: calc(1.35em * var(--hvar-fs-title, 1)); }
}

@media (prefers-reduced-motion: reduce) {
	.hvar-booking *,
	.hvar-booking *::before,
	.hvar-booking *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
