.modal {
	width: 600px;
	height: 400px;
	padding: 0;
	background-size: cover;
	display: none;
	background-color: unset;
}

#modal-success,
#modal-error {
	background-image: url(../img/modals/modal-success.webp);
}

.modal__inner {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 20px;
	color: #fff;
	height: 100%;
}

.modal__heading {
	font-size: 24px;
	font-weight: 800;
	line-height: 1.2;
}

.modal__list {
	list-style-type: disc;
	padding-left: 20px;
}

.modal__list-item {
	font-size: 16px;
	font-weight: 500;
	line-height: 1.3;
}

.modal__form {
	max-width: 410px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.modal__btn {
	margin-top: 10px;
}

.modal__logo {
	width: 220px;
}

.modal__logo img {
	width: 100%;
}

.popup {
	padding: 14px 14px 20px;
	height: auto;
	display: none;
	box-sizing: border-box;
}

#modalCredit {
	background-color: #fff;
	background-image: url(../img/modals/modal-credit_mob.webp);
	background-repeat: no-repeat;
	background-size: contain;
	background-position: top center;
}

#modalRequest {
	background-color: #fff;
	background-image: url(../img/modals/modal-req_mob.webp);
	background-repeat: no-repeat;
	background-size: contain;
	background-position: top center;
}

#modalTradeIn {
	background-color: #fff;
	background-image: url(../img/modals/modal-req_mob.webp);
	background-repeat: no-repeat;
	background-size: contain;
	background-position: top center;
}

.popup--form {
	width: 328px;
	height: auto;
}

.popup__cont {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	height: auto;
	min-height: 0;
	gap: 12px;
}

.popup__head {
	display: block;
	font-size: 24px;
	line-height: 1;
	font-weight: 500;
	color: #34343d;
}

.popup__head span {
	color: var(--primary);
}

.popup__list {
	list-style: disc;
	margin-top: 10px;
	padding-left: 15px;
	gap: 8px;
	display: flex;
	flex-direction: column;
}

.popup__list-item {
	font-size: 14px;
	line-height: 1;
	font-weight: 300;
	color: #34343d;
}

.popup__list-item::marker {
	color: var(--primary);
}

br.popup__list-item-br-mob {
	display: none;
}

@media (max-width: 768px) {
	br.popup__list-item-br-mob {
		display: block;
	}
}

.popup__form-cont {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.popup__form {
	width: 100%;
	position: relative;
}

.popup .input.popup__input {
	height: 40px;
	border: none;
	border-bottom: 1px solid #6c6f78;
	border-radius: 0;
	background: #fff;
	color: #34343d;
	padding-left: 12px;
	padding-right: 12px;
	font-size: 14px;
	font-weight: 400;
}

.popup .input.popup__input::placeholder {
	color: rgba(52, 52, 61, 0.5);
}

.popup__form-guard-banner {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	z-index: 2;
	box-sizing: border-box;
	transform: translateY(calc(-100% - 10px));
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	background: #ea0028;
	border-radius: 4px;
	color: #fff;
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	padding: 0 36px 0 14px;
	pointer-events: none;
	box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.251);
	transition:
		max-height 0.25s ease,
		opacity 0.25s ease,
		padding 0.25s ease,
		transform 0.25s ease;
}

.popup__form-guard-banner.is-visible {
	max-height: 200px;
	opacity: 1;
	padding: 16px 36px 16px 16px;
	pointer-events: auto;
}

.popup__form-guard-banner-text {
	font-size: 14px;
	font-weight: 300;
	line-height: 1.2;
	margin: 0;
	flex: 1;
	min-width: 0;
}

.popup__form-guard-banner-close {
	position: absolute;
	right: 10px;
	top: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
	border: none;
	background: transparent;
	color: inherit;
	cursor: pointer;
	line-height: 0;
	transition: opacity 0.2s ease;
}

.popup__form-guard-banner-close:hover {
	opacity: 0.85;
}

.popup__form-guard-banner-close svg {
	display: block;
}

.popup .agreement {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	margin: 0;
}

.popup .agreement__text,
.popup .agreement .form__checkbox-text {
	font-size: 10px;
	line-height: 1;
	font-weight: 400;
	color: rgba(0, 0, 0, 0.5);
}

.popup .agreement__text {
	margin-top: 10px;
	margin-bottom: 0;
}

.popup .agreement a,
.popup .agreement a:visited,
.popup .agreement a:hover,
.popup .agreement a:active {
	color: rgba(0, 0, 0, 0.5);
}

.popup .form__checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-top: 8px;
}

.popup .checkbox {
	position: relative;
	display: inline-block;
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}

.popup .form__checkbox-check[type='checkbox'] {
	position: absolute;
	left: 0;
	top: 0;
	width: 24px;
	height: 24px;
	margin: 0;
	opacity: 0;
	z-index: 2;
	cursor: pointer;
}

.popup .form__checkbox-check[type='checkbox'] + .form-checkbox__custom {
	display: block;
	width: 24px;
	height: 24px;
	background-color: #e8e8e8;
	border-radius: 2px;
}

.popup .form__checkbox-check[type='checkbox']:checked + .form-checkbox__custom {
	background-image: url(../img/check.svg);
	background-repeat: no-repeat;
	background-size: 11px;
	background-position: center;
}

.popup .form__checkbox-check[type='checkbox']:checked + .form-checkbox__custom {
	background-image: url(../img/check-popup.svg);
	background-size: 13px 10px;
}

.popup
	.form__checkbox-label:hover
	.form__checkbox-check[type='checkbox']:checked
	+ .form-checkbox__custom {
	/* background-image: url(../img/check-popup-hover.svg); */
}

.popup .form__checkbox-label:hover .form-checkbox__custom {
	background-color: var(--primary-opacity-015);
}

.popup .input.popup__input.popup__input--error {
	border: none;
	border-bottom: 1px solid rgba(255, 0, 4, 1);
	color: rgba(255, 0, 4, 1);
}

.popup .input.popup__input.popup__input--error::placeholder {
	color: rgba(255, 0, 4, 1);
	opacity: 1;
}

.popup
	.form__checkbox-label.form__checkbox-label--error
	.form-checkbox__custom {
	border-color: transparent;
	background-color: rgba(255, 0, 4, 1);
}

.popup
	.form__checkbox-label.form__checkbox-label--error:hover
	.form-checkbox__custom {
	background-color: rgba(255, 0, 4, 1);
}

.popup__button {
	height: 42px;
	margin-top: 10px;
	font-size: 14px;
}

/* 1. Исходное состояние (НЕ заполнено) — БЕЛАЯ с зелёной рамкой и зелёным текстом */
.popup__form .popup__button._border._inversion {
    background-color: #ffffff !important;
    color: var(--primary) !important;
    border: 1px solid var(--primary) !important;
    transition: all 0.3s ease !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

/* 2. Активное состояние (ЗАПОЛНЕНО: имя, телефон, обе галочки) — ЗЕЛЁНАЯ с белым текстом */
.popup__form .popup__button._border._inversion.popup__button--active {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    border: 1px solid var(--primary) !important;
    cursor: pointer !important;
    opacity: 1 !important;
}

/* 3. Эффект при наведении на активную кнопку */
.popup__form .popup__button._border._inversion.popup__button--active:hover {
    color: #ffffff !important;
    transform: scale(1.02);
    box-shadow: 0px 4px 15px 0px var(--primary-opacity-035);
}

.fancybox__slide:has(.popup.popup--form) {
	align-items: flex-start;
}

.fancybox__content:has(.popup.popup--form) {
	height: auto;
}

.popup.popup--form {
	flex: 0 0 auto;
}

.is-compact .fancybox__content > .f-button.is-close-btn {
	top: 0;
	right: -50px;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 50%;
	background: white;
}

.f-button svg {
	width: 10px;
	height: 10px;
	opacity: 1;
	stroke: black;
	fill: black;
	stroke-width: 4px;
}

@media (max-width: 768px) {
	.popup--form {
		padding: 18px;
		padding-top: 169px;
	}

	.popup--form .popup__input {
		text-align: center;
		padding-left: 16px;
		padding-right: 16px;
	}
}

@media screen and (max-width: 620px) {
	.modal {
		width: 100%;
		max-width: 360px;
		height: 320px;
	}

	#modal-success,
	#modal-error {
		background-image: url(../img/modals/modal-success-mob.webp);
	}

	.modal__inner {
		padding: 14px;
	}

	.modal__heading {
		font-size: 20px;
	}

	.modal__list-item {
		font-size: 12px;
	}

	.modal__form .input {
		height: 32px;
		font-size: 12px;
	}

	.modal__logo {
		width: 134px;
	}
}

@media (min-width: 1025px) {
	.popup {
		width: 887px;
		height: auto;
		padding: 40px;
	}

	#modalCredit {
		background-color: #fff;
		background-image: url(../img/modals/modal-credit_desk.webp);
		background-repeat: no-repeat;
		background-size: cover;
		background-position: center;
	}

	.popup__cont {
		width: 407px;
		margin-left: auto;
	}

	#modalRequest {
		background-color: #fff;
		background-image: url(../img/modals/modal-req_desk.webp);
		background-repeat: no-repeat;
		background-size: cover;
		background-position: center;
	}

	#modalTradeIn {
		background-color: #fff;
		background-image: url(../img/modals/modal-trade_desk.webp);
		background-repeat: no-repeat;
		background-size: cover;
		background-position: center;
	}

	.popup__head {
		font-size: 32px;
		line-height: 34px;
	}

	.popup__list {
		margin-top: 16px;
	}

	.popup__list-item {
		font-size: 16px;
		line-height: 1;
	}

	.popup__form {
		width: 407px;
	}

	.popup__form-cont {
		flex-direction: row;
		gap: 10px;
	}

	.popup .input.popup__input {
		height: 48px;
		padding-left: 24px;
		padding-right: 24px;
	}

	.popup__button {
		height: 48px;
		font-size: 16px;
		margin-top: 10px;
	}

	.popup .form__checkbox-text {
		font-size: 16px;
		line-height: 1.2;
	}

	.popup .agreement__text,
	.popup .agreement .form__checkbox-text {
		font-size: 12px;
	}

	.popup__form-guard-banner-text {
		font-size: 16px;
	}

	.fancybox__content > .f-button.is-close-btn {
		top: 0;
		right: -50px;
		width: 32px;
		height: 32px;
		border: none;
		border-radius: 50%;
		background: white;
	}
}

@media (max-width: 1024px) {
	.fancybox__content > .f-button.is-close-btn,
	.is-compact .fancybox__content > .f-button.is-close-btn {
		top: unset;
		bottom: -45px;
		right: 50%;
		transform: translateX(50%);
		width: 32px;
		height: 32px;
		border: none;
		border-radius: 50%;
		background: white;
	}
}
