/**
 * Форми и бутони по компонентите във Фигма (Inputs 1868:4458, Input dropdown 1870:6756,
 * checkbox 2048:4145, Tooltip 1824:17948, Button 1429:1584) — в мащаба на сайта
 * (Фигма 16 → 14, 18 → 16, отстъпи ×0.875).
 */

/* ---------------------------------------------------------------- Бутони */

/* Фигма: радиус 8 (при нас беше 5), хоризонтален отстъп 32 → 28. */
.elementor .e-button-base:is(.hts-btn-teal, .hts-btn-white, .hts-btn-outline, .hts-btn-ghost),
.elementor :is(button, [type="submit"]):is(.hts-btn-teal, .hts-btn-white, .hts-btn-outline, .hts-btn-ghost),
.elementor-location-header a.e-button-base {
	border-radius: 8px !important;
}

@media (min-width: 1025px) {
	.elementor .e-button-base:is(.hts-btn-teal, .hts-btn-white, .hts-btn-outline, .hts-btn-ghost):not(.hts-btn-block) {
		padding-left: 28px;
		padding-right: 28px;
	}
}

/* CTA-тата на курсовете и „Какво“ са сметнати за два бутона един до друг — там остава 24. */
@media (min-width: 1025px) {
	.elementor .hts-btn-row > .e-button-base:is(.hts-btn-teal, .hts-btn-white, .hts-btn-outline, .hts-btn-ghost) {
		padding-left: 24px !important;
		padding-right: 24px !important;
	}
}

/* Бутонът в хедъра се рендерираше със системен шрифт и 600 — Фигма: Raleway Bold. */
.elementor-location-header a.e-button-base {
	font-family: var(--raleway, 'Raleway'), sans-serif !important;
	font-weight: 700 !important;
}

/* ---------------------------------------------------------------- Полета */

/* Височина: Фигма 52 (16 + 2×16 + рамка) → 48 в мащаба (14px текст, 14px отстъп). */
:is(form.hts-form, form.e-form-base) input:is([type="text"], [type="email"], [type="tel"], [type="number"], [type="url"]) {
	height: auto !important;
	min-height: 48px;
	padding: 14px !important;
	line-height: 1.28 !important;
	box-sizing: border-box;
}

/* Фокус: тюркоазена рамка #00b0b5 (Фигма „focused“), без браузърен контур. Грешката остава червена. */
:is(form.hts-form, form.e-form-base) :is(input:not([type="checkbox"]):not([type="radio"]), textarea):not(.htp-invalid):focus {
	border-color: #00b0b5 !important;
	outline: none !important;
	box-shadow: none !important;
}

:is(form.hts-form, form.e-form-base) :is(input, textarea)::placeholder {
	color: #a1abc4;
	opacity: 1;
}

/* Падащо меню: същият размер като полетата (Фигма 16/16 → 14/14), за да са еднакво високи. */
.htp-dd__chevron {
	flex-basis: 18px !important;
	width: 18px !important;
	height: 18px !important;
	background-size: 18px !important;
}

.htp-dd__trigger {
	min-height: 48px;
	padding: 14px !important;
	font-size: 14px !important;
	line-height: 1.28 !important;
}

.htp-dd__list {
	gap: 14px;
	padding: 14px;
}

.htp-dd__option {
	font-size: 14px;
	line-height: 1.28;
}

/* Форма за билети: фокус като на останалите полета. */
.htp-tf-person input:focus,
.htp-tf-qty select:focus {
	outline: none !important;
	border-color: #00b0b5 !important;
}

/* Бутонът „Купете билет“ — Фигма primary green: 18 Bold → 16, отстъпи 12/28, радиус 8. */
.htp-tf-submit {
	padding: 12px 28px !important;
	border-radius: 8px !important;
	font-size: 16px !important;
	line-height: 1.5 !important;
}

/* ---------------------------------------------------------------- Tooltip (Фигма „Tooltip“, тъмен) */

/* Отзиви: контейнер #2e384d, радиус 4, отстъп 12, текст #e5e8f0 SemiBold (14 → 13 в мащаба), 20px ред. */
.hts-rating-info[data-htp-tip]::after {
	padding: 12px !important;
	border-radius: 4px !important;
	background: #2e384d !important;
	color: #e5e8f0 !important;
	font: 600 13px/20px var(--raleway, 'Raleway'), sans-serif !important;
}

/* Опашка 10×6 (Фигма). */
.hts-rating-info[data-htp-tip]::before {
	border-width: 0 5px 6px !important;
	border-style: solid !important;
	border-color: transparent transparent #2e384d !important;
	top: calc(100% + 4px) !important;
}

/* Чекбокс — точно по компонента „checkbox“ от Фигма (2048:4144 / 2048:4146):
   18×18, рамка 1px #00B0B5, радиус 3px; отметнат — фон #00B0B5 и отметка (12×8.25, линия 1px, заоблени краища) #FDFDFD.
   Отметката е вграден вектор (data URI) — остра при всяко увеличение. */
input.hts-form-check[type="checkbox"],
.e-form-base input[type="checkbox"] {
	-webkit-appearance: none !important;
	appearance: none !important;
	flex: 0 0 18px;
	width: 18px !important;
	height: 18px !important;
	margin: 0;
	padding: 0;
	border: 1px solid #00b0b5 !important;
	border-radius: 3px !important;
	background: transparent none 0 0 / 16px 16px no-repeat !important;
	box-sizing: border-box;
	cursor: pointer;
	transition: background-color .15s ease;
}

/* Отметката — с CSS рамки (браузърът я чертае векторно при всяко увеличение).
   Геометрия от Фигма: връх (6.75; 12.75), късо рамо до (3; 9) ≈ 5.3px, дълго до (15; 4.5) ≈ 11.7px. */
input.hts-form-check[type="checkbox"]::after,
.e-form-base input[type="checkbox"]::after {
	content: "" !important;
	position: absolute;
	/* спрямо вътрешността (рамката е 1px): връх − размер − 1 */
	left: .45px;
	top: .05px;
	width: 5.3px;
	height: 11.7px;
	box-sizing: border-box;
	border: solid #fdfdfd;
	border-width: 0 1.2px 1.2px 0;
	border-bottom-right-radius: .6px;
	transform-origin: 100% 100%;
	transform: rotate(45deg) scale(0);
	transition: transform .15s ease;
}

input.hts-form-check[type="checkbox"],
.e-form-base input[type="checkbox"] {
	position: relative;
}

input.hts-form-check[type="checkbox"]:checked,
.e-form-base input[type="checkbox"]:checked {
	background-color: #00b0b5 !important;
	background-image: none !important;
}

input.hts-form-check[type="checkbox"]:checked::after,
.e-form-base input[type="checkbox"]:checked::after {
	transform: rotate(45deg) scale(1);
}

input.hts-form-check[type="checkbox"]:focus-visible,
.e-form-base input[type="checkbox"]:focus-visible {
	outline: 2px solid #00b0b5;
	outline-offset: 2px;
}

input.hts-form-check.htp-invalid[type="checkbox"],
.e-form-base input.htp-invalid[type="checkbox"] {
	border-color: #d64545 !important;
	box-shadow: none !important;
}

/* Elementor рисува своя (назъбена) отметка в ::before — изключена, остава само тази по Фигма. */
input.hts-form-check[type="checkbox"]::before,
.e-form-base input[type="checkbox"]::before {
	content: none !important;
	display: none !important;
}

/* Бюлетин („Научете първи за предстоящите събития…“): съобщенията не влизат в реда с полето. */
form:has(input[name="newsletter-email"]) {
	flex-wrap: wrap !important;
	position: relative;
}

form:has(input[name="newsletter-email"]) :is(.e-form-success-message-base, .e-form-error-message-base) {
	flex: 0 0 100% !important;
	width: 100% !important;
	order: 5;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
	font: 600 16px/1.4 Raleway, sans-serif !important;
	text-align: left;
}

form:has(input[name="newsletter-email"]) .e-form-success-message-base,
form:has(input[name="newsletter-email"]) .e-form-success-message-base * {
	color: #006d77 !important;
}

form:has(input[name="newsletter-email"]) .e-form-error-message-base,
form:has(input[name="newsletter-email"]) .e-form-error-message-base * {
	color: #d64545 !important;
	font-size: 14px !important;
}

/* Успех: вместо полето и бутона — само благодарността, на цялата ширина на карето. */
form.form-state-success:has(input[name="newsletter-email"]) > :is(input, button, .htp-field-error) {
	display: none !important;
}

form.form-state-success:has(input[name="newsletter-email"]) .e-form-success-message-base {
	display: flex !important;
	align-items: center;
	min-height: 52px;
}

/* Грешка от сървъра: под полето, на нов ред. */
form.form-state-error:has(input[name="newsletter-email"]) .e-form-error-message-base {
	display: block !important;
	padding-top: 10px !important;
}

form.form-state-success:has(input[name="newsletter-email"]) {
	outline: none !important;
}

form.form-state-success:has(input[name="newsletter-email"]) .e-form-success-message-base {
	padding: 0 16px !important;
}

form:has(input[name="newsletter-email"]) > input {
	flex: 1 1 0 !important;
	min-width: 0 !important;
	width: auto !important;
}

form:has(input[name="newsletter-email"]) > button {
	flex: 0 0 auto !important;
}

form:has(input[name="newsletter-email"]) :is(.e-form-success-message-base, .e-form-error-message-base):focus {
	outline: none !important;
}

/* Бюлетин на тесни екрани (≤430px): полето на цяла ширина, бутонът под него — подсказката не се реже. */
@media (max-width: 430px) {
	form:has(input[name="newsletter-email"]) {
		flex-direction: column !important;
		align-items: stretch !important;
		gap: 10px !important;
	}

	form:has(input[name="newsletter-email"]) > :is(input, button) {
		width: 100% !important;
		flex: 0 0 auto !important;
	}
}
