/**
 * Калькуляторы услуг — модальные окна (на базе lead-modal).
 */

.calc-modal.lead-modal {
	z-index: 10060;
}

.calc-modal.lead-modal {
	align-items: flex-end;
	padding: 0;
}

.calc-modal .lead-modal__dialog {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: min(520px, 100%);
	max-height: min(92dvh, 760px);
	overflow: hidden;
	padding: 0;
	margin: 0 auto;
}

.calc-modal__dialog {
	text-align: left;
}

.calc-modal__head {
	flex-shrink: 0;
	padding: 1.75rem 1.25rem 0.65rem;
	padding-right: 3.25rem;
}

.calc-modal .lead-modal__title {
	margin-bottom: 0;
	text-align: left;
	font-size: clamp(1.05rem, 2.5vw, 1.28rem);
}

.calc-modal__head .lead-modal__alert {
	margin-bottom: 0.65rem;
}

.calc-modal__head .lead-modal__alert:last-child {
	margin-bottom: 0;
}

.calc-modal__form {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
}

.calc-modal__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior-y: contain;
	-webkit-overflow-scrolling: touch;
	padding: 0.35rem 1.25rem 1rem;
}

.calc-modal__footer {
	flex-shrink: 0;
	padding: 0.75rem 1.25rem max(1rem, env(safe-area-inset-bottom, 0px));
	background: linear-gradient(180deg, rgba(248, 250, 251, 0) 0%, #f8fafb 18%, #fff 100%);
	border-top: 1px solid #e2e8e8;
	box-shadow: 0 -8px 24px rgba(10, 18, 20, 0.08);
}

.calc-modal__footer .lead-modal__submit {
	margin-top: 0;
}

.calc-modal__status {
	margin: 0 0 0.65rem;
	font-size: 0.92rem;
	font-weight: 700;
	line-height: 1.45;
}

.calc-modal__status:not([hidden]) {
	display: block;
	animation: calc-status-in 0.35s ease;
}

.calc-modal__status.lead-modal__alert--ok:not([hidden]) {
	padding-left: 2.15rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23006060'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: 0.75rem 0.72rem;
	background-size: 1.15rem;
}

.calc-modal__status.lead-modal__alert--err:not([hidden]) {
	padding-left: 2.15rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%239a1c1c'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: 0.75rem 0.72rem;
	background-size: 1.15rem;
}

.calc-modal__footer.has-result {
	box-shadow: 0 -10px 28px rgba(0, 121, 121, 0.14);
}

.calc-modal__footer.has-result--ok {
	border-top-color: rgba(0, 121, 121, 0.35);
}

.calc-modal__footer.has-result--err {
	border-top-color: rgba(255, 75, 75, 0.45);
}

.lead-modal__submit.is-success {
	color: #fff;
	background: linear-gradient(180deg, #0a9a6e 0%, #078a62 45%, #067a56 100%);
	box-shadow: 0 10px 24px rgba(7, 138, 98, 0.4);
	pointer-events: none;
}

.lead-modal__submit.is-success:hover,
.lead-modal__submit.is-success:focus-visible {
	transform: none;
	box-shadow: 0 10px 24px rgba(7, 138, 98, 0.4);
}

@keyframes calc-status-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (min-width: 640px) {
	.calc-modal.lead-modal {
		align-items: center;
		padding: 1.25rem;
	}

	.calc-modal .lead-modal__dialog {
		max-height: min(90vh, 760px);
		border-radius: 22px;
	}

	.calc-modal__head {
		padding: 2rem 1.75rem 0.75rem;
		padding-right: 3.5rem;
	}

	.calc-modal__body {
		padding: 0.25rem 1.75rem 1.25rem;
	}

	.calc-modal__footer {
		padding: 0.85rem 1.75rem 1.5rem;
	}
}

@media (max-width: 639px) {
	.calc-modal .lead-modal__dialog {
		max-height: 96dvh;
		border-radius: 18px 18px 0 0;
	}
}

.calc-req {
	color: #ff4b4b;
	font-weight: 800;
}

.calc-modal__row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0 0.75rem;
}

@media (min-width: 480px) {
	.calc-modal__row {
		grid-template-columns: 1fr 1fr;
	}

	.calc-modal__row .lead-modal__field {
		margin-bottom: 1rem;
	}
}

.calc-modal__check {
	margin-bottom: 0.85rem;
}

.calc-modal__check-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.92rem;
	font-weight: 600;
	color: #3d4449;
	cursor: pointer;
}

.calc-modal__check-label input {
	width: 1.1rem;
	height: 1.1rem;
	accent-color: #007979;
}

.calc-modal__fieldset {
	margin: 0 0 1rem;
	padding: 0;
	border: none;
	min-width: 0;
}

.calc-modal__fieldset .lead-modal__label {
	margin-bottom: 0.5rem;
}

.calc-modal__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.calc-modal__chip {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	min-width: 4.5rem;
	padding: 0.55rem 0.45rem;
	border: 2px solid #e2e8e8;
	border-radius: 12px;
	background: #fff;
	color: #3d4449;
	font: inherit;
	font-size: 0.68rem;
	font-weight: 700;
	line-height: 1.15;
	cursor: pointer;
	transition:
		border-color 0.15s ease,
		background 0.15s ease,
		box-shadow 0.15s ease;
}

.calc-modal__chip i {
	font-size: 1.15rem;
	color: #007979;
}

.calc-modal__chip:hover {
	border-color: rgba(0, 121, 121, 0.45);
}

.calc-modal__chip.is-selected {
	border-color: #007979;
	background: rgba(0, 121, 121, 0.08);
	box-shadow: 0 0 0 2px rgba(0, 121, 121, 0.12);
}

.calc-modal__chip.is-selected i {
	color: #006060;
}

.calc-modal__chip-label {
	max-width: 5.5rem;
	text-align: center;
}

.calc-modal__hint {
	margin: 0.35rem 0 0;
	font-size: 0.78rem;
	color: #5c6468;
	line-height: 1.4;
}

select.lead-modal__input {
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235c6468' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	padding-right: 2rem;
}

/* Кнопки калькулятора в подвале */
.site-footer__calc-strip {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 1.5rem;
	padding: 1.15rem 1.25rem;
	border-radius: 16px;
	border: 1px solid var(--color-footer-border, rgba(0, 121, 121, 0.14));
	background: linear-gradient(135deg, var(--color-footer-surface, #fff) 0%, var(--color-accent-soft, #e6f3f3) 100%);
	box-shadow: var(--shadow, 0 8px 30px rgba(61, 68, 73, 0.07));
}

.site-footer__calc-head {
	flex: 1 1 12rem;
	min-width: 0;
}

.site-footer__calc-title {
	margin: 0 0 0.25rem;
	font-size: 0.78rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--slider-teal, #007979);
}

.site-footer__calc-desc {
	margin: 0;
	font-size: 0.84rem;
	line-height: 1.45;
	color: var(--color-muted, #5c6468);
	max-width: 36ch;
}

.site-footer__calc-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: flex-end;
}

.site-footer__calc-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.55rem 1rem;
	border: 1px solid rgba(0, 121, 121, 0.28);
	border-radius: 999px;
	background: var(--color-footer-surface, #fff);
	color: var(--slider-teal, #007979);
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(var(--rgb-brand, 61, 68, 73), 0.06);
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		color 0.15s ease,
		transform 0.15s ease,
		box-shadow 0.15s ease;
}

.site-footer__calc-btn:hover {
	background: var(--slider-teal, #007979);
	border-color: var(--slider-teal, #007979);
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(0, 121, 121, 0.22);
}

.site-footer__calc-btn i {
	opacity: 0.95;
	font-size: 0.88rem;
}

@media (max-width: 720px) {
	.site-footer__calc-strip {
		flex-direction: column;
		align-items: stretch;
	}

	.site-footer__calc-row {
		justify-content: stretch;
	}

	.site-footer__calc-btn {
		flex: 1 1 auto;
		justify-content: center;
	}
}
