/**
 * CCC — глобальные стили для всех тем (не префикс темы).
 * Подключение: плагин cotcustom (hooks=rc) → Resources::addFile.
 * Тема может переопределить переменные / селекторы в своём CSS.
 *
 * .cotcustom-unselectable / .files-unselectable — ВСЕ элементы интерфейса (не контент).
 * Подробно: docs/ru/27-naming-frontend.md → «Unselectable».
 * .cotcustom-form + инпуты — вид «underline» как Siena .new-form (без Bootstrap .form-control).
 * textarea — блок aliceblue + autoresize (Siena .com_textarea-autoresize), не underline.
 */

:root {
	/* ===== CCC palette (docs/ru/32-palette.md) — тема оверрайдит --ccc-* ===== */
	--ccc-text: #292929;
	--ccc-text-muted: #8a8a8a;
	--ccc-bg: #f8fafc;
	--ccc-surface: #ffffff;
	--ccc-border: #e9e9e9;
	--ccc-footer-bg: #303030;
	--ccc-footer-text: color-mix(in srgb, var(--ccc-surface) 60%, transparent);
	/* Бренд (красный) + UI-action (синий) */
	--ccc-brand: #f91b24;
	--ccc-brand-contrast: #ffffff;
	--ccc-action: #1065a8;
	--ccc-action-hover: #0d528a;
	--ccc-action-soft: #6db3f2;
	--ccc-action-soft-bg: #ddebf7;
	--ccc-action-contrast: #ffffff;
	/* Семантика */
	--ccc-danger: #e84b3d;
	--ccc-danger-border: #da2f23;
	--ccc-success: #28a745;
	--ccc-warning: #ffc107;
	--ccc-disabled: #9a9a9a;
	--ccc-disabled-bg: #e4e4e4;

	/* Legacy cotcustom-* → CCC (старые селекторы / тема) */
	--cotcustom-input-focus: var(--ccc-action);
	--cotcustom-input-line: var(--ccc-border);
	--cotcustom-input-bg: transparent;
	--cotcustom-textarea-bg: var(--ccc-action-soft-bg);
	--cotcustom-textarea-bg-focus: var(--ccc-action-soft-bg);
	--cotcustom-textarea-color: var(--ccc-text);
	--cotcustom-textarea-min-height: 130px;
	--cotcustom-textarea-padding: 10px;
	--cotcustom-textarea-font-size: 13px;
	--cotcustom-textarea-line-height: 1.5;
	--cotcustom-btn-blue: var(--ccc-action);
	--cotcustom-btn-blue-hover-color: var(--ccc-action-contrast);
	--cotcustom-btn-blue-disabled: var(--ccc-action-soft);
	--cotcustom-btn-blue-light: var(--ccc-action-soft-bg);
	--cotcustom-btn-blue-light-disabled: var(--ccc-bg);
	--cotcustom-btn-blue-light-disabled-color: var(--ccc-disabled);
	--cotcustom-btn-red: var(--ccc-danger);
	--cotcustom-btn-red-disabled: var(--ccc-disabled);
	--cotcustom-btn-green: var(--ccc-success);
	--cotcustom-btn-green-disabled: var(--ccc-success);
	--cotcustom-btn-gray-light: var(--ccc-disabled-bg);
	--cotcustom-process-top: 50px;
	--cotcustom-process-left: 30px;
	/* blueimg — тот же soft-синий */
	--blueimg-placeholder: var(--ccc-action-soft);
}

/*
 * Unselectable: по умолчанию весь UI chrome.
 * Selectable оставляем: значения input/textarea, тело статьи/страницы,
 * имена/описания пользователя, коды/URL которые явно копируют.
 */
.cotcustom-unselectable,
.files-unselectable {
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

/*
 * Анти-autofill: после password→text (Siena) маскируем ввод точками.
 * Safari/Chrome: -webkit-text-security. Firefox без маски — поле всё равно type=text.
 */
input.cotcustom-noautofill[data-cotcustom-secret='1'],
input.cotcustom-noautofill[type='password'] {
	-webkit-text-security: disc;
}

/* Кликабельные подписи (delswitch label и т.п., как Siena .pointer) */
.pointer,
.js-cotcustom-delswitch-label {
	cursor: pointer;
}

/* Подписи колонок в формах Cotonti (таблица .cells) */
.cotcustom-form .cells > tr > td:first-child,
.cotcustom-form .cells > tbody > tr > td:first-child,
.cotcustom-form label {
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

/* Files: ID / Title label — интерфейс */
.file-upload .file-id,
.file-upload .names > label,
.file-upload .names label {
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

/* Поля ввода — выделять можно */
.cotcustom-form input,
.cotcustom-form textarea,
.cotcustom-form select,
.file-upload .names input,
.file-upload .names textarea,
.file-upload input.file-edit {
	-webkit-user-select: text;
	-moz-user-select: text;
	-ms-user-select: text;
	user-select: text;
}

/* —— Инпуты / select: логика Siena .new-form (нижняя линия, focus → цветная) —— */
.cotcustom-form input[type='text'],
.cotcustom-form input[type='email'],
.cotcustom-form input[type='url'],
.cotcustom-form input[type='password'],
.cotcustom-form input[type='number'],
.cotcustom-form input[type='search'],
.cotcustom-form input:not([type]),
.cotcustom-form select,
.cotcustom-input,
.file-upload input.file-edit,
.file-upload .names .uk-input {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 0.45rem 0;
	border: 0;
	border-radius: 0;
	float: none;
	box-shadow: none;
	font-weight: 300;
	font: inherit;
	color: inherit;
	background-color: var(--cotcustom-input-bg);
	background-image: linear-gradient(var(--cotcustom-input-focus), var(--cotcustom-input-focus)),
		linear-gradient(var(--cotcustom-input-line), var(--cotcustom-input-line));
	background-size: 0 2px, 100% 1px;
	background-repeat: no-repeat;
	background-position: center bottom, center calc(100% - 1px);
	transition: background 0s ease-out;
}

.cotcustom-form input[type='text']:focus,
.cotcustom-form input[type='email']:focus,
.cotcustom-form input[type='url']:focus,
.cotcustom-form input[type='password']:focus,
.cotcustom-form input[type='number']:focus,
.cotcustom-form input[type='search']:focus,
.cotcustom-form input:not([type]):focus,
.cotcustom-form select:focus,
.cotcustom-input:focus,
.file-upload input.file-edit:focus,
.file-upload .names .uk-input:focus {
	outline: none;
	background-color: var(--cotcustom-input-bg);
	background-image: linear-gradient(var(--cotcustom-input-focus), var(--cotcustom-input-focus)),
		linear-gradient(var(--cotcustom-input-line), var(--cotcustom-input-line));
	background-size: 100% 2px, 100% 1px;
	box-shadow: none;
	transition-duration: 0.3s;
}

.cotcustom-form input:focus::placeholder,
.cotcustom-input:focus::placeholder,
.file-upload input.file-edit:focus::placeholder {
	color: transparent;
}

/*
 * Textarea — вид Сиены (aliceblue / com_textarea-autoresize), не underline.
 * Автовысота: js/cotcustom-textarea.js (.cotcustom-textarea-autoresize или форма .cotcustom-form).
 * Редакторы (.editor / .medieditor / .minieditor) не трогаем.
 */
.cotcustom-form textarea:not(.editor):not(.medieditor):not(.minieditor),
.cotcustom-textarea,
.cotcustom-textarea-autoresize {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: var(--cotcustom-textarea-padding);
	min-height: var(--cotcustom-textarea-min-height);
	border: 0;
	border-radius: 0;
	float: none;
	resize: none;
	overflow-y: hidden;
	box-shadow: none;
	font-weight: 300;
	font-size: var(--cotcustom-textarea-font-size);
	line-height: var(--cotcustom-textarea-line-height);
	color: var(--cotcustom-textarea-color);
	background-color: var(--cotcustom-textarea-bg);
	background-image: none;
	transition: background-color 0.15s ease;
}

.cotcustom-form textarea:not(.editor):not(.medieditor):not(.minieditor):focus,
.cotcustom-textarea:focus,
.cotcustom-textarea-autoresize:focus {
	outline: none;
	box-shadow: none;
	background-color: var(--cotcustom-textarea-bg-focus);
	background-image: none;
}

/*
 * Select2 — вид Сиены (beta-elements + essentials):
 * скин (46px, var(--ccc-border)) — lib/select2; ширина — js/cotcustom-select2.js + пресеты ниже.
 * Не shorty/midi: явные cotcustom-s2--w-N / data-cotcustom-s2-*.
 */

/* Обёртка с CSS-переменными (опционально) */
.cotcustom-s2 {
	display: inline-block;
	max-width: 100%;
	vertical-align: middle;
	--cotcustom-s2-width: 100%;
	--cotcustom-s2-min-width: 0;
}

.cotcustom-s2--block {
	display: block;
	width: 100%;
}

/* Дефолт / full: перекрываем inline width:100px от Select2 resolve */
.cotcustom-form .select2-container,
select.select2 + .select2-container {
	width: 100% !important;
	max-width: 100%;
}

/* Пресет 300px — класс на <select> или на .cotcustom-s2 */
select.cotcustom-s2--w-300 + .select2-container,
.cotcustom-s2--w-300 > .select2-container,
.cotcustom-s2.cotcustom-s2--w-300 .select2-container {
	width: 300px !important;
	max-width: min(100%, 300px) !important;
}

/* Полная ширина явно */
select.cotcustom-s2--w-full + .select2-container,
.cotcustom-s2--w-full > .select2-container {
	width: 100% !important;
	max-width: 100% !important;
}

/* Переменные на обёртке */
.cotcustom-s2 > select.select2 + .select2-container {
	width: var(--cotcustom-s2-width, 100%) !important;
	max-width: 100%;
	min-width: var(--cotcustom-s2-min-width, 0);
}

.cotcustom-form .select2-container--default .select2-selection--single,
.cotcustom-form .select2-container--default .select2-selection--multiple {
	background-image: none !important;
	box-shadow: none;
}

.cotcustom-form .select2-container--default.select2-container--focus .select2-selection--single,
.cotcustom-form .select2-container--default.select2-container--open .select2-selection--single,
.cotcustom-form .select2-container--default.select2-container--focus .select2-selection--multiple,
.cotcustom-form .select2-container--default.select2-container--open .select2-selection--multiple {
	border-color: var(--ccc-border);
	outline: 0;
}

.select2-dropdown {
	border: 1px solid var(--ccc-border);
	border-radius: 4px;
	z-index: 10050;
}

/* Поиск в выпадашке — без чёрной/пунктирной обводки focus (браузер / UIkit) */
.select2-search--dropdown .select2-search__field,
.select2-search--dropdown .select2-search__field:focus,
.select2-search--dropdown .select2-search__field:focus-visible,
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
	outline: none !important;
	outline-offset: 0 !important;
	box-shadow: none !important;
	border: 1px solid var(--ccc-border) !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
	background-color: var(--ccc-action-soft);
	color: var(--ccc-surface);
}

/*
 * Счётчик символов (порт Siena alpha-input__character-counter).
 * JS: js/cotcustom-charcount.js — авто на maxlength в .cotcustom-form.
 */
.cotcustom-charcount {
	width: 100%;
	margin: 4px 0 0;
	font-size: 11px;
	line-height: 1.3;
	color: var(--ccc-text-muted);
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

.cotcustom-charcount--error {
	color: var(--ccc-danger) !important;
}

/*
 * Чекбоксы / радио-свитчи — порт Siena (essentials + beta-elements).
 * Классы как в Сиене: .checkbox / .radio / .switchradio-light / .switch-blue / .switch-red.
 * Галочка через CSS (Font Awesome не используем).
 */

.radio + .radio,
.checkbox + .checkbox {
	margin-top: 1px;
}

.radio,
.checkbox {
	display: inline-block;
	position: relative;
	overflow: hidden;
	margin: 0 25px 3px 0;
	padding-left: 26px;
	font-size: 14px;
	line-height: 29px;
	color: var(--ccc-text);
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
}

.radio input,
.checkbox input {
	position: absolute;
	left: 0;
	top: 0;
	opacity: 0;
	width: 19px;
	height: 19px;
	margin: 0;
	cursor: pointer;
	z-index: 1;
}

.radio i,
.checkbox i {
	position: absolute;
	top: 5px;
	left: 0;
	display: block;
	width: 19px;
	height: 19px;
	box-sizing: border-box;
	border: 2px solid rgba(0, 0, 0, 0.3);
	background: rgba(255, 255, 255, 0.3);
	pointer-events: none;
}

.radio i {
	border-radius: 50%;
}

.radio input + i:after,
.checkbox input + i:after {
	position: absolute;
	opacity: 0;
	transition: opacity 0.1s;
	content: '';
}

/* Галочка CSS (Font Awesome нет) — под бокс 19×19 */
.checkbox input + i:after,
.checkbox input + i::after {
	content: '';
	top: 1px;
	left: 5px;
	width: 4px;
	height: 9px;
	border: solid var(--ccc-text);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	font: inherit;
	background: none;
}

.radio input + i:after {
	top: 4px;
	left: 4px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background-color: var(--ccc-text);
}

.radio input:checked + i:after,
.checkbox input:checked + i:after {
	opacity: 1;
}

.radio:hover i,
.checkbox:hover i,
.radio input:focus + i,
.checkbox input:focus + i {
	border-color: rgba(0, 0, 0, 0.6);
}

.radio input:checked + i,
.checkbox input:checked + i {
	border-color: var(--ccc-text);
}

.checkbox.checkbox-blue input:checked + i {
	border-color: var(--ccc-action-soft);
}
.checkbox.checkbox-blue input:checked + i:after {
	border-color: var(--ccc-action-soft);
}
.checkbox.checkbox-red input:checked + i {
	border-color: var(--ccc-danger);
}
.checkbox.checkbox-red input:checked + i:after {
	border-color: var(--ccc-danger);
}

.danger .radio i,
.danger .checkbox i {
	border-color: var(--ccc-danger) !important;
}

/* —— switch-light (чекбокс-тумблер) —— */
.switch-light,
.switch-light * {
	-webkit-user-select: none;
	user-select: none;
}
.switch-light label {
	cursor: pointer;
}
.switch-light label input[type='checkbox'] {
	opacity: 0;
	width: 0;
	height: 0;
}
.switch-light label input[type='checkbox']:checked + .lever {
	background-color: var(--ccc-disabled-bg);
}
.switch-light.switch-red label input[type='checkbox']:checked + .lever:after {
	background-color: var(--ccc-danger);
}
.switch-light.switch-blue label input[type='checkbox']:checked + .lever:after {
	background-color: var(--ccc-action-soft);
}
.switch-light label .lever {
	position: relative;
	display: inline-block;
	width: 30px;
	height: 11px;
	margin: 0 16px 0 0;
	vertical-align: middle;
	background-color: color-mix(in srgb, var(--ccc-disabled-bg) 51%, transparent);
	border-radius: 15px;
	transition: background 0.3s ease;
}
.switch-light label .lever:after {
	content: '';
	position: absolute;
	width: 15px;
	height: 15px;
	left: -5px;
	top: -3px;
	background-color: var(--ccc-disabled-bg);
	border-radius: 21px;
	box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4);
	transition: left 0.3s ease, background 0.3s ease, box-shadow 0.1s ease;
}
.switch-light label input[type='checkbox']:checked + .lever:after {
	left: 19px;
}
.switch-light.switch-blue label input[type='checkbox'][disabled] + .lever:after,
.switch-light.switch-blue label input[type='checkbox'][disabled]:checked + .lever:after {
	background-color: var(--ccc-disabled);
}
.switch-light.switch-red label input[type='checkbox'][disabled] + .lever:after,
.switch-light.switch-red label input[type='checkbox'][disabled]:checked + .lever:after {
	background-color: var(--ccc-disabled);
}

/* —— switchradio-light (пара radio 0/1 как тумблер; цвета blue + red) —— */
.switchradio-light {
	position: relative;
	display: inline-block;
	margin-top: -2px;
	vertical-align: middle;
	width: 30px;
	height: 11px;
	-webkit-user-select: none;
	user-select: none;
}
.switchradio-light,
.switchradio-light input,
.switchradio-light label input + span,
.switchradio-light label input + span label,
.switchradio-light label input:checked + span label,
.switchradio-light label input[value='ASC']:checked + span,
.switchradio-light label input[value='yes']:checked + span,
.switchradio-light label input[value='DESC']:checked + span,
.switchradio-light label input[value='no']:checked + span,
.switchradio-light label input[value='-1']:checked + span,
.switchradio-light label input[value='1']:checked + span,
.switchradio-light label input[value='0']:checked + span,
.switchradio-light label input[value='full']:checked + span,
.switchradio-light label input[value='gallery']:checked + span {
	position: absolute;
	vertical-align: middle;
	width: 30px;
	height: 11px;
	cursor: pointer;
	font-size: 11px;
}
.switchradio-light label input + span label {
	overflow: hidden;
	line-height: 11px;
	text-align: center;
	width: 0;
}
.switchradio-light input {
	top: -4px;
	left: 0;
	opacity: 0;
	z-index: 1;
}
.switchradio-light input:checked {
	z-index: 0;
}
.switchradio-light label input + span {
	top: 0;
	width: 8px;
}
.switchradio-light label input[value='ASC'] + span label,
.switchradio-light label input[value='yes'] + span label,
.switchradio-light label input[value='1'] + span label,
.switchradio-light label input[value='full'] + span label {
	text-indent: -14px;
	color: var(--ccc-surface);
}
.switchradio-light label input[value='DESC'] + span label,
.switchradio-light label input[value='no'] + span label,
.switchradio-light label input[value='0'] + span label,
.switchradio-light label input[value='-1'] + span label,
.switchradio-light label input[value='gallery'] + span label {
	text-indent: 14px;
	color: var(--ccc-danger-border);
}
.switchradio-light label input[value='ASC'] + span,
.switchradio-light label input[value='yes'] + span,
.switchradio-light label input[value='1'] + span,
.switchradio-light label input[value='full'] + span,
.switchradio-light.switch-blue label input[value='ASC'] + span,
.switchradio-light.switch-blue label input[value='yes'] + span,
.switchradio-light.switch-blue label input[value='1'] + span,
.switchradio-light.switch-blue label input[value='full'] + span {
	background-color: color-mix(in srgb, var(--ccc-disabled-bg) 81%, transparent);
}
.switchradio-light label input[value='DESC']:checked + span,
.switchradio-light label input[value='no']:checked + span,
.switchradio-light label input[value='0']:checked + span,
.switchradio-light label input[value='-1']:checked + span,
.switchradio-light label input[value='gallery']:checked + span {
	left: 0;
}
.switchradio-light label input[value='ASC']:checked + span,
.switchradio-light label input[value='yes']:checked + span,
.switchradio-light label input[value='1']:checked + span,
.switchradio-light label input[value='full']:checked + span {
	right: 0;
}
.switchradio-light label input[value='DESC'] + span,
.switchradio-light label input[value='no'] + span,
.switchradio-light label input[value='0'] + span,
.switchradio-light label input[value='-1'] + span,
.switchradio-light label input[value='gallery'] + span {
	background-color: color-mix(in srgb, var(--ccc-disabled-bg) 81%, transparent);
	left: 23px;
}
.switchradio-light label input[value='ASC'] + span,
.switchradio-light label input[value='yes'] + span,
.switchradio-light label input[value='1'] + span,
.switchradio-light label input[value='full'] + span {
	right: 23px;
	background-color: color-mix(in srgb, var(--ccc-disabled-bg) 81%, transparent);
}
.switchradio-light label input + span,
.switchradio-light label input + span label,
.switchradio-light label input:checked + span,
.switchradio-light label input:checked + span label {
	transition: all 0.2s linear;
}

/* Красный «рычаг» (дефолт / switch-red) */
.switchradio-light label input[value='DESC'] + span:after,
.switchradio-light label input[value='no'] + span:after,
.switchradio-light label input[value='0'] + span:after,
.switchradio-light label input[value='-1'] + span:after,
.switchradio-light label input[value='gallery'] + span:after {
	position: absolute;
	display: inline-block;
	width: 15px;
	height: 15px;
	background-color: var(--ccc-danger);
	box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
	left: -5px;
	top: -2px;
	transition: left 0.3s ease, background 0.3s ease, box-shadow 0.1s ease;
	content: '';
	z-index: 2;
	border-radius: 30px;
}
.switchradio-light.switch-red label input[value='DESC'] + span:after,
.switchradio-light.switch-red label input[value='no'] + span:after,
.switchradio-light.switch-red label input[value='0'] + span:after,
.switchradio-light.switch-red label input[value='-1'] + span:after,
.switchradio-light.switch-red label input[value='gallery'] + span:after {
	background-color: var(--ccc-danger);
}

/* Синий «рычаг» */
.switchradio-light.switch-blue label input[value='DESC'] + span:after,
.switchradio-light.switch-blue label input[value='no'] + span:after,
.switchradio-light.switch-blue label input[value='0'] + span:after,
.switchradio-light.switch-blue label input[value='-1'] + span:after,
.switchradio-light.switch-blue label input[value='gallery'] + span:after {
	background-color: var(--ccc-action-soft);
}
.switchradio-light.switch-blue.imblue label input[value='DESC'] + span:after,
.switchradio-light.switch-blue.imblue label input[value='no'] + span:after,
.switchradio-light.switch-blue.imblue label input[value='0'] + span:after,
.switchradio-light.switch-blue.imblue label input[value='-1'] + span:after,
.switchradio-light.switch-blue.imblue label input[value='gallery'] + span:after {
	background-color: var(--ccc-action-soft) !important;
}

.switchradio-light.delswitch label input[value='DESC'] + span.checked:after,
.switchradio-light.delswitch label input[value='no'] + span.checked:after,
.switchradio-light.delswitch label input[value='0'] + span.checked:after,
.switchradio-light.delswitch label input[value='-1'] + span.checked:after,
.switchradio-light.delswitch label input[value='gallery'] + span.checked:after {
	background-color: var(--ccc-disabled) !important;
}
.switchradio-light.switch-blue label input[value='DESC'] + span.checked:after,
.switchradio-light.switch-blue label input[value='no'] + span.checked:after,
.switchradio-light.switch-blue label input[value='0'] + span.checked:after,
.switchradio-light.switch-blue label input[value='-1'] + span.checked:after,
.switchradio-light.switch-blue label input[value='gallery'] + span.checked:after {
	background-color: var(--ccc-disabled);
}

.switchradio-light,
.switchradio-light input,
.switchradio-light label input + span,
.switchradio-light label input[value='DESC'] + span:after,
.switchradio-light label input[value='no'] + span:after,
.switchradio-light label input[value='0'] + span:after,
.switchradio-light label input[value='-1'] + span:after,
.switchradio-light label input[value='gallery'] + span:after {
	border-radius: 30px;
}

@keyframes cotcustom-switch-ripple {
	0%,
	100% {
		opacity: 1;
		transform: scale(1);
	}
	50% {
		opacity: 0.2;
		transform: scale(1.5);
	}
}
.switchradio-light label input[value='DESC'] + span.goo:after,
.switchradio-light label input[value='no'] + span.goo:after,
.switchradio-light label input[value='0'] + span.goo:after,
.switchradio-light label input[value='-1'] + span.goo:after,
.switchradio-light label input[value='gallery'] + span.goo:after,
.switchradio-light.switch-blue label input[value='DESC'] + span.goo:after,
.switchradio-light.switch-blue label input[value='no'] + span.goo:after,
.switchradio-light.switch-blue label input[value='0'] + span.goo:after,
.switchradio-light.switch-blue label input[value='-1'] + span.goo:after,
.switchradio-light.switch-blue label input[value='gallery'] + span.goo:after {
	animation: cotcustom-switch-ripple 0.3s;
}

/* ========================================================================
 * Кнопки форм — порт Siena (mdl-button + alpha-button__form_submit_*)
 * Классы: .cotcustom-btn / --accent / --blue / --blue-light / --red / --green
 * Поведение сабмита: .cotcustom-form-submit (+ -draft / -ds)
 * Спиннер в кнопке: ld-ext-right + .ld.ld-ring.ld-spin + класс .running
 * ======================================================================== */

.cotcustom-btn {
	background: transparent;
	border: none;
	border-radius: 2px;
	color: var(--ccc-text);
	position: relative;
	height: 36px;
	margin: 0;
	min-width: 64px;
	padding: 0 16px;
	display: inline-block;
	font-family: inherit;
	font-size: 15px;
	font-weight: 300;
	text-transform: none;
	letter-spacing: 0;
	overflow: hidden;
	will-change: box-shadow;
	transition:
		box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1),
		background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
		color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
		padding 0.3s ease-in;
	outline: none;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
	line-height: 36px;
	vertical-align: middle;
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
}

.cotcustom-btn::-moz-focus-inner {
	border: 0;
}

.cotcustom-btn:hover {
	background-color: color-mix(in srgb, var(--ccc-disabled) 20%, transparent);
}

.cotcustom-btn:focus:not(:active) {
	background-color: rgba(0, 0, 0, 0.12);
}

.cotcustom-btn:active {
	background-color: color-mix(in srgb, var(--ccc-disabled) 40%, transparent);
}

/* Акцент как mdl-button--accent (цвет перекрывают --blue/--red) */
.cotcustom-btn--accent {
	color: var(--ccc-brand);
}

.cotcustom-btn[disabled][disabled],
.cotcustom-btn.disabled,
.cotcustom-btn.cotcustom-btn--disabled {
	cursor: default;
	opacity: 1;
}

/* Цветовые варианты сабмита (Siena alpha-button__form_submit__*) */
.cotcustom-btn--blue {
	background-color: var(--cotcustom-btn-blue) !important;
	color: var(--ccc-surface) !important;
}

.cotcustom-btn--blue:hover,
.cotcustom-btn--blue:active,
.cotcustom-btn--blue:focus {
	color: var(--cotcustom-btn-blue-hover-color) !important;
}

.cotcustom-btn--blue[disabled][disabled],
.cotcustom-btn--blue.disabled {
	background-color: var(--cotcustom-btn-blue-disabled) !important;
	color: var(--ccc-surface) !important;
}

.cotcustom-btn--blue-light {
	background-color: var(--cotcustom-btn-blue-light) !important;
	color: var(--ccc-text) !important;
}

.cotcustom-btn--blue-light:disabled,
.cotcustom-btn--blue-light[disabled],
.cotcustom-btn--blue-light[disabled][disabled],
.cotcustom-btn--blue-light.disabled {
	background-color: var(--cotcustom-btn-blue-light-disabled) !important;
	color: var(--cotcustom-btn-blue-light-disabled-color) !important;
	cursor: default;
	pointer-events: none;
}

.cotcustom-btn--red {
	background-color: var(--cotcustom-btn-red) !important;
	color: var(--ccc-surface) !important;
}

.cotcustom-btn--red[disabled][disabled],
.cotcustom-btn--red.disabled {
	background-color: var(--cotcustom-btn-red-disabled) !important;
	color: var(--ccc-surface) !important;
}

.cotcustom-btn--green {
	background-color: var(--cotcustom-btn-green) !important;
	color: var(--ccc-surface) !important;
}

.cotcustom-btn--green[disabled][disabled],
.cotcustom-btn--green.disabled {
	background-color: var(--cotcustom-btn-green-disabled) !important;
	color: var(--ccc-surface) !important;
}

.cotcustom-btn--gray-light {
	background-color: var(--cotcustom-btn-gray-light) !important;
	color: var(--ccc-text) !important;
}

.cotcustom-btn--gray-light:disabled,
.cotcustom-btn--gray-light[disabled],
.cotcustom-btn--gray-light[disabled][disabled],
.cotcustom-btn--gray-light.disabled {
	background-color: var(--cotcustom-btn-blue-light-disabled) !important;
	color: var(--cotcustom-btn-blue-light-disabled-color) !important;
	cursor: default;
	pointer-events: none;
}

/* Отступы между кнопками действий формы */
.cotcustom-btn + .cotcustom-btn {
	margin-left: 10px;
}

/* —— Loading.io button states (ld-*) — как в Сиене; .running показывает спиннер —— */
.ld-ext-right,
.ld-ext-left,
.ld-ext-bottom,
.ld-ext-top,
.ld-over,
.ld-over-inverse,
.ld-over-full,
.ld-over-full-inverse {
	position: relative;
	transition: all 0.3s;
	transition-timing-function: ease-in;
}

.ld-ext-right > .ld,
.ld-ext-left > .ld,
.ld-ext-bottom > .ld,
.ld-ext-top > .ld,
.ld-over > .ld,
.ld-over-inverse > .ld,
.ld-over-full > .ld,
.ld-over-full-inverse > .ld {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 1em;
	height: 1em;
	margin: -0.5em;
	opacity: 0;
	z-index: -1;
	transition: all 0.3s;
	transition-timing-function: ease-in;
}

.ld-ext-right.running > .ld,
.ld-ext-left.running > .ld,
.ld-ext-bottom.running > .ld,
.ld-ext-top.running > .ld,
.ld-over.running > .ld,
.ld-over-inverse.running > .ld,
.ld-over-full.running > .ld,
.ld-over-full-inverse.running > .ld {
	opacity: 1;
	z-index: auto;
	visibility: visible;
}

.ld-ext-right.running {
	padding-right: 2.5em !important;
}

.ld-ext-right > .ld {
	top: 50%;
	left: auto;
	right: 1.25em;
}

.ld-ext-left.running {
	padding-left: 2.5em !important;
}

.ld-ext-left > .ld {
	top: 50%;
	right: auto;
	left: 1.25em;
}

.ld {
	transform-origin: 50% 50%;
	transform-box: fill-box;
}

@keyframes ld-spin {
	0% {
		animation-timing-function: cubic-bezier(0.5856, 0.0703, 0.4143, 0.9297);
		transform: rotate(0);
	}
	100% {
		transform: rotate(360deg);
	}
}

.ld.ld-spin {
	animation: ld-spin 1s infinite linear;
}

.ld-ring:after {
	content: ' ';
	display: block;
	width: 2em;
	height: 2em;
	box-sizing: border-box;
	transform-origin: 0 0;
	transform: translateZ(0) scale(0.5);
	backface-visibility: hidden;
	border-radius: 50%;
	border: 0.3em solid currentColor;
	border-left-color: transparent;
}

/*
 * Alex300 Files вставляет .file-upload-preloader в строку — не используем.
 * Спиннер всегда .cotcustom-process (cotcustom-fileupload-lock.js).
 */
.file-upload-preloader {
	display: none !important;
	visibility: hidden !important;
	width: 0 !important;
	height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	pointer-events: none !important;
}

/* ========================================================================
 * Глобальный индикатор процесса (порт Siena .alpha_process / .alpha-process__run)
 * Разметка в теме: .cotcustom-process > .cotcustom-process__run.js-cotcustom-fileupload
 * ======================================================================== */

.cotcustom-process {
	display: none;
	visibility: hidden;
}

.cotcustom-process__run {
	border: 5px solid color-mix(in srgb, var(--ccc-text-muted) 40%, transparent);
	border-top: 5px solid rgba(255, 255, 255, 0.6);
	border-radius: 100%;
	height: 35px;
	width: 35px;
	-webkit-animation: cotcustom-task-processing 0.8s infinite linear;
	animation: cotcustom-task-processing 0.8s infinite linear;
	background: transparent;
	position: fixed;
	left: var(--cotcustom-process-left);
	top: var(--cotcustom-process-top);
	z-index: 1706;
	margin: 40px auto;
	visibility: hidden;
	display: none;
	pointer-events: none;
	box-sizing: border-box;
}

@-webkit-keyframes cotcustom-task-processing {
	from {
		-webkit-transform: rotate(0deg);
		transform: rotate(0deg);
	}
	to {
		-webkit-transform: rotate(359deg);
		transform: rotate(359deg);
	}
}

@keyframes cotcustom-task-processing {
	from {
		-webkit-transform: rotate(0deg);
		transform: rotate(0deg);
	}
	to {
		-webkit-transform: rotate(359deg);
		transform: rotate(359deg);
	}
}

/* —— Клиентская валидация форм (cotcustom-form-validate.js) —— */
/* Акцент ошибки = --ccc-danger */
.cotcustom-form input.cotcustom-validate-error,
.cotcustom-form select.cotcustom-validate-error {
	background-image: linear-gradient(var(--ccc-danger), var(--ccc-danger)), linear-gradient(var(--ccc-danger), var(--ccc-danger)) !important;
	background-size: 100% 2px, 100% 1px !important;
	background-repeat: no-repeat !important;
	background-position: center bottom, center calc(100% - 1px) !important;
}

/*
 * Textarea — aliceblue-блок, не underline: градиент заливал фон.
 * Только лёгкая обводка / без перекраски текста.
 */
.cotcustom-form textarea.cotcustom-validate-error:not(.editor):not(.medieditor):not(.minieditor) {
	background-image: none !important;
	background-color: var(--cotcustom-textarea-bg) !important;
	color: var(--cotcustom-textarea-color) !important;
	box-shadow: inset 0 0 0 1px var(--ccc-danger) !important;
}

.cotcustom-validate-msg {
	margin: 0.35em 0 0;
	font-size: 0.85rem;
	line-height: 1.35;
	color: var(--ccc-danger);
}

/* —— Notify.js (site/js/notify.js) — уголок + bootstrap (палитра Сиены) ——
 * Классы: base error success warning info blue lightblue warn white white_nobr orange lazure
 * (без green — в Сиене на скрине его нет; success = зелёный)
 */
.notifyjs-wrapper {
	z-index: 2;
}

.notifyjs-corner {
	position: fixed;
	margin: 10px;
	z-index: 2999 !important;
}

.notifyjs-corner .notifyjs-wrapper,
.notifyjs-corner .notifyjs-container {
	width: auto;
	-webkit-user-select: none;
	user-select: none;
}

/* Notify palette → --ccc-* (имена классов JS без изменений) */
.notifyjs-bootstrap-base {
	white-space: normal !important;
	min-width: 200px;
	max-width: 320px;
	width: 240px;
	margin: 0 auto;
	text-align: center;
	color: var(--ccc-action-contrast) !important;
	background-color: var(--ccc-text-muted) !important;
	border-color: var(--ccc-text-muted) !important;
}

.notifyjs-bootstrap-error {
	color: var(--ccc-action-contrast) !important;
	background-color: var(--ccc-danger) !important;
	border-color: var(--ccc-danger-border) !important;
	font-weight: 500 !important;
}

.notifyjs-bootstrap-success {
	color: var(--ccc-action-contrast) !important;
	background-color: var(--ccc-success) !important;
	border-color: var(--ccc-success) !important;
}

.notifyjs-bootstrap-warning {
	color: var(--ccc-action-contrast) !important;
	background-color: var(--ccc-danger) !important;
	border-color: var(--ccc-danger) !important;
}

.notifyjs-bootstrap-warn {
	color: var(--ccc-text) !important;
	background-color: var(--ccc-warning) !important;
	border-color: var(--ccc-warning) !important;
}

.notifyjs-bootstrap-info,
.notifyjs-bootstrap-blue,
.notifyjs-bootstrap-lightblue {
	color: var(--ccc-action-contrast) !important;
	background-color: var(--ccc-action) !important;
	border-color: var(--ccc-action) !important;
}

.notifyjs-bootstrap-lazure {
	color: var(--ccc-action-contrast) !important;
	background-color: var(--ccc-action-soft) !important;
	border-color: var(--ccc-action-soft) !important;
}

.notifyjs-bootstrap-orange {
	color: var(--ccc-text) !important;
	background-color: var(--ccc-warning) !important;
	border-color: var(--ccc-warning) !important;
}

.notifyjs-bootstrap-white,
.notifyjs-bootstrap-white_nobr {
	color: var(--ccc-text) !important;
	background-color: var(--ccc-surface) !important;
	border-color: var(--ccc-border) !important;
}
