/**
 * Cookie-баннер, настройки cookie и форма «Написать нам».
 * Подключается отдельно от style-1.css, чтобы не задевать существующую вёрстку.
 */

:root {
	--qh-blue: #0047AB;
	--qh-blue-dark: #0b2a5b;
	--qh-ink: #1d1d1b;
	--qh-muted: #5b6472;
	--qh-line: #e3e7ee;
}

.qh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	/*
	 * Высота кнопки набирается паддингами, а не min-height: Safari игнорирует
	 * min-height у <button> с display:flex, и надпись уезжает от центра.
	 * 15 + 18 + 15 = 48px.
	 */
	min-height: 48px;
	padding: 14px 26px;
	border: 1px solid transparent;
	border-radius: 2px;
	font-size: 15px;
	line-height: 18px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.qh-btn--primary {
	background: var(--qh-blue);
	border-color: var(--qh-blue);
	color: #fff;
}

.qh-btn--primary:hover,
.qh-btn--primary:focus {
	background: var(--qh-blue-dark);
	border-color: var(--qh-blue-dark);
	color: #fff;
}

.qh-btn--outline {
	background: #fff;
	border-color: var(--qh-blue);
	color: var(--qh-blue);
}

.qh-btn--outline:hover,
.qh-btn--outline:focus {
	background: var(--qh-blue);
	color: #fff;
}

.qh-btn--link {
	background: transparent;
	border-color: transparent;
	color: var(--qh-blue);
	text-decoration: underline;
	padding-left: 12px;
	padding-right: 12px;
}

.qh-btn--link:hover,
.qh-btn--link:focus {
	color: var(--qh-blue-dark);
}

/* ---------- баннер ---------- */

.qh-cookie {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1080;
	background: #fff;
	border-top: 1px solid var(--qh-line);
	box-shadow: 0 -8px 32px rgba(11, 42, 91, .14);
	padding: 22px 0;
}

.qh-cookie--hidden {
	display: none;
}

.qh-cookie__inner {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 28px;
}

.qh-cookie__content {
	flex: 1 1 auto;
	min-width: 0;
}

.qh-cookie__title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 700;
	color: var(--qh-blue-dark);
}

.qh-cookie__text {
	margin: 0 0 6px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--qh-muted);
}

.qh-cookie__more {
	display: inline-block;
	margin-top: 6px;
	font-size: 14px;
	color: var(--qh-blue);
	text-decoration: underline;
}

.qh-cookie__actions {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}

/* «Принять все» и «Только необходимые» одного размера и веса */
.qh-cookie__actions .qh-btn--primary,
.qh-cookie__actions .qh-btn--outline {
	min-width: 210px;
}

@media (max-width: 991.98px) {
	.qh-cookie__inner {
		flex-direction: column;
		gap: 18px;
	}

	.qh-cookie__actions {
		width: 100%;
	}

	.qh-cookie__actions .qh-btn {
		flex: 1 1 200px;
	}
}

@media (max-width: 575.98px) {
	.qh-cookie {
		padding: 18px 0;
		max-height: 85vh;
		overflow-y: auto;
	}

	.qh-cookie__actions .qh-btn {
		flex: 1 1 100%;
		min-width: 0;
	}
}

/* ---------- модалка настроек ---------- */

.qh-consent-modal {
	position: fixed;
	inset: 0;
	z-index: 1090;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.qh-consent-modal[hidden] {
	display: none !important;
}

.qh-consent-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(11, 42, 91, .6);
	border: 0;
}

.qh-consent-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 640px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 4px;
	overflow: hidden;
}

.qh-consent-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 28px;
	background: var(--qh-blue-dark);
	color: #fff;
}

.qh-consent-modal__title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
}

.qh-consent-modal__close {
	background: none;
	border: 0;
	padding: 6px;
	color: #fff;
	cursor: pointer;
	line-height: 0;
}

.qh-consent-modal__body {
	padding: 24px 28px;
	overflow-y: auto;
}

.qh-consent-modal__intro {
	margin: 0 0 20px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--qh-muted);
}

.qh-consent-group {
	padding: 18px 0;
	border-top: 1px solid var(--qh-line);
}

.qh-consent-group__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.qh-consent-group__title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--qh-blue-dark);
}

.qh-consent-group__state {
	margin: 2px 0 0;
	font-size: 13px;
	color: var(--qh-muted);
}

.qh-consent-group__text {
	margin: 10px 0 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--qh-muted);
}

.qh-consent-modal__more {
	display: inline-block;
	margin-top: 18px;
	font-size: 14px;
	color: var(--qh-blue);
	text-decoration: underline;
}

.qh-consent-modal__footer {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	padding: 20px 28px;
	border-top: 1px solid var(--qh-line);
}

.qh-consent-modal__footer .qh-btn {
	flex: 1 1 auto;
}

body.qh-consent-open {
	overflow: hidden;
}

@media (max-width: 575.98px) {
	.qh-consent-modal {
		padding: 0;
	}

	.qh-consent-modal__dialog {
		max-width: none;
		max-height: 100vh;
		height: 100%;
		border-radius: 0;
	}

	.qh-consent-modal__header,
	.qh-consent-modal__body,
	.qh-consent-modal__footer {
		padding-left: 18px;
		padding-right: 18px;
	}

	.qh-consent-modal__footer .qh-btn {
		flex: 1 1 100%;
	}
}

/* ---------- переключатель ---------- */

.qh-switch {
	position: relative;
	flex: 0 0 auto;
	width: 52px;
	height: 28px;
	margin: 0;
}

.qh-switch input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.qh-switch__slider {
	position: absolute;
	inset: 0;
	background: #c7ceda;
	border-radius: 28px;
	transition: background-color .2s ease;
	pointer-events: none;
}

.qh-switch__slider::before {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 22px;
	height: 22px;
	background: #fff;
	border-radius: 50%;
	transition: transform .2s ease;
}

.qh-switch input:checked + .qh-switch__slider {
	background: var(--qh-blue);
}

.qh-switch input:checked + .qh-switch__slider::before {
	transform: translateX(24px);
}

.qh-switch input:focus-visible + .qh-switch__slider {
	outline: 2px solid var(--qh-blue-dark);
	outline-offset: 2px;
}

.qh-switch--locked .qh-switch__slider {
	background: #8fa9d8;
}

.qh-switch--locked input {
	cursor: not-allowed;
}

/* ---------- ссылки в подвале ---------- */

/* На мобильных ссылки идут одна под другой, на десктопе — в строку */
.qh-footer-legal {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
	margin-bottom: 14px;
	font-size: 12px;
	line-height: 1.4;
}

.qh-footer-legal__link {
	color: inherit;
	opacity: .75;
	text-decoration: underline;
	font-size: 12px;
}

.qh-footer-legal__link:hover,
.qh-footer-legal__link:focus {
	opacity: 1;
	color: inherit;
}

.qh-footer-legal__btn {
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	font: inherit;
	font-size: 12px;
}

.qh-footer-legal__sep {
	display: none;
	opacity: .5;
}

@media (min-width: 992px) {
	.qh-footer-legal {
		flex-direction: row;
		align-items: center;
		justify-content: flex-start;
		gap: 8px;
		margin-bottom: 8px;
	}

	.qh-footer-legal__sep {
		display: inline;
	}
}

/* ---------- форма «Написать нам» ---------- */

.qh-contact-form {
	max-width: 720px;
	margin: 0 auto;
}

.qh-contact-form__title {
	margin: 0 0 10px;
	font-size: 32px;
	font-weight: 700;
	color: var(--qh-blue-dark);
}

.qh-contact-form__subtitle {
	margin: 0 0 28px;
	font-size: 15px;
	line-height: 1.55;
	color: var(--qh-muted);
}

.qh-field {
	margin-bottom: 22px;
}

.qh-field__label {
	display: block;
	margin-bottom: 6px;
	font-size: 12px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--qh-muted);
}

.qh-field__control {
	width: 100%;
	padding: 10px 0;
	border: 0;
	border-bottom: 1px solid #b9c2d0;
	border-radius: 0;
	background: transparent;
	font-size: 16px;
	color: var(--qh-ink);
	transition: border-color .2s ease;
}

.qh-field__control:focus {
	outline: none;
	border-bottom-color: var(--qh-blue);
}

textarea.qh-field__control {
	min-height: 110px;
	resize: vertical;
}

.qh-field--invalid .qh-field__control {
	border-bottom-color: #c0392b;
}

.qh-field__error {
	display: none;
	margin: 6px 0 0;
	font-size: 13px;
	color: #c0392b;
}

.qh-field--invalid .qh-field__error {
	display: block;
}

.qh-contact-form__notice {
	margin: 0 0 18px;
	font-size: 13px;
	line-height: 1.6;
	color: var(--qh-muted);
}

.qh-contact-form__notice a {
	color: var(--qh-blue);
	text-decoration: underline;
}

.qh-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 24px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--qh-ink);
	cursor: pointer;
}

/*
 * В style-1.css задан глобальный сброс input { appearance: none },
 * из-за него системный чекбокс не рисуется — рисуем свой.
 */
.qh-check input[type="checkbox"] {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	padding: 0;
	border: 1px solid #b9c2d0;
	border-radius: 2px;
	background: #fff;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 12px 12px;
	cursor: pointer;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	transition: background-color .15s ease, border-color .15s ease;
}

.qh-check input[type="checkbox"]:checked {
	background-color: var(--qh-blue);
	border-color: var(--qh-blue);
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 8.4l3.3 3.3L13 5' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.qh-check input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--qh-blue-dark);
	outline-offset: 2px;
}

/* Плейсхолдер «Согласие М» — до получения текста ссылка не кликабельна */
.qh-check__doc {
	color: var(--qh-muted);
	text-decoration: underline dotted;
	cursor: default;
}

.qh-contact-form__submit {
	width: 100%;
	/* 18 + 18 + 18 + 2px рамки = 56px */
	min-height: 56px;
	padding-top: 18px;
	padding-bottom: 18px;
	font-size: 15px;
	line-height: 18px;
	letter-spacing: .06em;
	text-transform: uppercase;
}

/* letter-spacing добавляет отступ после последнего символа — компенсируем,
   чтобы надпись стояла ровно по центру кнопки */
.qh-contact-form__submit .qh-btn__label {
	display: block;
	padding-left: .06em;
	line-height: 18px;
}

.qh-contact-form__submit[disabled] {
	opacity: .6;
	cursor: not-allowed;
}

.qh-contact-form__message {
	display: none;
	margin-top: 18px;
	padding: 14px 18px;
	border-radius: 2px;
	font-size: 14px;
	line-height: 1.5;
}

.qh-contact-form__message--visible {
	display: block;
}

.qh-contact-form__message--ok {
	background: #eaf3ff;
	color: var(--qh-blue-dark);
}

.qh-contact-form__message--error {
	background: #fdecea;
	color: #a5281b;
}

.qh-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

@media (max-width: 575.98px) {
	.qh-contact-form__title {
		font-size: 26px;
	}
}

/* обёртка копирайта и правовых ссылок в подвале */
.footer-bottom__copyright-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
}

@media (min-width: 992px) {
	.footer-bottom__copyright-wrap {
		align-items: flex-start;
	}
}

/*
 * Нижний отступ с запасом: секция карты в теме поднята на margin-top: -2.5rem
 * и накрыта белым слоем .map #map::after (47px, z-index: 10). Без запаса
 * этот слой ложится поверх нижней части кнопки отправки.
 */
.qh-contact-section {
	padding: 60px 0 100px;
}

@media (max-width: 575.98px) {
	.qh-contact-section {
		padding: 36px 0 80px;
	}
}
