/* ============================
   MODALS (NCent: lead + thanks)
   Подключается отдельным файлом — основной style.css из вёрстки не трогаем.
============================ */

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

body.is-modal-open {
	overflow: hidden;
}

.modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	animation: ncent-modal-fade 200ms ease both;
}

@keyframes ncent-modal-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 30, 25, 0.55);
	backdrop-filter: blur(2px);
	cursor: pointer;
}

.modal__dialog {
	position: relative;
	z-index: 1;
	background: #fff;
	border-radius: 20px;
	padding: 40px 32px 32px;
	max-width: 480px;
	width: 100%;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	box-shadow: 0 30px 60px rgba(20, 30, 25, 0.25);
	animation: ncent-modal-pop 220ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes ncent-modal-pop {
	from { transform: translateY(20px) scale(0.96); opacity: 0; }
	to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	background: transparent;
	border: none;
	border-radius: 50%;
	color: #4B684C;
	cursor: pointer;
	transition: background 150ms ease, color 150ms ease;
}

.modal__close:hover,
.modal__close:focus-visible {
	background: rgba(75, 104, 76, 0.1);
	color: #2d3f2e;
	outline: none;
}

/* ============================
   FORM inside modal
============================ */

.form--lead {
	display: block;
	margin: 0;
}

.form__title {
	margin: 0 0 8px;
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.25;
	color: #1f2a20;
}

.form__subtitle {
	margin: 0 0 24px;
	font-size: 15px;
	line-height: 1.45;
	color: #5b6d5c;
}

.form__field {
	display: block;
	margin-bottom: 14px;
}

.form__field[hidden] {
	display: none;
}

.form__label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 500;
	color: #3a4a3b;
}

.form__field input,
.form__field select,
.form__field textarea {
	display: block;
	width: 100%;
	padding: 12px 14px;
	font: inherit;
	font-size: 15px;
	line-height: 1.3;
	color: #1f2a20;
	background: #f6f8f6;
	border: 1px solid transparent;
	border-radius: 12px;
	box-shadow: none;
	transition: border-color 150ms ease, background 150ms ease;
}

.form__field input::placeholder,
.form__field textarea::placeholder {
	color: #8a9c8b;
}

.form__field input:focus,
.form__field select:focus,
.form__field textarea:focus {
	background: #fff;
	border-color: #7A9B7C;
	outline: none;
}

.form__field textarea {
	min-height: 90px;
	resize: vertical;
}

.form__honeypot {
	position: absolute;
	left: -9999px;
	top: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.form__consent {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin: 14px 0 20px;
	font-size: 13px;
	line-height: 1.45;
	color: #5b6d5c;
	cursor: pointer;
}

.form__consent input[type="checkbox"] {
	flex-shrink: 0;
	margin-top: 3px;
	width: 16px;
	height: 16px;
	accent-color: #7A9B7C;
}

.form__consent a {
	color: #4B684C;
	text-decoration: underline;
}

.form__consent a:hover {
	color: #2d3f2e;
}

.form__submit {
	display: inline-flex;
	width: 100%;
	justify-content: center;
}

.form__submit[disabled] {
	opacity: 0.6;
	cursor: progress;
}

.form__result {
	display: block;
	margin-top: 14px;
	padding: 10px 14px;
	font-size: 14px;
	border-radius: 10px;
}

.form__result[data-state="error"] {
	background: #fdecec;
	color: #b3261e;
}

.form__result[data-state="ok"] {
	background: #e7f3e8;
	color: #265d2c;
}

/* ============================
   Thanks modal
============================ */

.modal-thanks .form__title {
	text-align: center;
}

.modal-thanks .form__subtitle {
	text-align: center;
	margin-bottom: 24px;
}

.modal-thanks .btn {
	display: block;
	width: 100%;
	margin-top: 8px;
}

/* ============================
   Responsive
============================ */

@media (max-width: 520px) {
	.modal {
		padding: 0;
		align-items: flex-end;
	}
	.modal__dialog {
		max-width: 100%;
		max-height: 100vh;
		border-radius: 16px 16px 0 0;
		padding: 32px 20px 24px;
	}
	.form__title {
		font-size: 22px;
		padding-right: 32px;
	}
}
