/* Формы заявок, модальное окно, мобильная панель и плавающие мессенджеры. */

.bl-lead-form {
	display: grid;
	gap: .85rem;
	width: 100%;
	max-width: 520px;
}

.bl-text-center .bl-lead-form,
.bl-lead-form--center { margin-inline: auto; }

.bl-lead-form__heading {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 720;
	letter-spacing: -0.02em;
}

.bl-lead-form__text {
	margin: -.35rem 0 0;
	font-size: .9rem;
	line-height: 1.55;
	opacity: .72;
}

.bl-lead-form__fields {
	display: grid;
	gap: .7rem;
}

.bl-lead-form--inline { max-width: none; }

.bl-lead-form--inline .bl-lead-form__fields {
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.bl-lead-form--inline .bl-lead-form__submit { justify-self: start; }

.bl-lead-form__field {
	display: grid;
	gap: .3rem;
}

.bl-lead-form__field--comment { grid-column: 1 / -1; }

.bl-lead-form__label {
	font-size: .78rem;
	font-weight: 600;
	letter-spacing: .01em;
	opacity: .7;
}

.bl-lead-form input,
.bl-lead-form textarea {
	width: 100%;
	padding: .78rem .95rem;
	border: 1px solid var(--bl-border);
	border-radius: calc(var(--bl-card-radius) * .55);
	background: var(--bl-surface);
	color: inherit;
	font: inherit;
	font-size: .95rem;
	transition: border-color .18s ease, box-shadow .18s ease;
}

.bl-lead-form textarea { resize: vertical; min-height: 92px; }

.bl-lead-form input:focus,
.bl-lead-form textarea:focus {
	outline: none;
	border-color: var(--bl-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--bl-accent) 20%, transparent);
}

/* Без color браузер подставляет свой серый, и на тёмной секции подсказка
   тонет в фоне. currentColor наследует цвет поля и работает в любой теме. */
.bl-lead-form input::placeholder,
.bl-lead-form textarea::placeholder { color: currentColor; opacity: .5; }

/* Ловушка для ботов: убрана из потока, но остаётся в DOM и доступна автозаполнению робота. */
.bl-lead-form__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.bl-lead-form__consent {
	display: flex;
	align-items: flex-start;
	gap: .55rem;
	font-size: .78rem;
	line-height: 1.5;
	opacity: .72;
	cursor: pointer;
}

.bl-lead-form__consent input {
	width: 1rem;
	height: 1rem;
	margin-top: .12rem;
	padding: 0;
	flex-shrink: 0;
	accent-color: var(--bl-accent);
}

.bl-lead-form__consent a { color: inherit; }

.bl-lead-form__submit { justify-self: stretch; text-align: center; }

.bl-lead-form__status {
	font-size: .88rem;
	font-weight: 600;
	line-height: 1.5;
}

.bl-lead-form__status:empty { display: none; }
.bl-lead-form__status.is-error { color: #d94a3d; }
.bl-lead-form__status.is-success { color: #1f9d55; }

/* --- Модальное окно --- */
body.bl-modal-open { overflow: hidden; }

/* display:flex перебил бы атрибут hidden, поэтому закрытое состояние задаётся явно. */
.bl-modal[hidden] { display: none; }

.bl-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.bl-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(12, 14, 20, .62);
	backdrop-filter: blur(3px);
	animation: bl-modal-fade .2s ease;
}

.bl-modal__window {
	position: relative;
	z-index: 1;
	width: min(460px, 100%);
	max-height: 90vh;
	overflow-y: auto;
	padding: clamp(1.5rem, 3vw, 2.25rem);
	border-radius: clamp(14px, 2vw, 22px);
	background: var(--bl-color-surface, #fff);
	color: var(--bl-color-text, #12141a);
	box-shadow: 0 30px 80px rgba(10, 12, 20, .35);
	animation: bl-modal-in .24s cubic-bezier(.2, .8, .25, 1);
}

@keyframes bl-modal-fade { from { opacity: 0; } }
@keyframes bl-modal-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }

@media (prefers-reduced-motion: reduce) {
	.bl-modal__overlay, .bl-modal__window { animation: none; }
}

.bl-modal__close {
	position: absolute;
	top: .9rem;
	right: .9rem;
	width: 2.1rem;
	height: 2.1rem;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: color-mix(in srgb, currentColor 8%, transparent);
	color: inherit;
	cursor: pointer;
	transition: background-color .18s ease;
}

.bl-modal__close:hover { background: color-mix(in srgb, currentColor 16%, transparent); }
.bl-modal__close svg { width: 1.05rem; height: 1.05rem; }

.bl-modal__title {
	margin: 0 2rem .4rem 0;
	font-size: 1.4rem;
	font-weight: 740;
	letter-spacing: -0.02em;
}

.bl-modal__text {
	margin: 0 0 1.25rem;
	font-size: .92rem;
	line-height: 1.6;
	opacity: .72;
}

/* --- Мобильная панель действий --- */
.bl-mobile-bar { display: none; }

@media (max-width: 767px) {
	.bl-mobile-bar {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		z-index: 900;
		display: grid;
		grid-auto-flow: column;
		grid-auto-columns: 1fr;
		padding: .4rem .3rem calc(.4rem + env(safe-area-inset-bottom));
		background: var(--bl-color-surface, #fff);
		border-top: 1px solid var(--bl-color-border-light, rgba(0, 0, 0, .08));
		box-shadow: 0 -6px 24px rgba(10, 12, 20, .1);
	}

	.bl-mobile-bar a,
	.bl-mobile-bar button {
		display: grid;
		justify-items: center;
		gap: .2rem;
		padding: .35rem .2rem;
		border: 0;
		background: none;
		color: inherit;
		font: inherit;
		font-size: .68rem;
		font-weight: 600;
		text-decoration: none;
		cursor: pointer;
	}

	.bl-mobile-bar svg { width: 1.25rem; height: 1.25rem; }
	.bl-mobile-bar__cta { color: var(--bl-accent); }

	/* Панель перекрывает низ страницы — добавляем запас, иначе подвал под ней прячется. */
	body { padding-bottom: 4.2rem; }

	.bl-float-contacts { bottom: 5.2rem; }
}

/* --- Плавающие мессенджеры --- */
.bl-float-contacts {
	position: fixed;
	right: 1rem;
	bottom: 1.25rem;
	z-index: 890;
	display: grid;
	justify-items: end;
	gap: .5rem;
}

.bl-float-contacts__toggle {
	width: 3.2rem;
	height: 3.2rem;
	display: grid;
	place-items: center;
	order: 2;
	border: 0;
	border-radius: 50%;
	background: var(--bl-accent);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 10px 28px color-mix(in srgb, var(--bl-accent) 45%, transparent);
	transition: transform .2s ease;
}

.bl-float-contacts__toggle:hover { transform: scale(1.06); }
.bl-float-contacts__toggle svg { width: 1.5rem; height: 1.5rem; }

.bl-float-contacts__list {
	display: grid;
	gap: .4rem;
	justify-items: end;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.bl-float-contacts.is-open .bl-float-contacts__list {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.bl-float-contacts__item {
	padding: .55rem 1rem;
	border: 0;
	border-radius: 999px;
	background: var(--bl-color-surface, #fff);
	color: var(--bl-color-text, #12141a);
	font: inherit;
	font-size: .85rem;
	font-weight: 620;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	box-shadow: 0 8px 22px rgba(10, 12, 20, .16);
}

.bl-float-contacts__item--wa { color: #128c7e; }
.bl-float-contacts__item--tg { color: #2481cc; }

/* Пока открыто меню или модалка, нижние плашки только мешают. */
body.bl-menu-open .bl-mobile-bar,
body.bl-menu-open .bl-float-contacts,
body.bl-menu-open .bl-cookie,
body.bl-modal-open .bl-mobile-bar,
body.bl-modal-open .bl-float-contacts,
body.bl-modal-open .bl-cookie { display: none; }
