/**
 * SPEC Cookie Consent — стили модального окна.
 *
 * Токены взяты из темы spec (css/main.css): Involve, #1e1e1e, градиент
 * 61deg #c32afe → #6a5afb → #4b95ff, скругление 24px, оверлей #150e2ecc.
 * Все правила намеренно вне CSS-слоёв темы, чтобы не зависеть от @layer.
 */

/* ---------- Корень ---------- */

.spec-consent,
.spec-consent *,
.spec-consent *::before,
.spec-consent *::after {
	box-sizing: border-box;
}

.spec-consent {
	position: fixed;
	inset: 0;
	z-index: 1500;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	font-family: var(--font-primary, "Involve", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif);
	font-size: 16px;
	line-height: 1.5;
	color: var(--color-primary, #1e1e1e);
	text-align: left;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.spec-consent[hidden] {
	display: none !important;
}

/* ---------- Оверлей и диалог ---------- */

.spec-consent__overlay {
	position: absolute;
	inset: 0;
	background: #150e2ecc;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.spec-consent.is-open .spec-consent__overlay {
	opacity: 1;
}

.spec-consent__dialog {
	position: relative;
	width: 100%;
	max-width: 620px;
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	padding: 40px;
	overflow: auto;
	overscroll-behavior: contain;
	touch-action: pan-y;
	background: var(--color-whte, #fff);
	border-radius: 24px;
	box-shadow:
		0 40px 90px -30px rgba(21, 14, 46, 0.55),
		0 1px 0 rgba(255, 255, 255, 0.6) inset;
	opacity: 0;
	transform: translateY(18px) scale(0.985);
	transition:
		transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
		opacity 0.25s ease;
}

.spec-consent__dialog:focus {
	outline: none;
}

.spec-consent.is-open .spec-consent__dialog {
	opacity: 1;
	transform: none;
}

.spec-consent__glow {
	position: absolute;
	top: -140px;
	right: -130px;
	width: 300px;
	height: 300px;
	border-radius: 50%;
	background: linear-gradient(61deg, #c32afe 9.95%, #6a5afb 45.07%, #4b95ff 80.2%);
	filter: blur(50px);
	opacity: 0.18;
	pointer-events: none;
}

.spec-consent__view {
	position: relative;
}

.spec-consent__view[hidden] {
	display: none !important;
}

/* ---------- Типографика ---------- */

.spec-consent__kicker {
	margin: 0 0 14px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	background: linear-gradient(61deg, #c32afe 9.95%, #6a5afb 45.07%, #4b95ff 80.2%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.spec-consent__title {
	margin: 0 0 14px;
	font-size: 30px;
	font-weight: 700;
	line-height: 1.18;
	letter-spacing: -0.02em;
	color: var(--color-primary, #1e1e1e);
}

.spec-consent__text {
	font-size: 16px;
	font-weight: 500;
	line-height: 1.55;
	color: rgba(30, 30, 30, 0.72);
}

.spec-consent__text p {
	margin: 0 0 10px;
}

.spec-consent__text p:last-child {
	margin-bottom: 0;
}

.spec-consent__text a {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.spec-consent__text a:hover {
	text-decoration: none;
}

/* ---------- Ссылки на политики ---------- */

.spec-consent__links {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 3px;
	margin: 14px 0 0;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.5;
}

.spec-consent__links a {
	color: var(--color-primary, #1e1e1e);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition: opacity 0.25s ease;
}

.spec-consent__links a:hover {
	opacity: 0.62;
}

/* ---------- Кнопки ---------- */

.spec-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 28px;
}

.spec-consent__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 0;
	min-width: 0;
	min-height: 56px;
	padding: 16px 28px;
	border: 1px solid transparent;
	border-radius: 84px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -0.16px;
	text-align: center;
	color: #fff;
	cursor: pointer;
	transition:
		transform 0.25s ease,
		box-shadow 0.25s ease,
		background-color 0.25s ease,
		background-position 0.35s ease,
		color 0.25s ease,
		border-color 0.25s ease;
}

.spec-consent__btn--primary {
	background-color: #6a5afb;
	background-image: linear-gradient(61deg, #c32afe 9.95%, #6a5afb 45.07%, #4b95ff 80.2%);
	background-size: 130% 130%;
	background-position: 0 0;
	box-shadow: 0 8px 20px -10px rgba(106, 90, 251, 0.55);
}

.spec-consent__btn--primary:hover {
	background-position: 100% 0;
	box-shadow: 0 12px 26px -10px rgba(106, 90, 251, 0.7);
	transform: translateY(-1px);
}

.spec-consent__btn--primary:active {
	transform: translateY(0);
}

.spec-consent__btn--ghost {
	color: var(--color-primary, #1e1e1e);
	background-color: transparent;
	border-color: rgba(30, 30, 30, 0.22);
}

.spec-consent__btn--ghost:hover {
	background-color: var(--color-bg-third, #f0f4ff);
	border-color: transparent;
}

/* ---------- Подвал окна ---------- */

.spec-consent__footer {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 18px;
	padding-top: 18px;
	border-top: 1px solid rgba(30, 30, 30, 0.08);
}

.spec-consent__settings-link {
	align-self: flex-start;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	color: rgba(30, 30, 30, 0.62);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	cursor: pointer;
	transition: color 0.25s ease;
}

.spec-consent__settings-link:hover {
	color: var(--color-primary, #1e1e1e);
}

.spec-consent__note {
	margin: 0;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.55;
	color: #6f6f6f;
}

/* ---------- Экран настроек ---------- */

.spec-consent__list {
	margin: 24px 0 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid rgba(30, 30, 30, 0.08);
}

.spec-consent__row {
	display: flex;
	align-items: flex-start;
	gap: 20px;
	margin: 0;
	padding: 18px 0;
	list-style: none;
	border-bottom: 1px solid rgba(30, 30, 30, 0.08);
}

.spec-consent__row:last-child {
	border-bottom: 0;
}

.spec-consent__row-text {
	flex: 1 1 auto;
	min-width: 0;
}

.spec-consent__row-title {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--color-primary, #1e1e1e);
}

.spec-consent__row-desc {
	margin: 0;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.5;
	color: rgba(30, 30, 30, 0.68);
}

.spec-consent__switch {
	position: relative;
	flex: 0 0 auto;
	width: 46px;
	height: 26px;
	margin-top: 2px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background-color: #e6e6e6;
	cursor: pointer;
	transition: background-color 0.25s ease, opacity 0.25s ease;
}

.spec-consent__switch-knob {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
	transition: transform 0.25s ease;
}

.spec-consent__switch[aria-checked="true"] {
	background-color: #6a5afb;
	background-image: linear-gradient(61deg, #c32afe 9.95%, #6a5afb 45.07%, #4b95ff 80.2%);
}

.spec-consent__switch[aria-checked="true"] .spec-consent__switch-knob {
	transform: translateX(20px);
}

.spec-consent__switch:disabled {
	opacity: 0.5;
	cursor: default;
}

/* ---------- Фокус ---------- */

.spec-consent__btn:focus-visible,
.spec-consent__settings-link:focus-visible,
.spec-consent__switch:focus-visible,
.spec-consent__links a:focus-visible {
	outline: 2px solid #6a5afb;
	outline-offset: 3px;
}

/* ---------- Блокировка прокрутки ---------- */

html.spec-consent-open {
	overflow: hidden !important;
}

html.spec-consent-open body {
	overflow: hidden !important;
	overscroll-behavior: none;
}

/* ---------- Плавающая кнопка ---------- */

.spec-consent-fab {
	position: fixed;
	left: 20px;
	bottom: 20px;
	bottom: max(20px, env(safe-area-inset-bottom));
	z-index: 1100;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(30, 30, 30, 0.12);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: var(--color-primary, #1e1e1e);
	box-shadow: 0 8px 24px -8px rgba(21, 14, 46, 0.35);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	cursor: pointer;
	transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.spec-consent-fab[hidden] {
	display: none !important;
}

.spec-consent-fab:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 28px -8px rgba(21, 14, 46, 0.45);
}

.spec-consent-fab svg {
	display: block;
}

html.spec-consent-open .spec-consent-fab {
	opacity: 0;
	pointer-events: none;
}

/* ---------- Ссылка-шорткод ---------- */

.spec-consent-link {
	display: inline;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	cursor: pointer;
}

.spec-consent-link:hover {
	text-decoration: none;
}

/* ---------- Без JS ---------- */

.spec-consent-noscript {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1490;
	padding: 14px 18px;
	background: #1e1e1e;
	color: #fff;
	font-size: 13px;
	line-height: 1.5;
}

.spec-consent-noscript p {
	max-width: 1200px;
	margin: 0 auto;
}

.spec-consent-noscript a {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ---------- Адаптив ---------- */

@media only screen and (max-width: 767.98px) {
	.spec-consent {
		padding: 16px;
	}

	.spec-consent__dialog {
		max-height: calc(100dvh - 32px);
		padding: 28px 22px;
		border-radius: 20px;
	}

	.spec-consent__title {
		font-size: 25px;
	}

	.spec-consent__text {
		font-size: 15px;
	}

	.spec-consent__actions {
		margin-top: 24px;
	}

	.spec-consent__btn {
		flex: 1 1 100%;
		min-height: 54px;
		padding: 16px 22px;
		font-size: 15px;
	}

	.spec-consent__links {
		margin-top: 14px;
	}

	.spec-consent-fab {
		left: 14px;
		bottom: max(14px, env(safe-area-inset-bottom));
		width: 42px;
		height: 42px;
	}
}

@media only screen and (max-width: 479.98px) {
	.spec-consent {
		padding: 12px;
	}

	.spec-consent__dialog {
		max-height: calc(100dvh - 24px);
		padding: 24px 18px;
	}

	.spec-consent__title {
		font-size: 23px;
	}

	.spec-consent__kicker {
		margin-bottom: 10px;
	}
}

/* ---------- Уменьшенное движение ---------- */

@media (prefers-reduced-motion: reduce) {
	.spec-consent__overlay,
	.spec-consent__dialog,
	.spec-consent__btn,
	.spec-consent__switch,
	.spec-consent__switch-knob,
	.spec-consent-fab {
		transition: none !important;
	}

	.spec-consent__dialog {
		transform: none;
	}
}

/* ---------- Печать ---------- */

@media print {
	.spec-consent,
	.spec-consent-fab,
	.spec-consent-noscript {
		display: none !important;
	}
}
