/* Модальное окно */
.page-template {
	.modal {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		z-index: 1000;
		display: none;
		opacity: 0;
		visibility: hidden;
		transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	}

	.modal.active {
		display: flex;
		opacity: 1;
		visibility: visible;
	}

	.modal.closing {
		opacity: 0;
		visibility: hidden;
	}

	.modal .modal__overlay {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, 0.6);
		backdrop-filter: blur(8px);
		transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
		z-index: 1;
	}

	.modal .modal__container {
		position: relative;
		width: 100%;
		height: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 20px;
		z-index: 2;
	}

	.modal .modal__content {
		background: var(--white);
		border-radius: 32px;
		padding: 32px;
		max-width: 524px;
		width: 100%;
		max-height: 90vh;
		max-height: 90dvh;
		overflow: hidden;
		position: relative;
		box-shadow:
			0 20px 60px rgba(0, 0, 0, 0.15),
			0 8px 24px rgba(0, 0, 0, 0.1);
		transform: scale(0.9) translateY(20px);
		transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
		display: flex;
		flex-direction: column;
		z-index: 3;
	}

	.modal.active .modal__content {
		transform: scale(1) translateY(0);
	}

	.modal.closing .modal__content {
		transform: scale(0.9) translateY(20px);
	}

	.modal .modal__close {
		position: absolute;
		padding: 0;
		top: 22px;
		right: 20px;
		width: 40px;
		height: 40px;
		border: none;
		background: transparent;
		border-radius: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
		cursor: pointer;
		transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
		color: var(--color-text-secondary);
		animation: fadeInDown 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s both;
		z-index: 2;
	}

	.modal .modal__close:hover {
		background: rgba(0, 0, 0, 0.05);
		color: var(--color-text-dark);
		transform: scale(1.1);
	}

	.modal .modal__header {
		text-align: center;
		margin-bottom: 32px;
		flex-shrink: 0;
		animation: fadeInDown 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s both;
	}

	.modal .modal__title {
		font-family: var(--font-primary);
		font-weight: 700;
		font-size: 20px;
		line-height: 140%;
		color: #272726;
		margin: 0 auto 0 0;
		text-align: left;
		padding-right: 2em;
	}

	.modal .modal__subtitle {
		font-family: var(--font-primary);
		font-weight: 400;
		font-size: 16px;
		line-height: 140%;
		color: var(--color-text-secondary);
		margin: 0;
	}

	/* Форма */
	.modal .modal__form {
		display: flex;
		flex-direction: column;
		gap: 24px;
		flex: 1;
		overflow: visible;
		padding: 0;
		margin: 0;
		animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
	}

	.form__group {
		display: flex;
		flex-direction: column;
		gap: 8px;
		animation: fadeInUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
	}

	.form__group:nth-child(1) {
		animation-delay: 0.3s;
	}

	.form__group:nth-child(2) {
		animation-delay: 0.4s;
	}

	.form__group:nth-child(3) {
		animation-delay: 0.5s;
	}

	.form__group:nth-child(4) {
		animation-delay: 0.6s;
	}

	.form__label {
		font-family: var(--font-primary);
		font-weight: 500;
		font-size: 14px;
		line-height: 120%;
		color: var(--color-text-dark);
	}

	.form__input {
		width: 100%;
		height: 48px;
		padding: 0 16px;
		border: 1px solid rgba(42, 58, 95, 0.2);
		border-radius: 8px;
		background: var(--white);
		font-family: var(--font-primary);
		font-weight: 400;
		font-size: 14px;
		line-height: 140%;
		color: #2a3a5f;
		transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
		box-sizing: border-box;
	}

	.form__input:focus {
		outline: none;
		border-color: var(--color-primary-blue);
		box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
		transform: translateY(-1px);
	}

	.form__input::placeholder {
		color: var(--color-text-secondary);
	}

	/* Стили для валидации */
	.form__input.error {
		border-color: #ef4444;
		box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
		background-color: #fef2f2;
	}

	.form__input.success {
		border-color: #10b981;
		box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
		background-color: #f0fdf4;
	}

	.form__checkbox-label.error {
		color: #ef4444;
	}

	.form__checkbox-label.error .form__checkbox {
		border-color: #ef4444;
		box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
	}

	/* Анимация тряски для ошибок */
	@keyframes shake {
		0%, 100% { transform: translateX(0); }
		10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
		20%, 40%, 60%, 80% { transform: translateX(5px); }
	}

	.form__checkbox-label {
		display: flex;
		align-items: flex-start;
		gap: 12px;
		cursor: pointer;
		transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	}

	.form__checkbox-label:hover {
		transform: translateX(4px);
	}

	.form__checkbox {
		width: 20px;
		height: 20px;
		margin: 0;
		flex-shrink: 0;
		margin-top: 2px;
		accent-color: var(--color-primary-blue);
		cursor: pointer;
		transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	}

	.form__checkbox:hover {
		transform: scale(1.1);
	}

	.form__checkbox-text {
		font-family: var(--font-primary);
		font-weight: 400;
		font-size: 16px;
		line-height: 140%;
		color: #272726;
	}

	.form__agreement-text {
		margin-top: 12px;
	}

	.form__agreement-text,
	.form__link {
		font-family: var(--font-primary);
		font-size: 16px;
		line-height: 140%;
		letter-spacing: 0px;
		color: #939393;
	}

	.form__link {
		text-decoration: underline;
		text-underline-offset: 3px;
	}

	.form__submit {
		width: 100%;
		height: 48px;
		background: #a6abb6;
		border: none;
		border-radius: 100px;
		color: var(--white);
		font-family: var(--font-primary);
		font-weight: 500;
		font-size: 20px;
		line-height: 120%;
		cursor: pointer;
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
		position: relative;
		overflow: hidden;
		flex-shrink: 0;
		margin-top: auto;
		animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.7s both;
		text-transform: none;
	}

	.form__success {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 16px;
		padding: 82px 70px 98px;
	}

	.form__success svg {
		animation: successBounce 0.6s ease-out;
	}

	.form__success-text {
		font-family: var(--font-primary);
		font-weight: 700;
		font-size: 20px;
		line-height: 140%;
		letter-spacing: 0px;
		color: #272726;
	}

	.modal__form:has(input[type="email"]:valid):has(input[type="checkbox"]:checked) .form__submit {
		background: #EB4A45;
	}

	.form__submit:hover {
		background: #939393;
		transform: translateY(-1px);
	}


	.form__submit:active {
		transform: translateY(0);
	}

	.form__submit-text {
		position: relative;
		z-index: 2;
	}

	.form__submit-icon {
		position: relative;
		z-index: 2;
		transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	}

	.form__submit:hover .form__submit-icon {
		transform: translateX(6px) scale(1.1);
	}

	.form__submit:disabled {
		opacity: 0.6;
		cursor: not-allowed;
	}

	.form__submit.loading {
		opacity: 0.8;
	}

	.form__submit.loading .form__submit-text {
		opacity: 0.7;
	}

	/* Адаптивность */
	@media (max-width: 768px) {
		.modal__content {
			padding: 24px;
			margin: 20px;
			max-width: none;
		}

		.modal__title {
			font-size: 24px;
		}

		.modal__subtitle {
			font-size: 14px;
		}
	}

	@media (max-width: 450px) {
		.modal .modal__content {
			border-radius: 16px;
			padding: 16px 16px 32px;
			margin: 0px;
			max-width: none;
		}
		.modal .modal__title {
			font-size: 18px;
			line-height: 140%;
		}
		.form__agreement-text,
		.form__link {
			font-size: 14px;
		}
		.modal .modal__close {
			top: 10px;
			right: 4px;
		}
		.form__submit {
			font-size: 20px;
			line-height: 120%;
		}
		.form__checkbox-text {
			font-size: 14px;
		}
	}
}

/* Стили для модального окна успешной подписки CTA */
.cta-success-modal {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 60px 40px;
	gap: 24px;
}

.cta-success-modal__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	animation: successBounce 0.6s ease-out;
}

.cta-success-modal__title {
	font-family: var(--font-primary);
	font-weight: 700;
	font-size: 32px;
	line-height: 120%;
	color: var(--color-text-primary);
	margin: 0;
	animation: fadeInUp 0.6s ease-out 0.2s both;
}

.cta-success-modal__description {
	font-family: var(--font-primary);
	font-weight: 400;
	font-size: 18px;
	line-height: 140%;
	color: var(--color-text-secondary);
	margin: 0;
	opacity: 0.8;
	animation: fadeInUp 0.6s ease-out 0.4s both;
}

/* Анимация для иконки успеха */
@keyframes successBounce {
	0% {
		transform: scale(0);
		opacity: 0;
	}
	50% {
		transform: scale(1.1);
		opacity: 1;
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

/* Адаптивность для модального окна успешной подписки */
@media (max-width: 768px) {
	.cta-success-modal {
		padding: 40px 20px;
		gap: 20px;
	}

	.cta-success-modal__icon svg {
		width: 64px;
		height: 64px;
	}

	.cta-success-modal__title {
		font-size: 24px;
	}

	.cta-success-modal__description {
		font-size: 16px;
	}
}

@media (max-width: 480px) {
	.cta-success-modal {
		padding: 30px 16px;
		gap: 16px;
	}

	.cta-success-modal__icon svg {
		width: 56px;
		height: 56px;
	}

	.cta-success-modal__title {
		font-size: 20px;
	}

	.cta-success-modal__description {
		font-size: 14px;
	}
}

/* Стили для оверлея успешного состояния в модальном окне */
.modal-success-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 1);
	border-radius: 16px;
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 10;
	animation: modalSuccessFadeIn 0.3s ease-out;
}

.modal-success-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 20px;
	text-align: center;
}

.modal-success-icon {
	animation: modalSuccessIconBounce 0.6s ease-out;
}

.modal-success-text {
	font-family: var(--font-primary);
	font-weight: 700;
	font-size: 24px;
	color: var(--color-text-primary);
	animation: modalSuccessTextFadeIn 0.6s ease-out 0.2s both;
}

.modal-success-fade-out {
	animation: modalSuccessFadeOut 0.3s ease-out;
}

/* Анимации для успешного состояния модального окна */
@keyframes modalSuccessFadeIn {
	from {
		opacity: 0;
		transform: scale(0.9);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes modalSuccessFadeOut {
	from {
		opacity: 1;
		transform: scale(1);
	}
	to {
		opacity: 0;
		transform: scale(0.9);
	}
}

@keyframes modalSuccessIconBounce {
	0% {
		transform: scale(0);
		opacity: 0;
	}
	50% {
		transform: scale(1.2);
		opacity: 1;
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

@keyframes modalSuccessTextFadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}