/*
 * Блок «Запишитесь на консультацию» [milfey_consult].
 * Цвета и шрифт берутся из темы Impreza, как у страниц аппаратов;
 * в скобках значения на случай, если переменной темы нет.
 */

.mlc {
	--mlc-font: var(--font-family, var(--mlb-font, inherit));
	--mlc-heading: var(--color-content-heading, #313131);
	--mlc-text: var(--color-content-text, #313131);
	--mlc-muted: var(--color-content-faded, #8a8a94);
	--mlc-dark: var(--color-content-secondary, #60656b);
	--mlc-accent: var(--color-content-primary, #eae1d8);
	--mlc-bg: var(--color-content-bg, #fff);
	--mlc-field: #fff;
	--mlc-panel: color-mix(in srgb, var(--mlc-accent) 24%, var(--mlc-bg));
	--mlc-radius: 48px;
	--mlc-gutter: max(24px, 4vw);
	--mlc-pad: clamp(36px, 5vw, 80px);

	padding: 0 var(--mlc-gutter);
	font-family: var(--mlc-font);
	color: var(--mlc-text);
	font-weight: 300;
	-webkit-font-smoothing: antialiased;
	scroll-margin-top: calc(var(--mld-hh, 80px) + 20px);
}

.mlc *,
.mlc *::before,
.mlc *::after { box-sizing: border-box; }

.mlc .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.mlc__box {
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: 620px;
	border-radius: var(--mlc-radius);
	overflow: hidden;
	background: var(--mlc-panel);
	isolation: isolate;
}

.mlc--single .mlc__box { grid-template-columns: 1fr; min-height: 0; }
.mlc--single .mlc__panel { max-width: 860px; margin: 0 auto; }

/* ---------- Форма ---------- */

.mlc__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: var(--mlc-pad);
	min-width: 0;
	isolation: isolate;
}

.mlc__panel > :not(.mlc__fx) { position: relative; z-index: 1; }

/* Интерактивный фон плашки: поле точек, которое расходится от курсора
   и волной возвращается на место. Рисуется в cart.js. */
.mlc__fx {
	position: absolute !important;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	opacity: 0;
	transition: opacity 1s ease;
}

.mlc__fx.is-on { opacity: 1; }

.mlc__kicker {
	display: block;
	margin-bottom: 14px;
	font-size: 14px;
	line-height: 1.3;
	color: var(--mlc-dark);
	opacity: .6;
}

.mlc .mlc__title {
	margin: 0;
	padding: 0;
	max-width: 560px;
	font-family: var(--mlc-font);
	font-size: clamp(26px, 2.3vw, 34px);
	line-height: 1.22;
	font-weight: 300;
	letter-spacing: .5px;
	text-transform: none;
	color: var(--mlc-heading);
}

.mlc .mlc__text {
	margin: 18px 0 0;
	max-width: 520px;
	font-size: 15px;
	line-height: 1.6;
}

.mlc__form { margin-top: 30px; max-width: 460px; }
.mlc__form[hidden] { display: none; }

.mlc__field { position: relative; display: block; margin: 0 0 10px; }

.mlc .mlc__field input {
	display: block;
	width: 100%;
	height: 54px;
	margin: 0;
	padding: 0 26px;
	border: 1px solid transparent;
	border-radius: 40px;
	background: var(--mlc-field);
	color: var(--mlc-heading);
	font-family: var(--mlc-font);
	font-size: 16px;
	font-weight: 300;
	letter-spacing: .3px;
	box-shadow: none;
	transition: border-color .25s ease, box-shadow .25s ease;
}

/* цифры номера одной ширины: видно, сколько набрано */
.mlc .mlc__field input[type="tel"] { font-variant-numeric: tabular-nums; letter-spacing: .8px; }

.mlc .mlc__field input::placeholder { color: var(--mlc-muted); opacity: 1; }

.mlc .mlb-phone { --mlb-cc-pad: 26px; --mlb-cc-w: 92px; --mlb-text: var(--mlc-heading); font-size: 16px; }
.mlc .mlb-phone.is-wide { --mlb-cc-w: 112px; }
.mlc .mlb-phone__cc { font-size: 16px; font-weight: 300; }

.mlc .mlc__field input:focus {
	outline: 0;
	border-color: var(--mlc-dark);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--mlc-accent) 55%, transparent);
}

.mlc__field.is-invalid input,

@keyframes mlc-shake {
	20%, 60% { transform: translateX(-4px); }
	40%, 80% { transform: translateX(4px); }
}

/* Способ связи */
.mlc__choice { margin: 22px 0 16px; padding: 0; border: 0; min-width: 0; }

.mlc__choice legend {
	margin: 0 0 12px;
	padding: 0;
	font-size: 16px;
	line-height: 1.3;
	font-weight: 400;
	color: var(--mlc-heading);
}

.mlc__choice label,
.mlc__check {
	position: relative;
	display: block;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.mlc__choice label {
	margin: 0 0 9px;
	padding: 2px 0 2px 34px;
	font-size: 15px;
	line-height: 1.3;
	color: var(--mlc-heading);
}

/* Сами поля спрятаны: тема (Impreza) красит input по-своему при фокусе и отметке,
   поэтому кружок и квадрат рисуем на подписи, а input только хранит состояние. */
.mlc .mlc__choice input,
.mlc .mlc__check input {
	position: absolute !important;
	left: 0;
	top: 0;
	width: 22px !important;
	height: 22px !important;
	margin: 0 !important;
	padding: 0 !important;
	opacity: 0 !important;
	pointer-events: none;
}

.mlc__choice label > span::before,
.mlc__check > span::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	width: 22px;
	height: 22px;
	margin-top: -11px;
	box-sizing: border-box;
	border: 1.5px solid color-mix(in srgb, var(--mlc-dark) 45%, transparent);
	border-radius: 50%;
	background: var(--mlc-field);
	transition: border-color .2s ease, box-shadow .25s ease, background-color .2s ease;
}

.mlc__choice input:checked + span::before {
	border-color: var(--mlc-dark);
	box-shadow: inset 0 0 0 5px var(--mlc-field), inset 0 0 0 11px var(--mlc-dark);
}

.mlc__choice label:hover > span::before,
.mlc__check:hover > span::before { border-color: var(--mlc-dark); }

.mlc__choice input:focus-visible + span::before,
.mlc__check input:focus-visible + span::before { outline: 2px solid var(--mlc-dark); outline-offset: 3px; }

/* Согласия */
.mlc__check {
	margin: 0 0 9px;
	padding: 1px 0 0 32px;
	min-height: 20px;
	font-size: 12px;
	line-height: 1.45;
	color: var(--mlc-text);
}

.mlc__check > span::before {
	top: 0;
	width: 20px;
	height: 20px;
	margin-top: 0;
	border-radius: 7px;
}

.mlc__check input:checked + span::before { background: var(--mlc-dark); border-color: var(--mlc-dark); }

.mlc__check > span::after {
	content: "";
	position: absolute;
	left: 7px;
	top: 3px;
	width: 6px;
	height: 11px;
	box-sizing: border-box;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg) scale(.4);
	opacity: 0;
	transition: opacity .15s ease, transform .2s ease;
}

.mlc__check input:checked + span::after { opacity: 1; transform: rotate(45deg) scale(1); }

.mlc__check.is-invalid > span::before { animation: mlc-shake .4s ease; border-color: #d23f3f; }
.mlc__check a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; }
.mlc__check a:hover { text-decoration-color: currentColor; }

.mlc .mlc__submit {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 240px;
	height: 52px;
	margin-top: 16px;
	padding: 0 40px;
	border: 0;
	border-radius: 40px;
	background: var(--mlc-dark);
	color: #fff;
	font-family: var(--mlc-font);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	overflow: hidden;
	transition: background-color .25s ease, transform .2s ease;
}

.mlc .mlc__submit:hover { background: var(--mlc-heading); }
.mlc .mlc__submit:active { transform: scale(.98); }
.mlc .mlc__submit:disabled { cursor: wait; }

.mlc__submit.is-loading span { opacity: 0; }
.mlc__submit.is-loading::after {
	content: "";
	position: absolute;
	width: 22px;
	height: 22px;
	border: 2px solid rgba(255, 255, 255, .35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: mlc-spin .8s linear infinite;
}

@keyframes mlc-spin { to { transform: rotate(360deg); } }

.mlc .mlc__message { margin: 14px 0 0; min-height: 1.4em; font-size: 14px; line-height: 1.4; }
.mlc__message.is-error { color: #c0392b; }

/* Успех */
.mlc__done {
	margin-top: 30px;
	max-width: 460px;
	padding: 32px;
	border-radius: 32px;
	background: var(--mlc-field);
	opacity: 0;
	transform: translateY(14px);
	transition: opacity .6s ease, transform .6s cubic-bezier(.16, 1, .3, 1);
}

.mlc__done.is-in { opacity: 1; transform: none; }
.mlc__done[hidden] { display: none; }

.mlc__done-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin-bottom: 20px;
	border-radius: 50%;
	background: var(--mlc-dark);
}

.mlc__done-icon::after {
	content: "";
	width: 10px;
	height: 20px;
	margin-top: -4px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.mlc .mlc__done-title { margin: 0; font-size: 24px; line-height: 1.3; font-weight: 400; color: var(--mlc-heading); }
.mlc .mlc__done-text { margin: 10px 0 0; font-size: 16px; line-height: 1.5; }

/* ---------- Галерея ---------- */

.mlc__gallery {
	position: relative;
	min-height: 100%;
	overflow: hidden;
	background: color-mix(in srgb, var(--mlc-accent) 40%, var(--mlc-bg));
	touch-action: pan-y;
}

.mlc__slide {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	transition: opacity 1.1s ease;
}

.mlc__slide.is-active { opacity: 1; z-index: 1; }

.mlc .mlc__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transform: scale(1.08);
	transition: transform 7s ease-out;
}

/* медленное приближение активного фото */
.mlc__slide.is-active .mlc__img { transform: scale(1); }

.mlc .mlc__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 54px;
	height: 54px;
	margin-top: -27px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	transition: background-color .25s ease, transform .25s ease;
}

.mlc .mlc__arrow::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 14px;
	height: 14px;
	border: solid #fff;
	border-width: 0 0 1.5px 1.5px;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35));
}

.mlc .mlc__arrow--prev { left: 18px; }
.mlc .mlc__arrow--next { right: 18px; }
.mlc .mlc__arrow--prev::before { transform: translate(-30%, -50%) rotate(45deg); }
.mlc .mlc__arrow--next::before { transform: translate(-70%, -50%) rotate(-135deg); }

.mlc .mlc__arrow:hover { background: rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.mlc .mlc__arrow:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.mlc__dots {
	position: absolute;
	left: 50%;
	bottom: 26px;
	z-index: 2;
	display: flex;
	gap: 8px;
	transform: translateX(-50%);
}

.mlc .mlc__dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: rgba(255, 255, 255, .55);
	cursor: pointer;
	transition: width .4s cubic-bezier(.16, 1, .3, 1), background-color .3s ease;
}

.mlc .mlc__dot.is-active { width: 28px; background: #fff; }

@media (prefers-reduced-motion: reduce) {
	.mlc__slide,
	.mlc .mlc__img,
	.mlc__done { transition: none; }
	.mlc .mlc__img { transform: none; }
}

/* ---------- Планшет ---------- */

@media (max-width: 1199px) {
	.mlc { --mlc-radius: 40px; --mlc-gutter: max(30px, 4vw); }
	.mlc__box { grid-template-columns: 1fr; min-height: 0; }
	.mlc__gallery { order: -1; min-height: 0; aspect-ratio: 16 / 10; }
	.mlc__form,
	.mlc__done { max-width: 560px; }
}

/* ---------- Телефон ---------- */

@media (max-width: 639px) {
	.mlc { --mlc-radius: 28px; --mlc-gutter: max(18px, 5vw); --mlc-pad: 28px 22px 34px; }
	.mlc__gallery { aspect-ratio: 4 / 3; }
	.mlc__kicker { font-size: 13px; margin-bottom: 12px; }
	.mlc .mlc__title { font-size: 23px; }
	.mlc .mlc__text { margin-top: 12px; font-size: 14px; }
	.mlc__form { margin-top: 22px; }
	.mlc .mlc__field input { height: 52px; padding: 0 22px; font-size: 16px; }
	.mlc__choice { margin: 18px 0 14px; }
	.mlc__choice legend { font-size: 15px; margin-bottom: 10px; }
	.mlc__choice label { font-size: 14px; gap: 10px; }
	.mlc__check { font-size: 11.5px; gap: 10px; }
	.mlc .mlc__submit { width: 100%; min-width: 0; height: 52px; }
	.mlc .mlc__arrow { width: 44px; height: 44px; margin-top: -22px; }
	.mlc .mlc__arrow--prev { left: 6px; }
	.mlc .mlc__arrow--next { right: 6px; }
	.mlc__dots { bottom: 14px; }
	.mlc__done { padding: 28px; }
}
@media (max-width: 639px) { .mlc .mlb-phone { --mlb-cc-pad: 22px; --mlb-cc-w: 86px; } .mlc .mlb-phone.is-wide { --mlb-cc-w: 104px; } }
