/**
 * CCC — глобальные стили для всех тем (не префикс темы).
 * Подключение: плагин cotcustom (hooks=rc) → Resources::addFile.
 * Тема может переопределить переменные / селекторы в своём CSS.
 *
 * .cotcustom-unselectable / .files-unselectable — UI chrome, не контент.
 * .cotcustom-form + инпуты — вид «underline» как Siena .new-form (без Bootstrap .form-control).
 */

:root {
	--cotcustom-input-focus: #1165a8;
	--cotcustom-input-line: #d2d2d2;
	--cotcustom-input-bg: transparent;
}

/* —— Unselectable: всё, что интерфейс (подписи, кнопки, ID), не текст контента —— */
.cotcustom-unselectable,
.files-unselectable {
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

/* Подписи колонок в формах 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;
}

/* —— Инпуты: логика 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-form textarea:not(.editor):not(.medieditor):not(.minieditor),
.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-form textarea:not(.editor):not(.medieditor):not(.minieditor):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;
}

/*
 * Select2 — вид Сиены (beta-elements + essentials):
 * базовый скин (46px, #dee5ed, #626262) — в lib/select2/css/select2*.css;
 * здесь: ширина в формах CCC + focus/open.
 */
.cotcustom-form .select2-container {
	width: 100% !important;
	max-width: 100%;
}

.cotcustom-form .select2-container--default .select2-selection--single,
.cotcustom-form .select2-container--default .select2-selection--multiple {
	/* на случай если тема перебивает — не underline cotcustom */
	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: #b8c4d4;
	outline: 0;
}

.select2-dropdown {
	border: 1px solid #dee5ed;
	border-radius: 4px;
	z-index: 10050;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
	background-color: #3b99fc;
	color: #fff;
}
