/* Endobiogenikos registracija — priekinė dalis
 *
 * Spalvas, šriftus ir kampų spindulį galima perrašyti per --esb-* kintamuosius.
 * Šriftai pagal nutylėjimą paveldimi iš temos (--esb-font, --esb-display).
 */

.esb {
	--esb-ink: #14201d;
	--esb-body: #3c4a46;
	--esb-muted: #5f726c;        /* 5.1:1 ant balto, 4.8:1 ant --esb-bg */
	--esb-line: #e3e9e6;
	--esb-field: #84938d;        /* laukų ir pasirinkimų rėmeliai – 3:1 */
	--esb-bg: #f5f7f6;
	--esb-surface: #ffffff;
	--esb-accent: #1b6656;
	--esb-accent-dark: #144f43;
	--esb-accent-soft: #e6f0ec;
	--esb-danger: #a8402f;
	--esb-danger-soft: #fbeeeb;
	--esb-radius: 2px;
	--esb-ease: cubic-bezier(0.16, 1, 0.3, 1);

	font-family: var(--esb-font, inherit);
	color: var(--esb-body);
	line-height: 1.6;
	max-width: 980px;
	margin: 0 auto;
	box-sizing: border-box;
	caret-color: var(--esb-accent);
}

.esb *,
.esb *::before,
.esb *::after {
	box-sizing: inherit;
}

/* display: grid/flex nustelbtų hidden atributą. */
.esb [hidden] {
	display: none !important;
}

.esb ::selection {
	background: var(--esb-accent-soft);
	color: var(--esb-ink);
}

/* Temos (pvz. Astra) mygtukams primeta savo spalvas, šešėlius ir užvedimo efektus. */
.esb button {
	-webkit-appearance: none;
	appearance: none;
	text-shadow: none;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
}

.esb button:hover,
.esb button:focus {
	text-decoration: none;
}

.esb :focus-visible {
	outline: 2px solid var(--esb-accent);
	outline-offset: 2px;
}

/* ---------- Įžanga ---------- */

.esb__intro {
	margin-bottom: 28px;
}

.esb .esb__title {
	margin: 0 0 8px;
	font-family: var(--esb-display, inherit);
	font-size: clamp(26px, 3.4vw, 36px);
	line-height: 1.15;
	letter-spacing: -0.01em;
	color: var(--esb-ink);
	text-wrap: balance;
}

.esb .esb__meta {
	margin: 0;
	font-size: 17px;
	color: var(--esb-body);
	max-width: 60ch;
}

/* ---------- Žingsniai ---------- */

.esb .esb__steps {
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: esb-step;
	border-bottom: 1px solid var(--esb-line);
}

.esb .esb__step {
	counter-increment: esb-step;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--esb-line);
	scroll-margin-top: 24px;
}

.esb .esb__step[data-state="open"] {
	border-top-color: var(--esb-ink);
}

.esb__stephead {
	display: grid;
	grid-template-columns: 2.5rem minmax(0, 1fr) auto;
	align-items: baseline;
	column-gap: 12px;
	padding: 18px 0;
}

.esb__stepnum::before {
	content: counter(esb-step);
}

.esb__stepnum {
	font-family: var(--esb-display, inherit);
	font-size: 20px;
	line-height: 1;
	font-variant-numeric: lining-nums tabular-nums;
	color: var(--esb-muted);
}

.esb__stepcopy {
	min-width: 0;
}

.esb .esb__steptitle {
	margin: 0;
	font-family: var(--esb-display, inherit);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--esb-muted);
}

.esb .esb__steptitle:focus {
	outline: none;
}

.esb .esb__stepsummary {
	margin: 2px 0 0;
	font-size: 16px;
	line-height: 1.45;
	color: var(--esb-ink);
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}

/* Atidarytas */

.esb__step[data-state="open"] .esb__stepnum {
	color: var(--esb-accent);
}

.esb__step[data-state="open"] .esb__steptitle {
	font-size: 24px;
	color: var(--esb-ink);
}

/* Atliktas: pavadinimas tampa maža etikete, svarbiausia – pasirinkimas */

.esb__step[data-state="done"] .esb__stephead,
.esb__step[data-state="busy"] .esb__stephead {
	padding: 14px 0;
}

.esb__step[data-state="done"] .esb__stepnum,
.esb__step[data-state="busy"] .esb__stepnum {
	font-size: 16px;
	color: var(--esb-accent);
}

.esb__step[data-state="done"] .esb__steptitle,
.esb__step[data-state="busy"] .esb__steptitle {
	font-family: var(--esb-font, inherit);
	font-size: 14px;
	font-weight: 600;
	color: var(--esb-muted);
}

.esb__step[data-state="busy"] .esb__stepsummary {
	color: var(--esb-muted);
}

.esb .esb__edit {
	align-self: center;
	min-height: 44px;
	margin: -8px 0;
	padding: 0 4px;
	border: 0;
	border-radius: var(--esb-radius);
	background: transparent;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	color: var(--esb-accent);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	cursor: pointer;
}

.esb .esb__edit:hover {
	background: transparent;
	color: var(--esb-accent-dark);
	text-decoration: underline;
	text-decoration-thickness: 2px;
}

.esb__stepbody {
	padding: 0 0 32px calc(2.5rem + 12px);
}

.esb__step[data-state="open"] > .esb__stepbody {
	animation: esb-in 0.32s var(--esb-ease) both;
}

@keyframes esb-in {
	from { opacity: 0.35; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

/* ---------- Pasirinkimų eilutės ---------- */

.esb__options {
	border-top: 1px solid var(--esb-line);
}

.esb .esb__group {
	margin: 24px 0 0;
	padding: 0 0 8px;
	border-bottom: 1px solid var(--esb-line);
	font-family: var(--esb-font, inherit);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	color: var(--esb-ink);
}

.esb__options > .esb__group:first-child {
	margin-top: 4px;
}

.esb .esb__option {
	display: grid;
	grid-template-columns: 18px minmax(0, 1fr) auto;
	column-gap: 14px;
	align-items: start;
	width: 100%;
	margin: 0;
	padding: 14px 12px;
	border: 0;
	border-bottom: 1px solid var(--esb-line);
	border-radius: 0;
	background: transparent;
	font-family: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.4;
	text-align: left;
	color: var(--esb-body);
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.esb .esb__option:hover {
	background: var(--esb-bg);
	color: var(--esb-body);
}

.esb .esb__option--active,
.esb .esb__option--active:hover {
	background: var(--esb-accent-soft);
}

.esb .esb__option:focus-visible {
	outline-offset: -2px;
}

.esb__radio {
	width: 18px;
	height: 18px;
	margin-top: 2px;
	border: 1.5px solid var(--esb-field);
	border-radius: 50%;
	background: var(--esb-surface);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.esb__option:hover .esb__radio {
	border-color: var(--esb-accent);
}

.esb__option--active .esb__radio {
	border-color: var(--esb-accent);
	background: var(--esb-accent);
	box-shadow: inset 0 0 0 3px var(--esb-surface);
}

.esb__optname {
	display: block;
	font-weight: 600;
	color: var(--esb-ink);
	text-wrap: pretty;
}

.esb__optdesc {
	display: block;
	margin-top: 3px;
	max-width: 62ch;
	font-size: 15px;
	line-height: 1.5;
	color: var(--esb-muted);
}

.esb__optmeta {
	padding-left: 8px;
	font-size: 15px;
	color: var(--esb-ink);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	text-align: right;
}

.esb__optmeta:empty {
	display: none;
}

/* ---------- Kalendorius ---------- */

.esb__grid {
	display: grid;
	grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
	gap: 40px;
	align-items: start;
}

.esb__calhead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 10px;
}

.esb__month {
	flex: 1;
	text-align: center;
	font-family: var(--esb-display, inherit);
	font-size: 19px;
	font-weight: 600;
	color: var(--esb-ink);
}

.esb .esb__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--esb-line);
	border-radius: var(--esb-radius);
	background: var(--esb-surface);
	color: var(--esb-ink);
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.esb .esb__nav:hover:not(:disabled) {
	border-color: var(--esb-accent);
	background: var(--esb-accent-soft);
	color: var(--esb-accent-dark);
}

.esb .esb__nav:disabled {
	color: var(--esb-field);
	background: var(--esb-surface);
	cursor: default;
}

.esb__weekdays,
.esb__days {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 3px;
}

.esb__weekdays {
	margin-bottom: 4px;
}

.esb__weekdays span {
	padding: 4px 0;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	color: var(--esb-muted);
}

.esb .esb__day {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	min-height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--esb-radius);
	background: transparent;
	font-family: inherit;
	font-size: 15px;
	font-weight: 400;
	font-variant-numeric: tabular-nums;
	color: #8f9d98;
	cursor: default;
}

.esb__day--empty {
	visibility: hidden;
}

.esb .esb__day--free {
	background: var(--esb-accent-soft);
	color: var(--esb-accent-dark);
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.12s ease, color 0.12s ease;
}

.esb .esb__day--free:hover {
	background: #cfe3da;
	color: var(--esb-ink);
}

.esb .esb__day--selected,
.esb .esb__day--selected:hover {
	background: var(--esb-accent);
	color: #fff;
}

/* Šiandiena – brūkšnelis po skaičiumi */
.esb__day--today::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 6px;
	width: 12px;
	height: 2px;
	margin-left: -6px;
	background: currentColor;
}

.esb .esb__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 14px 0 0;
	font-size: 14px;
	color: var(--esb-muted);
}

.esb__legenditem {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.esb__swatch {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: var(--esb-radius);
}

.esb__swatch--free { background: var(--esb-accent-soft); box-shadow: inset 0 0 0 1px #c3dbd0; }
.esb__swatch--sel { background: var(--esb-accent); }

.esb .esb__hint {
	margin: 10px 0 0;
	font-size: 15px;
	color: var(--esb-body);
}

.esb .esb__hint:empty {
	display: none;
}

.esb--loading .esb__days,
.esb--loading .esb__rail {
	opacity: 0.5;
	transition: opacity 0.2s ease;
}

/* ---------- Laikai ---------- */

.esb .esb__slotshead {
	display: flex;
	align-items: center;
	min-height: 44px;
	margin: 0 0 10px;
	font-family: var(--esb-display, inherit);
	font-size: 19px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--esb-ink);
	text-wrap: balance;
}

.esb .esb__slotsempty {
	margin: 0;
	font-size: 16px;
	color: var(--esb-body);
}

.esb__rail {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
	gap: 8px;
	max-width: 480px;
}

.esb .esb__slot {
	min-height: 48px;
	margin: 0;
	padding: 8px 6px;
	border: 1px solid var(--esb-field);
	border-radius: var(--esb-radius);
	background: var(--esb-surface);
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--esb-ink);
	cursor: pointer;
	transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.esb .esb__slot:hover {
	border-color: var(--esb-accent);
	background: var(--esb-accent-soft);
	color: var(--esb-accent-dark);
}

.esb .esb__slot--active,
.esb .esb__slot--active:hover {
	border-color: var(--esb-accent);
	background: var(--esb-accent);
	color: #fff;
}

/* ---------- Forma ---------- */

.esb__form {
	max-width: 640px;
}

.esb__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 16px;
}

.esb__field {
	display: block;
	margin-bottom: 20px;
}

.esb__label {
	display: block;
	margin-bottom: 6px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--esb-ink);
}

.esb__label em {
	font-style: normal;
	color: var(--esb-danger);
}

.esb__help {
	display: block;
	margin-bottom: 8px;
	font-size: 15px;
	line-height: 1.5;
	color: var(--esb-muted);
}

.esb input[type="text"],
.esb input[type="tel"],
.esb input[type="email"],
.esb input[type="date"],
.esb input[type="number"],
.esb select,
.esb textarea {
	display: block;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 11px 14px;
	border: 1px solid var(--esb-field);
	border-radius: var(--esb-radius);
	background: var(--esb-surface);
	box-shadow: none;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.4;
	color: var(--esb-ink);
	transition: border-color 0.15s ease;
}

.esb textarea {
	min-height: 132px;
	resize: vertical;
}

.esb input::placeholder,
.esb textarea::placeholder {
	color: var(--esb-muted);
	opacity: 1;
}

.esb input[type="text"]:hover,
.esb input[type="tel"]:hover,
.esb input[type="email"]:hover,
.esb select:hover,
.esb textarea:hover {
	border-color: var(--esb-body);
}

.esb input:focus,
.esb select:focus,
.esb textarea:focus {
	border-color: var(--esb-accent);
	outline: 2px solid var(--esb-accent);
	outline-offset: -1px;
	box-shadow: none;
}

.esb .esb__field--invalid input,
.esb .esb__field--invalid select,
.esb .esb__field--invalid textarea {
	border-color: var(--esb-danger);
	outline-color: var(--esb-danger);
}

.esb__err {
	display: none;
	margin-top: 6px;
	font-size: 15px;
	font-weight: 600;
	color: var(--esb-danger);
}

.esb__err--on {
	display: block;
}

.esb__choices {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 4px;
}

.esb__choice,
.esb__consent {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	font-size: 15px;
	line-height: 1.5;
	color: var(--esb-body);
	cursor: pointer;
}

.esb__choice {
	min-height: 32px;
}

.esb__choice input,
.esb__consent input {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	accent-color: var(--esb-accent);
}

.esb__consent a {
	color: var(--esb-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.esb__consent a:hover {
	color: var(--esb-accent-dark);
}

.esb__field--check {
	margin: 4px 0 8px;
}

.esb__field--invalid .esb__consent input,
.esb__field--invalid .esb__choice input {
	outline: 2px solid var(--esb-danger);
	outline-offset: 1px;
}

.esb .esb__fieldheading {
	margin: 28px 0 6px;
	font-family: var(--esb-display, inherit);
	font-size: 19px;
	font-weight: 600;
	color: var(--esb-ink);
}

.esb__fields > .esb__fieldheading:first-child {
	margin-top: 0;
}

.esb .esb__fieldtext {
	margin: 0 0 18px;
	font-size: 15px;
	line-height: 1.6;
	color: var(--esb-body);
}

.esb__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.esb .esb__formerr {
	margin: 16px 0 0;
	padding: 12px 14px;
	border-radius: var(--esb-radius);
	background: var(--esb-danger-soft);
	font-size: 15px;
	font-weight: 600;
	color: var(--esb-danger);
}

.esb .esb__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	margin-top: 20px;
	padding: 12px 32px;
	border: 1px solid var(--esb-accent);
	border-radius: var(--esb-radius);
	background: var(--esb-accent);
	font-family: inherit;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.esb .esb__submit:hover:not(:disabled) {
	border-color: var(--esb-accent-dark);
	background: var(--esb-accent-dark);
	color: #fff;
}

.esb .esb__submit:disabled {
	cursor: progress;
	opacity: 0.7;
}

.esb .esb__submit--ghost {
	background: transparent;
	color: var(--esb-accent);
}

.esb .esb__submit--ghost:hover:not(:disabled) {
	background: var(--esb-accent-soft);
	color: var(--esb-accent-dark);
}

/* ---------- Užregistruota ---------- */

.esb--done .esb__meta {
	display: none;
}

.esb__done {
	display: grid;
	grid-template-columns: 28px minmax(0, 1fr);
	column-gap: 16px;
	padding: 24px 0 8px;
	border-top: 1px solid var(--esb-ink);
	animation: esb-in 0.4s var(--esb-ease) both;
}

.esb__done:focus {
	outline: none;
}

.esb__donemark {
	grid-row: 1 / span 3;
	margin-top: 4px;
	color: var(--esb-accent);
}

.esb .esb__donetitle {
	margin: 0 0 4px;
	font-family: var(--esb-display, inherit);
	font-size: 24px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--esb-ink);
	font-variant-numeric: tabular-nums;
}

.esb .esb__donemeta {
	margin: 0 0 10px;
	font-size: 16px;
	color: var(--esb-ink);
}

.esb .esb__donetext {
	margin: 0;
	max-width: 60ch;
	font-size: 16px;
	color: var(--esb-body);
}

/* ---------- Pranešimų blokas (patvirtinimas, atšaukimas) ---------- */

.esb--note {
	max-width: 600px;
	padding: 24px 0;
	border-top: 1px solid var(--esb-ink);
	border-bottom: 1px solid var(--esb-line);
	font-size: 17px;
}

.esb--note p {
	margin: 0 0 4px;
}

.esb.esb--note h3 {
	margin: 0 0 8px;
	font-family: var(--esb-display, inherit);
	font-size: 24px;
	font-weight: 600;
	color: var(--esb-ink);
}

/* ---------- Plotis ---------- */

@media (max-width: 820px) {
	.esb__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}

	.esb__calendar {
		max-width: 420px;
	}
}

@media (max-width: 600px) {
	.esb__stephead {
		grid-template-columns: 1.75rem minmax(0, 1fr) auto;
		column-gap: 8px;
	}

	.esb__stepbody {
		padding-left: 0;
		padding-bottom: 28px;
	}

	.esb__step[data-state="open"] .esb__steptitle {
		font-size: 22px;
	}

	.esb .esb__option {
		grid-template-columns: 18px minmax(0, 1fr);
		padding: 14px 8px;
	}

	.esb__optmeta {
		grid-column: 2;
		margin-top: 4px;
		padding-left: 0;
		text-align: left;
		color: var(--esb-ink);
	}

	.esb__row {
		grid-template-columns: 1fr;
	}

	.esb .esb__submit {
		width: 100%;
	}
}

/* ---------- Judesys ---------- */

@media (prefers-reduced-motion: reduce) {
	.esb *,
	.esb *::before,
	.esb *::after,
	.esb__done {
		animation: none !important;
		transition: none !important;
	}
}
