/**
 * Франшиза — заявка: поля форм (модалка и квиз), модалка #modal-franch, «Спасибо», плавающая кнопка .fr-float.
 * Подключается на страницах франшизы и во франшизных статьях блога, токены --fr-* — из page-franshiza.css.
 */

/* Поля и согласие — общие для модалки и квиза */
.fr-input {
	width: 100%;
	height: 56px;
	padding: 0 18px;
	border: 1px solid var(--fr-line);
	border-radius: 16px;
	background: #fff;
	color: var(--fr-text);
	font: 16px var(--fr-font);
	transition: border-color 0.2s, box-shadow 0.2s;
}

.fr-input::placeholder {
	color: #9aa3a1;
}

.fr-input:focus {
	border-color: var(--fr-green);
	box-shadow: 0 0 0 3px var(--fr-green-soft);
	outline: none;
}

.fr-input.input--error {
	border-color: #d64545;
}

.fr-form label.error {
	display: block;
	margin-top: 6px;
	color: #d64545;
	font-size: 13px;
	line-height: 1.3;
}

.fr-form .form-response:not(:empty) {
	padding: 10px 14px;
	border-radius: 12px;
	background: #fdecec;
	color: #b42318;
	font-size: 14px;
	line-height: 1.4;
}

.fr-form .form-response:not(:empty)::before {
	display: none;
}

.fr-form .form-response:not(:empty).is-success {
	background: var(--fr-green-soft);
	color: var(--fr-green);
}

.fr-form .main-forms__policy > span {
	margin-top: 12px;
	color: var(--fr-muted);
	font-size: 12px;
	line-height: 1.45;
	letter-spacing: 0;
}

.fr-form .main-forms__policy > span > span {
	align-self: auto;
	text-wrap: pretty;
}

.fr-form .main-forms__policy p,
.fr-form .main-forms__policy a {
	font-size: inherit;
	line-height: inherit;
}

.fr-form .main-forms__policy > span::before {
	width: 18px;
	height: 18px;
	min-width: 18px;
	margin-right: 10px;
	border: 1.5px solid #b9c4c2;
	border-radius: 5px;
	background: #fff;
	-webkit-mask-image: none;
	mask-image: none;
}

.fr-form .main-forms__policy input:checked + span::before {
	border-color: var(--fr-green);
	background: var(--fr-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
	-webkit-mask-image: none;
	mask-image: none;
}

/* Модалка заявки и «Спасибо» */
.fancybox__slide:has(> .fr-modal) {
	padding: 16px;
}

.fr-modal.fancybox__content {
	display: block;
	width: 480px;
	max-width: 100%;
	padding: 40px;
	border-radius: var(--fr-radius);
	background: #fff;
	color: var(--fr-text);
	font-family: var(--fr-font);
}

.fr-modal__close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--fr-panel);
	cursor: pointer;
	transition: background-color 0.2s;
}

.fr-modal__close::before,
.fr-modal__close::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 2px;
	border-radius: 1px;
	background: var(--fr-text);
	transform: translate(-50%, -50%) rotate(45deg);
}

.fr-modal__close::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.fr-modal__close:hover {
	background: var(--fr-line);
}

.fr-modal__title {
	margin: 0 48px 12px 0;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.2;
}

.fr-modal__lead {
	margin: 0 0 24px;
	color: var(--fr-muted);
	font-size: 15px;
	line-height: 1.5;
}

.fr-modal .fr-form {
	display: grid;
	gap: 16px;
}

.fr-field__label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
}

.fr-modal .btn {
	width: 100%;
	min-height: 56px;
	font-size: 18px;
	font-weight: 600;
}

.fr-modal .fr-form__submit {
	margin-top: 4px;
}

.fr-modal .fr-form .main-forms__policy > span {
	margin-top: 0;
}

.fr-modal__done {
	position: relative;
	display: block;
	width: 56px;
	height: 56px;
	margin-bottom: 20px;
	border-radius: 50%;
	background: var(--fr-green-soft);
}

.fr-modal__done::before {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 28px;
	height: 28px;
	background: var(--fr-green);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.fr-modal__actions {
	display: grid;
	gap: 10px;
}

/* Плавающая кнопка «Персональный бизнес-план» */
.fr-float {
	position: fixed;
	right: 24px;
	bottom: calc(24px + env(safe-area-inset-bottom));
	z-index: 1000;
	color: var(--fr-text);
	font-family: var(--fr-font);
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.fr-float.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition-delay: 0s;
}

.with-fancybox .fr-float {
	opacity: 0;
	visibility: hidden;
}

.fr-float__card {
	position: relative;
	width: 360px;
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 12px 32px rgba(17, 24, 28, 0.16);
}

.fr-float__link {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr);
	gap: 14px;
	padding: 18px;
	color: inherit;
	text-decoration: none;
}

.fr-float__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--fr-green-soft);
}

.fr-float__icon::before {
	content: "";
	width: 22px;
	height: 22px;
	background: var(--fr-green);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5M9 17v-3M12 17v-5M15 17v-2'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5M9 17v-3M12 17v-5M15 17v-2'/%3E%3C/svg%3E") center / contain no-repeat;
}

.fr-float__text {
	display: grid;
	gap: 4px;
	padding-right: 24px;
	color: var(--fr-muted);
	font-size: 13px;
	line-height: 1.4;
}

.fr-float__text b {
	color: var(--fr-text);
	font-size: 16px;
	line-height: 1.25;
}

.fr-float__btn {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	border-radius: 100px;
	background: var(--fr-green);
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	transition: background-color 0.2s;
}

.fr-float__link:hover .fr-float__btn {
	background: var(--primary-hover, #006465);
}

.fr-float__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	transition: background-color 0.2s;
}

.fr-float__close::before,
.fr-float__close::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 2px;
	border-radius: 1px;
	background: var(--fr-muted);
	transform: translate(-50%, -50%) rotate(45deg);
}

.fr-float__close::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.fr-float__close:hover {
	background: var(--fr-panel);
}

.fr-float__pill {
	display: none;
	align-items: center;
	gap: 10px;
	height: 52px;
	padding: 0 20px 0 8px;
	border-radius: 100px;
	background: var(--fr-green);
	box-shadow: 0 12px 32px rgba(17, 24, 28, 0.2);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.2s;
}

.fr-float__pill:hover {
	background: var(--primary-hover, #006465);
	color: #fff;
}

.fr-float__pill .fr-float__icon {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #fff;
}

.fr-float__pill .fr-float__icon::before {
	width: 18px;
	height: 18px;
}

.fr-float.is-collapsed .fr-float__card {
	display: none;
}

.fr-float.is-collapsed .fr-float__pill {
	display: inline-flex;
}

@media (max-width: 767px) {
	.fr-modal.fancybox__content {
		padding: 28px 20px 24px;
	}

	.fr-modal__close {
		top: 12px;
		right: 12px;
	}

	.fr-modal__title {
		font-size: 22px;
	}

	.fr-modal__lead {
		margin-bottom: 20px;
		font-size: 14px;
	}

	.fr-float {
		right: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom));
		left: 12px;
	}

	.fr-float.is-collapsed {
		left: auto;
	}

	.fr-float__card {
		width: auto;
		border-radius: 16px;
	}

	.fr-float__link {
		grid-template-columns: 40px minmax(0, 1fr) auto;
		align-items: center;
		gap: 12px;
		padding: 10px 48px 10px 10px;
	}

	.fr-float__icon {
		width: 40px;
		height: 40px;
	}

	.fr-float__text {
		padding-right: 0;
	}

	.fr-float__text span {
		display: none;
	}

	.fr-float__text b {
		font-size: 14px;
	}

	.fr-float__btn {
		grid-column: auto;
		height: 40px;
		padding: 0 16px;
		font-size: 14px;
	}

	.fr-float__close {
		top: 50%;
		right: 2px;
		width: 44px;
		height: 44px;
		transform: translateY(-50%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.fr-float {
		transform: none;
		transition: none;
	}
}
