/* Плавающая форма «Вопрос юристу» (templates/questions/forms/ask_bottom_form.twig) */
.askBottom {
	--ab-accent: #B11A1A;
	--ab-accent-dark: #8e1414;
	--ab-submit: var(--blue, #1e7bca);
	--ab-submit-hover: var(--blue600, #1063ac);
	--ab-call: #019126;
	--ab-call-hover: #017a20;
	--ab-text: #111;
	--ab-muted: #55677d;
	--ab-border: #ced1d4;
	--ab-kb: 0px; /* высота экранной клавиатуры на iOS, считает JS */

	position: fixed;
	right: 24px;
	bottom: 0;
	z-index: 9998;
	width: 400px;
	margin: 0;
	background: #fff;
	border-radius: 14px 14px 0 0;
	box-shadow: 0 -4px 28px rgba(0, 0, 0, .22), 0 0 0 1px rgba(0, 0, 0, .04);
	overflow: hidden;
	font-family: Arial, sans-serif;
	color: var(--ab-text);
	transition: transform .35s ease, opacity .35s ease;
	will-change: transform;
	backface-visibility: hidden;
	animation: askBottomIn .45s ease-out both;
}
/* A/B-вариант 2 (log_abtest = 2) */
.askBottom--alt {
	--ab-accent: #249641;
	--ab-accent-dark: #1b7533;
}
.askBottom *,
.askBottom *::before,
.askBottom *::after {
	box-sizing: border-box;
}

.askBottom__head {
	position: relative;
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px 12px;
	padding: 10px 40px 10px 16px;
	background: var(--ab-accent);
	color: #fff;
}
.askBottom--collapsed .askBottom__body,
.askBottom--collapsed .askBottom__cookie {
	display: none;
}
.askBottom--collapsed .askBottom__head {
	cursor: pointer;
}
.askBottom__close {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	font: 24px/26px Arial, sans-serif;
	color: #fff;
	opacity: .8;
	cursor: pointer;
	transition: opacity .15s, background-color .15s;
}
.askBottom__close:hover {
	opacity: 1;
	background: rgba(255, 255, 255, .2);
}
.askBottom__close:focus-visible {
	outline: 2px solid #fff;
}
.askBottom__title {
	font-size: 18px;
	font-weight: bold;
	line-height: 1.2;
}
.askBottom__sub {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	line-height: 1.2;
}
.askBottom__sub::before {
	content: '';
	width: 8px;
	height: 8px;
	flex: none;
	border-radius: 50%;
	background: #ffd556;
	animation: askBottomPulse 2s infinite;
}

.askBottom__body {
	padding: 12px 14px 14px;
}
.askBottom__label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
.askBottom__text {
	display: block;
	width: 100%;
	height: 72px;
	min-height: 72px;
	max-height: 40vh;
	margin: 0;
	padding: 10px 12px;
	border: 2px solid var(--ab-border);
	border-radius: 10px;
	background: #fff;
	font: 16px/1.4 Arial, sans-serif; /* 16px — иначе iOS зумит страницу при фокусе */
	color: var(--ab-text);
	resize: none;
	overflow-y: auto;
	transition: border-color .15s, box-shadow .15s;
}
.askBottom__text::placeholder {
	color: #788696;
}
.askBottom__text:focus {
	outline: none;
	border-color: var(--ab-submit);
	box-shadow: 0 0 0 3px rgba(30, 123, 202, .2);
}
.askBottom__text.is-invalid {
	border-color: #e93838;
	box-shadow: 0 0 0 3px rgba(233, 56, 56, .15);
}

.askBottom__footer {
	display: flex;
	align-items: stretch;
	gap: 10px;
	margin-top: 10px;
}
.askBottom__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	margin: 0;
	padding: 4px 18px;
	border: 0;
	border-radius: 10px;
	font: bold 16px/1.15 Arial, sans-serif;
	color: #fff;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: background-color .15s, transform .1s;
}
.askBottom__btn:hover {
	color: #fff;
	text-decoration: none;
}
.askBottom__btn:active {
	transform: scale(.97);
}
.askBottom__btn:focus-visible {
	outline: 3px solid rgba(30, 123, 202, .45);
	outline-offset: 2px;
}
.askBottom__btn--call {
	flex: 1 1 auto;
	justify-content: flex-start;
	padding-left: 14px;
	background: var(--ab-call);
	text-align: left;
}
.askBottom__btn--call:hover {
	background: var(--ab-call-hover);
}
.askBottom__callText {
	display: flex;
	flex-direction: column;
}
.askBottom__callNum {
	font-size: 17px;
}
.askBottom__callNote {
	font-size: 12px;
	font-weight: normal;
	opacity: .9;
}
.askBottom__btn--submit {
	flex: 0 0 auto;
	min-width: 130px;
	background: var(--ab-submit);
	font-size: 17px;
}
.askBottom__btn--submit:hover {
	background: var(--ab-submit-hover);
}

/* Куки-уведомление, встроенное в низ формы (public/js/bottom.js) */
.askBottom__cookie {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 12px;
	background: #f1f3f5;
	border-top: 1px solid #e1e4e8;
	font-size: 10.5px;
	line-height: 1.25;
	color: var(--ab-muted);
}
.askBottom__cookieText {
	flex: 1 1 auto;
}
.askBottom__cookie a {
	color: inherit;
	text-decoration: underline;
}
.askBottom__cookieBtn {
	flex: none;
	margin: 0;
	padding: 2px 10px;
	border: 1px solid var(--ab-border);
	border-radius: 6px;
	background: #fff;
	font: bold 11px/1.4 Arial, sans-serif;
	color: var(--ab-text);
	cursor: pointer;
}
.askBottom__cookieBtn:hover {
	background: #e9ecef;
}

/* ---------- Мобильный ---------- */
@media (max-width: 640px) {
	.askBottom {
		left: 0;
		right: 0;
		bottom: var(--ab-kb);
		width: auto;
		border-radius: 14px 14px 0 0;
		padding-bottom: env(safe-area-inset-bottom);
		animation: none; /* появление делает .askBottom--waiting, анимация с fill перебила бы его transform */
	}
	.askBottom--waiting {
		transform: translateY(110%);
		opacity: 0;
		pointer-events: none;
	}
	.askBottom__head {
		padding: 7px 12px;
	}
	.askBottom__title {
		font-size: 16px;
	}
	.askBottom__sub {
		font-size: 13px;
	}
	.askBottom__body {
		padding: 8px 10px 10px;
	}
	.askBottom__text {
		height: 56px;
		min-height: 56px;
		padding: 8px 10px;
	}
	.askBottom__footer {
		gap: 8px;
		margin-top: 8px;
	}
	.askBottom__btn {
		padding: 4px 12px;
	}
	.askBottom__btn--call {
		flex: 1 1 0;
		min-width: 0;
		padding-left: 10px;
	}
	.askBottom__callNum {
		font-size: 15px;
	}
	.askBottom__btn--submit {
		min-width: 0;
		flex: 0 0 38%;
	}

	/* Чтобы панель не закрывала низ страницы */
	body.askBottom-shown {
		padding-bottom: calc(190px + env(safe-area-inset-bottom));
	}
	body.askBottom-shown.askBottom-cookie {
		padding-bottom: calc(225px + env(safe-area-inset-bottom));
	}
	body.askBottom-shown.askBottom-collapsed {
		padding-bottom: calc(60px + env(safe-area-inset-bottom));
	}
}

@media print {
	.askBottom {
		display: none;
	}
}

@keyframes askBottomIn {
	from {transform: translateY(24px); opacity: 0;}
	to {transform: none; opacity: 1;}
}
@keyframes askBottomPulse {
	0% {box-shadow: 0 0 0 0 rgba(255, 213, 86, .7);}
	70% {box-shadow: 0 0 0 7px rgba(255, 213, 86, 0);}
	100% {box-shadow: 0 0 0 0 rgba(255, 213, 86, 0);}
}

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