/*
 * AK Sites Kit — форма, окно связи, баннер cookie, содержание, заглушки картинок.
 *
 * Вид задаёт тема через переменные (значения ниже — запасные):
 *   --aksk-accent / --aksk-accent-hover / --aksk-on-accent — главный цвет кнопок и его текст
 *   --aksk-surface / --aksk-text / --aksk-muted / --aksk-line — карточка формы, текст, подписи, линии
 *   --aksk-field — фон полей; --aksk-dark / --aksk-on-dark — тёмные панели (баннер cookie)
 *   --aksk-radius / --aksk-radius-sm — скругления; --aksk-font / --aksk-font-title — шрифты
 *   --aksk-shadow — тень окон; --aksk-ph-bg / --aksk-ph-fg — заглушка картинки
 */

:root {
	--aksk-accent: #2f6f3e;
	--aksk-accent-hover: #255831;
	--aksk-on-accent: #fff;
	--aksk-surface: #fff;
	--aksk-text: #1d2420;
	--aksk-muted: #5f6b64;
	--aksk-line: #dfe5e1;
	--aksk-field: #f5f7f6;
	--aksk-dark: #17201b;
	--aksk-on-dark: #fff;
	--aksk-radius: 18px;
	--aksk-radius-sm: 10px;
	--aksk-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--aksk-font-title: var(--aksk-font);
	--aksk-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
	--aksk-ph-bg: #e9eeeb;
	--aksk-ph-fg: #8a968f;
}

html.aksk-lock {
	overflow: hidden;
}

.aksk-icon {
	flex: none;
	width: 20px;
	height: 20px;
}

/* ================================================================ Форма */

.aksk-form {
	box-sizing: border-box;
	color: var(--aksk-text);
	font-family: var(--aksk-font);
}

.aksk-form *,
.aksk-form *::before,
.aksk-form *::after {
	box-sizing: border-box;
}

.aksk-form--card {
	padding: clamp(20px, 3vw, 32px);
	border: 1px solid var(--aksk-line);
	border-radius: var(--aksk-radius);
	background: var(--aksk-surface);
}

.aksk-form__title {
	margin: 0 0 6px;
	color: var(--aksk-text);
	font-family: var(--aksk-font-title);
	font-size: clamp(22px, 2.4vw, 28px);
	font-weight: 700;
	line-height: 1.2;
}

.aksk-form__text {
	margin: 0 0 18px;
	color: var(--aksk-muted);
	font-size: 15px;
	line-height: 1.5;
}

.aksk-form__form {
	display: grid;
	gap: 12px;
	margin: 0;
}

.aksk-form__form[hidden],
.aksk-form__intro[hidden],
.aksk-form__done[hidden] {
	display: none;
}

.aksk-form__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.aksk-form__field {
	display: grid;
	gap: 6px;
	margin: 0;
}

.aksk-form__label {
	color: var(--aksk-muted);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
}

.aksk-form__label i {
	color: var(--aksk-accent);
	font-style: normal;
}

.aksk-form__input {
	display: block;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 12px 14px;
	border: 1px solid var(--aksk-line);
	border-radius: var(--aksk-radius-sm);
	background: var(--aksk-field);
	color: var(--aksk-text);
	font: inherit;
	font-size: 16px;
	line-height: 1.4;
	transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
	appearance: none;
}

.aksk-form__input::placeholder {
	color: var(--aksk-muted);
	opacity: 0.7;
}

.aksk-form__input:focus {
	border-color: var(--aksk-accent);
	background: var(--aksk-surface);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--aksk-accent) 22%, transparent);
	outline: none;
}

.aksk-form__input--area {
	min-height: 84px;
	resize: vertical;
}

.aksk-form__trap {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.aksk-form__consent {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin: 2px 0 0;
	color: var(--aksk-muted);
	font-size: 13px;
	line-height: 1.45;
	cursor: pointer;
}

.aksk-form__consent input {
	flex: none;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	accent-color: var(--aksk-accent);
}

.aksk-form__consent a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.aksk-form__submit {
	display: inline-flex;
	gap: 10px;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 52px;
	margin: 4px 0 0;
	padding: 14px 22px;
	border: 0;
	border-radius: var(--aksk-radius-sm);
	background: var(--aksk-accent);
	color: var(--aksk-on-accent);
	font-family: var(--aksk-font-title);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.15s, transform 0.15s;
}

.aksk-form__submit:hover,
.aksk-form__submit:focus-visible {
	background: var(--aksk-accent-hover);
}

.aksk-form__submit:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--aksk-accent) 40%, transparent);
	outline-offset: 2px;
}

.aksk-form__submit:disabled {
	opacity: 0.7;
	cursor: progress;
}

.aksk-form__status {
	min-height: 0;
	margin: 0;
	font-size: 14px;
	line-height: 1.4;
}

.aksk-form__status:empty {
	display: none;
}

.aksk-form__status.is-error {
	color: #c62f2f;
}

.aksk-form__other {
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin: 4px 0 0;
	padding: 10px;
	border: 0;
	background: none;
	color: var(--aksk-muted);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.aksk-form__other:hover {
	color: var(--aksk-text);
}

.aksk-form__done {
	display: grid;
	gap: 8px;
	justify-items: center;
	padding: 12px 0;
	text-align: center;
}

.aksk-form__done-icon {
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	margin-bottom: 6px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--aksk-accent) 14%, transparent);
	color: var(--aksk-accent);
}

.aksk-form__done-icon .aksk-icon {
	width: 30px;
	height: 30px;
}

@media (max-width: 560px) {
	.aksk-form__row {
		grid-template-columns: 1fr;
	}
}

/* =========================================================== Окно связи */

.aksk-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: grid;
	place-items: center;
	padding: 16px;
}

.aksk-modal[hidden] {
	display: none;
}

.aksk-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(10, 14, 12, 0.55);
	opacity: 0;
	transition: opacity 0.25s;
}

.aksk-modal__dialog {
	position: relative;
	width: min(480px, 100%);
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	padding: clamp(22px, 4vw, 32px);
	border-radius: var(--aksk-radius);
	background: var(--aksk-surface);
	box-shadow: var(--aksk-shadow);
	opacity: 0;
	transform: translateY(16px) scale(0.98);
	transition: opacity 0.25s, transform 0.25s;
	overscroll-behavior: contain;
}

.aksk-modal__dialog:focus {
	outline: none;
}

.aksk-modal.is-open .aksk-modal__overlay {
	opacity: 1;
}

.aksk-modal.is-open .aksk-modal__dialog {
	opacity: 1;
	transform: none;
}

.aksk-modal__close {
	position: absolute;
	top: 10px;
	right: 10px;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--aksk-muted);
	cursor: pointer;
}

.aksk-modal__close:hover {
	background: var(--aksk-field);
	color: var(--aksk-text);
}

.aksk-modal .aksk-form__title {
	padding-right: 32px;
}

.aksk-modal .aksk-form__row {
	grid-template-columns: 1fr;
}

.aksk-modal__view[hidden] {
	display: none;
}

.aksk-channels__back {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	margin: 0 0 14px;
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--aksk-muted);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.aksk-channels__list {
	display: grid;
	gap: 10px;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
}

.aksk-channels__link {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 14px 16px;
	border: 1px solid var(--aksk-line);
	border-radius: var(--aksk-radius-sm);
	color: var(--aksk-text);
	font-weight: 600;
	text-decoration: none;
}

.aksk-channels__link:hover {
	border-color: var(--aksk-accent);
}

.aksk-channels__link--telegram .aksk-icon { color: #229ed9; }
.aksk-channels__link--whatsapp .aksk-icon { color: #25d366; }
.aksk-channels__link--max .aksk-icon { color: #7b5cff; }

/* Плавающая кнопка «Оставить заявку» */
.aksk-launcher {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 900;
	display: inline-flex;
	gap: 10px;
	align-items: center;
	min-height: 54px;
	padding: 0 22px 0 18px;
	border: 0;
	border-radius: 999px;
	background: var(--aksk-accent);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
	color: var(--aksk-on-accent);
	font-family: var(--aksk-font-title);
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	opacity: 0;
	pointer-events: none;
	transform: translateY(12px);
	transition: opacity 0.2s, transform 0.2s, background-color 0.15s;
}

.aksk-launcher.is-visible {
	opacity: 1;
	pointer-events: auto;
	transform: none;
}

.aksk-launcher:hover {
	background: var(--aksk-accent-hover);
}

@media (max-width: 600px) {
	.aksk-launcher {
		right: 14px;
		bottom: 14px;
		width: 54px;
		padding: 0;
		justify-content: center;
	}

	.aksk-launcher__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}
}

/* ========================================================= Баннер cookie */

.aksk-cookie {
	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 950;
	width: min(420px, calc(100vw - 40px));
	font-family: var(--aksk-font);
}

.aksk-cookie[hidden] {
	display: none;
}

.aksk-cookie__card {
	max-height: calc(100vh - 60px);
	overflow-y: auto;
	padding: 20px 20px 18px;
	border-radius: var(--aksk-radius);
	background: var(--aksk-dark);
	box-shadow: var(--aksk-shadow);
	color: color-mix(in srgb, var(--aksk-on-dark) 78%, transparent);
}

.aksk-cookie__title {
	margin: 0 0 6px;
	color: var(--aksk-on-dark);
	font-family: var(--aksk-font-title);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
}

.aksk-cookie__text {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
}

.aksk-cookie__text a {
	color: var(--aksk-on-dark);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.aksk-cookie__prefs {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid color-mix(in srgb, var(--aksk-on-dark) 14%, transparent);
}

.aksk-cookie__prefs[hidden],
.aksk-cookie__btn[hidden],
.aksk-cookie__link[hidden] {
	display: none;
}

.aksk-cookie__cat + .aksk-cookie__cat {
	margin-top: 12px;
}

.aksk-cookie__cat.is-locked {
	opacity: 0.7;
}

.aksk-cookie__switch {
	position: relative;
	display: flex;
	gap: 10px;
	align-items: center;
	cursor: pointer;
}

.aksk-cookie__switch input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.aksk-cookie__track {
	position: relative;
	flex: none;
	width: 38px;
	height: 22px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--aksk-on-dark) 25%, transparent);
	transition: background-color 0.15s;
}

.aksk-cookie__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.15s;
}

.aksk-cookie__switch input:checked ~ .aksk-cookie__track {
	background: var(--aksk-accent);
}

.aksk-cookie__switch input:checked ~ .aksk-cookie__track::after {
	transform: translateX(16px);
}

.aksk-cookie__switch input:focus-visible ~ .aksk-cookie__track {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.aksk-cookie__cat-title {
	color: var(--aksk-on-dark);
	font-size: 14px;
	font-weight: 600;
}

.aksk-cookie__always {
	margin-left: 6px;
	font-size: 11px;
	opacity: 0.6;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.aksk-cookie__cat-text {
	margin: 6px 0 0 48px;
	font-size: 13px;
	line-height: 1.5;
}

.aksk-cookie__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-top: 16px;
}

.aksk-cookie__btn {
	flex: 1 1 auto;
	min-height: 44px;
	padding: 10px 18px;
	border: 1px solid transparent;
	border-radius: var(--aksk-radius-sm);
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}

.aksk-cookie__btn--primary {
	background: var(--aksk-accent);
	color: var(--aksk-on-accent);
}

.aksk-cookie__btn--primary:hover {
	background: var(--aksk-accent-hover);
}

.aksk-cookie__btn--ghost {
	border-color: color-mix(in srgb, var(--aksk-on-dark) 35%, transparent);
	background: transparent;
	color: var(--aksk-on-dark);
}

.aksk-cookie__link {
	flex: none;
	padding: 6px 4px;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 14px;
	text-decoration: underline;
	cursor: pointer;
}

.aksk-cookie-settings {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: inherit;
	cursor: pointer;
}

@media (max-width: 600px) {
	.aksk-cookie {
		left: 12px;
		right: 12px;
		bottom: 80px;
		width: auto;
	}
}

/* ============================================================ Содержание */

.aksk-toc {
	font-family: var(--aksk-font);
}

.aksk-toc--sidebar {
	position: sticky;
	top: 100px;
}

.aksk-toc__inner {
	max-height: calc(100vh - 130px);
	overflow-y: auto;
	padding: 20px;
	border: 1px solid var(--aksk-line);
	border-radius: var(--aksk-radius);
	background: var(--aksk-surface);
}

.aksk-toc__title {
	margin: 0 0 12px;
	color: var(--aksk-text);
	font-family: var(--aksk-font-title);
	font-size: 16px;
	font-weight: 700;
}

.aksk-toc__list {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: aksk-toc;
}

.aksk-toc__item {
	counter-increment: aksk-toc;
}

.aksk-toc__link {
	display: flex;
	gap: 10px;
	padding: 7px 10px;
	border-radius: var(--aksk-radius-sm);
	color: var(--aksk-muted);
	font-size: 14px;
	line-height: 1.4;
	text-decoration: none;
}

.aksk-toc__link::before {
	content: counter(aksk-toc, decimal-leading-zero);
	flex: none;
	color: var(--aksk-accent);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.aksk-toc__link:hover {
	color: var(--aksk-text);
}

.aksk-toc__link.is-active {
	background: color-mix(in srgb, var(--aksk-accent) 10%, transparent);
	color: var(--aksk-text);
	font-weight: 600;
}

@media (max-width: 1024px) {
	.aksk-toc--sidebar {
		display: none;
	}
}

/* Плавающие кнопки «наверх» и «содержание» */
.aksk-fab {
	position: fixed;
	right: 20px;
	bottom: 88px;
	z-index: 890;
	display: grid;
	gap: 10px;
	opacity: 0;
	pointer-events: none;
	transform: translateY(10px);
	transition: opacity 0.2s, transform 0.2s;
}

.aksk-fab.is-visible {
	opacity: 1;
	pointer-events: auto;
	transform: none;
}

.aksk-fab__btn {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 1px solid var(--aksk-line);
	border-radius: 50%;
	background: var(--aksk-surface);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
	color: var(--aksk-text);
	cursor: pointer;
}

.aksk-fab__btn:hover {
	border-color: var(--aksk-accent);
	color: var(--aksk-accent);
}

.aksk-fab__toc {
	display: none;
}

@media (max-width: 1024px) {
	.aksk-fab__toc {
		display: grid;
	}
}

@media (max-width: 600px) {
	.aksk-fab {
		right: 18px;
		bottom: 80px;
	}
}

.aksk-toc-sheet {
	position: fixed;
	inset: 0;
	z-index: 1001;
}

.aksk-toc-sheet[hidden] {
	display: none;
}

.aksk-toc-sheet__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 14, 12, 0.5);
	opacity: 0;
	transition: opacity 0.3s;
}

.aksk-toc-sheet__panel {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	max-height: 75vh;
	overflow-y: auto;
	padding: 12px 20px 28px;
	border-radius: var(--aksk-radius) var(--aksk-radius) 0 0;
	background: var(--aksk-surface);
	transform: translateY(100%);
	transition: transform 0.3s;
}

.aksk-toc-sheet__panel:focus {
	outline: none;
}

.aksk-toc-sheet.is-open .aksk-toc-sheet__backdrop {
	opacity: 1;
}

.aksk-toc-sheet.is-open .aksk-toc-sheet__panel {
	transform: none;
}

.aksk-toc-sheet__handle {
	display: block;
	width: 44px;
	height: 5px;
	margin: 0 auto 14px;
	border-radius: 3px;
	background: var(--aksk-line);
}

/* ===================================================== Заглушка картинки */

.aksk-img {
	position: relative;
	margin: 0;
	overflow: hidden;
	border-radius: var(--aksk-radius);
}

.aksk-img img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
}

.aksk-img--placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	min-height: 120px;
	background:
		linear-gradient(135deg, transparent 0 48%, color-mix(in srgb, var(--aksk-ph-fg) 18%, transparent) 48% 52%, transparent 52% 100%),
		var(--aksk-ph-bg);
	color: var(--aksk-ph-fg);
}

.aksk-img__icon {
	opacity: 0.7;
}

/* Промпт видят только вошедшие редакторы */
.aksk-img__prompt {
	position: absolute;
	inset: 10px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	justify-content: center;
	overflow: auto;
	padding: 14px 16px;
	border: 1px dashed currentColor;
	border-radius: calc(var(--aksk-radius) - 6px);
	background: rgba(255, 255, 255, 0.9);
	color: #1e2a35;
	font: 13px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
	text-align: left;
}

.aksk-img__badge {
	align-self: flex-start;
	padding: 2px 8px;
	border-radius: 999px;
	background: #1e2a35;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

/* Подпись разработчика */
.aksk-credit a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.aksk-modal__overlay,
	.aksk-modal__dialog,
	.aksk-launcher,
	.aksk-fab,
	.aksk-toc-sheet__panel,
	.aksk-toc-sheet__backdrop {
		transition: none;
	}
}

/* Страховка к выключенной «ленивой отрисовке» WP Rocket (inc/rocket.php) для страниц из старого кеша */
html [data-wpr-lazyrender] {
	content-visibility: visible;
	contain-intrinsic-size: none;
}
