/* Модальная форма обратной связи #forma (footer.php) по макету Figma:
   Frame 17 — ПК (749px), Frame 18 — мобильная (320px).
   Файл подключается на всех страницах, а старые слои (style.css, mobile.css) задают p, input
   и label по всему сайту — поэтому селекторы от #forma.
   Исключение — display у пунктов .klin: он задан одним классом, чтобы правила hide-klin*
   (классы вешаются на #forma) по-прежнему могли прятать клинику */

#forma {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: none;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background-color: rgba(53, 65, 94, 0.6);
	z-index: 99999;
}
/* #forma открывается через style.display='block', центрирует окно обёртка.
   Если окно выше экрана — оно прокручивается вместе с подложкой */
#forma .frm-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100%;
	padding: 30px 16px;
	box-sizing: border-box;
}
#forma .frm {
	position: relative;
	width: 749px;
	max-width: 100%;
	padding: 60px 60px 45px;
	background-color: #FFFFFF;
	border-radius: 20px;
	box-shadow: 0 20px 60px rgba(53, 65, 94, 0.25);
	font-family: "Roboto", sans-serif;
	text-align: left;
	box-sizing: border-box;
}
#forma .frm *,
#forma .frm *::before,
#forma .frm *::after {
	box-sizing: border-box;
}
#forma form,
#forma p {
	margin: 0;
	padding: 0;
}

/* Закрыть — в макете нет, но без него окно на телефоне не закрыть */
#forma .btnclose {
	position: absolute;
	top: 16px;
	right: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	font-size: 36px;
	line-height: 1;
	color: #8D919E;
	cursor: pointer;
	transition: color .2s ease, background-color .2s ease;
}
#forma .btnclose:hover {
	color: #0099A3;
	background-color: #F2F4F8;
}

/* Заголовок и подзаголовок */
#forma .title-banner {
	font-family: "Oswald", sans-serif;
	font-weight: 700;
	font-size: 64px;
	line-height: 1.48;
	color: #0099A3;
	text-transform: uppercase;
}
#forma .frm-sub {
	margin-top: 10px;
	font-weight: 500;
	font-size: 24px;
	line-height: 30px;
	color: #667089;
}

/* Поля ввода — подчёркнутые, подписи в плейсхолдерах */
#forma .frm-input {
	display: block;
	width: 100%;
	height: auto;
	margin: 50px 0 0;
	padding: 0 0 10px;
	border: 0;
	border-bottom: 1px solid #C7CCDA;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	outline: none;
	font-family: "Roboto", sans-serif;
	font-weight: 500;
	font-size: 24px;
	line-height: 30px;
	color: #444D65;
	transition: border-color .2s ease;
}
#forma .frm-input + .frm-input {
	margin-top: 30px;
}
#forma .frm-input::placeholder {
	color: #ACB0BA;
	opacity: 1;
}
#forma .frm-input:focus {
	border-bottom-color: #0099A3;
}
/* Ханипот: поле должно оставаться в форме, но не быть видимым */
#forma #client_phone_natural {
	padding: 0;
	opacity: 0;
	pointer-events: none;
}

/* Выбор клиники и чекбоксы */
#forma .frm-group-title {
	margin-top: 40px;
	font-weight: 500;
	font-size: 27px;
	line-height: 30px;
	color: #6D7485;
}
.frm-check {
	display: flex;
}
#forma .frm-check {
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	padding: 0;
	font-family: "Roboto", sans-serif;
	font-weight: 500;
	font-size: 24px;
	line-height: 30px;
	color: #6D7485;
	text-align: left;
	cursor: pointer;
}
#forma .frm-check + .frm-check {
	margin-top: 10px;
}
#forma .frm-group-title + .frm-check {
	margin-top: 20px;
}
#forma .frm-check--light {
	font-size: 22px;
	color: #8D919E;
}
#forma .frm-checks {
	margin-top: 40px;
}
/* Свои радиокнопки и чекбоксы: штатные не красятся */
#forma .frm-check input {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	margin: 5px 0 0;
	padding: 0;
	border: 2px solid #6D7485;
	border-radius: 2px;
	background: #FFFFFF no-repeat center / 14px 14px;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
	transition: border-color .2s ease, background-color .2s ease;
}
#forma .frm-check--light input,
#forma .frm-check--consent input {
	border-color: #8D919E;
}
#forma .frm-check input[type="radio"] {
	border-radius: 50%;
}
#forma .frm-check input:checked {
	border-color: #0099A3;
}
#forma .frm-check input[type="radio"]:checked {
	background: radial-gradient(circle, #0099A3 0 4px, #FFFFFF 4.5px);
}
#forma .frm-check input[type="checkbox"]:checked {
	background-color: #0099A3;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.2l3 3 6-6.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
#forma .frm-check input:focus-visible {
	outline: 2px solid rgba(0, 153, 163, 0.5);
	outline-offset: 2px;
}

/* Согласие на обработку данных */
#forma .frm-check--consent {
	margin-top: 35px;
	font-size: 20px;
	color: #B5B8C1;
}
#forma .frm-check--consent a {
	color: inherit;
	text-decoration: none;
}
#forma .frm-check--consent a:hover {
	color: #0099A3;
	text-decoration: underline;
}

/* Форма на страницах акций: «Вы уже были в нашей клинике» в одну строку */
#forma .frm-visited {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 30px;
}
#forma .frm-visited .frm-check {
	margin: 0;
}
#forma .frm-visited__label {
	font-weight: 500;
	font-size: 24px;
	line-height: 30px;
	color: #6D7485;
}

/* Капча — iframe Google, внешний вид не меняется, только отступ */
#forma #recaptcha1 {
	margin-top: 20px;
}
#forma .text-danger {
	color: #E5484D;
	font-size: 16px;
}

#forma input[type="submit"] {
	display: block;
	width: 100%;
	height: 72px;
	margin: 30px 0 0;
	padding: 0 20px;
	border: 0;
	border-radius: 50px;
	background-color: #0099A3;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	font-family: "Roboto", sans-serif;
	font-weight: 600;
	font-size: 24px;
	line-height: 1;
	color: #FFFFFF;
	text-align: center;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color .2s ease;
}
#forma input[type="submit"]:hover {
	background-color: #007F88;
}

/* Ошибки показывает проверка в footer.php через style.display */
.Error_mess {
	display: none;
}
#forma .Error_mess {
	margin-top: 10px;
	font-size: 16px;
	line-height: 1.3;
	color: #E5484D;
}

/* Невысокие экраны (ноутбуки): по макету окно ~970px — ужимаем, чтобы влезало без прокрутки */
@media (min-width: 768px) and (max-height: 1000px) {
	#forma .frm { width: 640px; padding: 45px 45px 35px; }
	#forma .title-banner { font-size: 48px; line-height: 1.3; }
	#forma .frm-sub { font-size: 20px; line-height: 26px; }
	#forma .frm-input { margin-top: 34px; font-size: 20px; line-height: 26px; padding-bottom: 8px; }
	#forma .frm-input + .frm-input { margin-top: 22px; }
	#forma .frm-group-title { margin-top: 28px; font-size: 22px; line-height: 26px; }
	#forma .frm-check,
	#forma .frm-visited__label { font-size: 19px; line-height: 26px; }
	#forma .frm-check--light { font-size: 18px; }
	#forma .frm-check input { margin-top: 3px; }
	#forma .frm-check + .frm-check { margin-top: 6px; }
	#forma .frm-group-title + .frm-check { margin-top: 14px; }
	#forma .frm-checks { margin-top: 26px; }
	#forma .frm-check--consent { margin-top: 24px; font-size: 16px; }
	#forma #recaptcha1 { margin-top: 16px; }
	#forma input[type="submit"] { height: 60px; margin-top: 22px; font-size: 20px; }
}

/* Мобильная версия, Frame 18. Поля — 16px, а не 12px по макету: с меньшим шрифтом
   iOS увеличивает страницу при фокусе на поле */
@media (max-width: 767px) {
	#forma .frm-wrap { padding: 20px 16px; }
	#forma .frm { padding: 30px 20px; }
	#forma .btnclose { top: 6px; right: 6px; width: 32px; height: 32px; font-size: 28px; }
	#forma .title-banner { font-size: 24px; line-height: 1.5; text-align: center; }
	#forma .frm-sub { margin-top: 6px; font-size: 14px; line-height: 1.15; text-align: center; }
	#forma .frm-input { margin-top: 22px; padding-bottom: 6px; font-size: 16px; line-height: 20px; }
	#forma .frm-input + .frm-input { margin-top: 16px; }
	#forma .frm-group-title { margin-top: 24px; font-size: 15px; line-height: 20px; }
	#forma .frm-check,
	#forma .frm-visited__label { gap: 8px; font-size: 13px; line-height: 18px; }
	#forma .frm-check--light { font-weight: 400; font-size: 13px; }
	#forma .frm-check input { flex-basis: 16px; width: 16px; height: 16px; margin-top: 1px; border-width: 1px; background-size: 12px 12px; }
	#forma .frm-check input[type="radio"]:checked { background: radial-gradient(circle, #0099A3 0 3.5px, #FFFFFF 4px); }
	#forma .frm-check + .frm-check { margin-top: 8px; }
	#forma .frm-group-title + .frm-check { margin-top: 10px; }
	#forma .frm-checks { margin-top: 18px; }
	#forma .frm-visited { gap: 8px 20px; }
	#forma .frm-check--consent { margin-top: 16px; font-size: 11px; line-height: 16px; }
	#forma #recaptcha1 { margin-top: 12px; }
	#forma input[type="submit"] { height: 44px; margin-top: 14px; font-size: 14px; }
	#forma .Error_mess,
	#forma .text-danger { font-size: 13px; }
}
/* Виджет капчи фиксированной ширины 304px — на узких телефонах уменьшаем его целиком */
@media (max-width: 375px) {
	#forma #recaptcha1 { height: 64px; }
	#forma #recaptcha1 > div { transform: scale(0.82); transform-origin: 0 0; }
}
