/**
 * Файл содержит стили для элементов, относящихся к формам.
 */

/***********************************************************************************************************************
 * Переменные.
 */
:root {

	/* Общие параметры для полей ввода, селектов и кнопок */
	--bn-height_l: 48px;
	--bn-height_m: 40px;
	--bn-height_s: 32px;

	--bn-font-size_m: 14px;
	--bn-font-size_l: 16px;

	--bn-input-padding-l: 16px;
	--bn-input-padding-m: 12px;
	--bn-input-padding-s: 8px;
	--bn-textarea-padding: 4px;

	--bn-input-radius: 8px;

	/* Списки выбора */
	--bn-select-height-l: var(--bn-height_l);
	--bn-select-height-m: var(--bn-height_m);
	--bn-select-height-s: var(--bn-height_s);

	/* Кнопки */
	--bn-button-radius: 8px;

	/* Чекбоксы и радиокнопки */
	--bn-checkbox-size: 16px;
	--bn-checkbox-radius: 4px;
}

/***********************************************************************************************************************
 * Общее для всех элементов.
 */

/**[class^='bn-']:focus-visible {
	outline-offset: 1px;
	outline: rgb(var(--color-accent)) solid 2px;
}*/

/***********************************************************************************************************************
 * Поля ввода textarea.
 */

.bn-textarea {
	background-color: rgb(var(var(--bn-color_white)));

	border: rgb(var(--bn-color_grey)) 1px solid;
	border-radius: var(--bn-input-radius);

	box-sizing: border-box;
	color: rgb(var(--bn-color_black));
	cursor: text;
	display: inline-block;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 15px;
	margin: 0;
	padding: var(--bn-textarea-padding);
	position: relative;

	transition-duration: var(--bn-animation);
	transition-property: border-color, box-shadow, background-color;
}

.bn-textarea:hover {
	border-color: rgb(var(--bn-color_dark-grey));
}

.bn-textarea_success {
	border-color: rgba(var(--bn-color_green), 0.6);
	/*box-shadow: 0 0 3px 0 rgba(var(--bn-color_green), 0.4);*/
}

.bn-textarea_success:hover {
	border-color: rgba(var(--bn-color_green), 1);
}

.bn-textarea_warning {
	border-color: rgba(var(--bn-color_orange), 0.6);
	/*box-shadow: 0 0 3px 0 rgba(var(--bn-color_orange), 0.4);*/
}

.bn-textarea_warning:hover {
	border-color: rgba(var(--bn-color_orange), 1);
}

.bn-textarea_error {
	border-color: rgba(var(--bn-color_red), 0.6);
	/*box-shadow: 0 0 3px 0 rgba(var(--bn-color_red), 0.4);*/
}

.bn-textarea_error:hover {
	border-color: rgba(var(--bn-color_red), 1);
}

.bn-textarea:focus {
	border-color: rgb(var(--color-accent));
	outline: none;
	/*box-shadow: 0 0 3px 0 rgba(var(--color-accent), 0.4);*/
}

.bn-textarea:disabled {
	border-color: rgb(var(--bn-color_light-grey));
	/*background-color: rgb(var(--bn-color_light-grey));*/
	box-shadow: inset 0 0 0 160px rgba(var(--bn-color_light-grey), 0.7);
	/*box-shadow: unset;*/
	cursor: not-allowed;
}

/***********************************************************************************************************************
 * Списки выбора.
 */

/*.bn-select {
	background-color: rgb(var(--bn-color_light-grey2));
	border: none;
	border-radius: var(--bn-input-radius);
	box-sizing: border-box;
	color: rgb(var(--bn-color_black));
	cursor: pointer;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	font-weight: bold;
	height: var(--bn-height_m);
	line-height: var(--bn-height_m);
	padding: var(--bn-input-padding-m);
	position: relative;
	!*top: -1px;*!

	transition-duration: var(--bn-animation);
	transition-property: border-color, box-shadow, background-color;

	vertical-align: baseline;
}

.bn-select:hover {
	!*border-color: rgb(var(--color-dark-grey));*!
	!*background-color: rgb(var(--bn-color_light-grey));*!
}

.bn-select:focus {
	!*border-color: rgb(var(--color-accent));*!
	!*box-shadow: 0 0 3px 0 rgba(var(--color-accent), 0.4);*!
}

.bn-select:disabled {
	!*border-color: rgba(var(--color-black), 0.3);*!
	box-shadow: inset 0 0 0 160px rgba(var(--bn-color_light-grey), 0.7);
	cursor: not-allowed;
}*/

/***********************************************************************************************************************
 * Кнопки.
 */

.bn-button {
	--bn-button-height: var(--bn-height_m);

	background-color: rgb(var(--bn-button-color));
	border: none;
	border-radius: var(--bn-button-radius);
	box-sizing: border-box;
	color: rgb(var(--bn-color_barely-grey));
	cursor: pointer;
	display: inline-block;
	font-size: var(--bn-font-size_l);
	height: var(--bn-button-height);
	line-height: var(--bn-button-height);
	margin: 0;
	padding: 0 var(--bn-input-padding-m);
	position: relative;
	text-align: center;
	text-decoration: none !important;

	transition-duration: var(--bn-animation);
	transition-property: border-color, box-shadow, background-color, padding, height, color;

	-moz-user-select: none;
	-ms-user-select: none;
	-webkit-user-select: none;
	user-select: none;

	vertical-align: middle;
	white-space: nowrap;
}

.bn-button_size_l {
	--bn-button-height: var(--bn-height_l);

	padding-left: var(--bn-input-padding-l);
	padding-right: var(--bn-input-padding-l);
}

.bn-button_size_s {
	--bn-button-height: var(--bn-height_s);

	padding-left: var(--bn-input-padding-s);
	padding-right: var(--bn-input-padding-s);
}

.bn-button,
.bn-button_accent,
.bn-button_color_accent {
	--bn-button-color: var(--color-accent);
}

.bn-button_color_red {
	--bn-button-color: var(--bn-color_red);
}

.bn-button_color_green {
	--bn-button-color: var(--bn-color_green);
}

.bn-button_color_white {
	--bn-button-color: var(--bn-color_white);
	color: rgb(var(--bn-color_black));
}

.bn-button_color_almost-black {
	--bn-button-color: var(--bn-color_almoust-black);
	color: rgb(var(--bn-color_white));
}

.bn-button_outlined {
	background-color: var(--bn-color_white);
	border: rgb(var(--bn-button-color)) 2px solid;
	color: rgb(var(--bn-color_black));
	line-height: calc(var(--bn-button-height) - 4px);
}

.bn-button:hover {
	box-shadow: inset 0 0 0 160px rgba(255, 255, 255, 0.1);
}

.bn-button_outlined:hover {
	box-shadow: inset 0 0 0 160px rgba(var(--bn-button-color), 0.1);
}

.bn-button:active {
	box-shadow: inset 0 0 0 160px rgba(0, 0, 0, 0.1);
}

.bn-button_outlined:active {
	box-shadow: inset 0 0 0 160px rgba(var(--bn-button-color), 0.2);
}

.bn-button:disabled {
	/*box-shadow: inset 0 0 0 160px rgba(221, 221, 221, 0.7);*/
	box-shadow: inset 0 0 0 160px rgba(var(--bn-color_light-grey), 0.7);
	cursor: not-allowed;
	/*padding-bottom: 15px;*/
	/*padding-top: 15px;*/
}

.bn-button_outlined:disabled {
	border-color: rgba(var(--bn-button-color), 0.3);
}

.bn-button_width_s {
	padding-left: var(--bn-input-padding-s);
	padding-right: var(--bn-input-padding-s);
}

.bn-button_width_l {
	padding-left: var(--bn-input-padding-l);
	padding-right: var(--bn-input-padding-l);
}

.bn-button_progress,
.bn-button_loading {
	animation: button-progress-indefinite-anim 1000s infinite linear 0s;
	background-image: url(/static/ui/bn/background/progress-bg.png);
}

.bn-button_progress:disabled,
.bn-button_loading:disabled {
	box-shadow: inset 0 0 0 160px rgba(var(--bn-color_light-grey), 0.7);
}

.bn-button__icon {
	background-position: center;
	background-repeat: no-repeat;
	background-size: contain;
	display: inline-block;
	height: 0;
	padding: 8px;
	position: relative;
	top: -2px;
	vertical-align: middle;
	width: 0;
}

@keyframes button-progress-indefinite-anim {
	0% {
		background-position: 0 0;
	}
	100% {
		background-position: -20000px 0;
	}
}

/***********************************************************************************************************************
 * Флажки и радиокнопки (переключатели).
 */

.bn-checkbox,
.bn-radio {
	appearance: none; /* Hide default styling */
	-webkit-appearance: none; /* For Webkit browsers */
	/*position: absolute; !* Take it out of flow *!*/
	/*opacity: 0;*/ /* Make it invisible */
	height: var(--bn-checkbox-size);
	line-height: var(--bn-checkbox-size);
	position: relative;
	top: -2px;
	width: var(--bn-checkbox-size);
}

.bn-checkbox::after,
.bn-radio::after {
	background-position: center;
	background-repeat: no-repeat;
	background-color: rgb(var(--bn-color_white));
	background-size: calc(var(--bn-checkbox-size) - 6px);
	border: rgb(var(--bn-color_grey)) 1px solid;
	border-radius: var(--bn-checkbox-radius);
	box-sizing: border-box;
	content: "";
	cursor: pointer;
	display: inline-block;
	height: inherit;
	transition-duration: var(--bn-animation);
	transition-property: border-color, box-shadow;
	vertical-align: middle;
	width: inherit;
}

.bn-radio::after {
	border-radius: 50%;
	background-size: calc(var(--bn-checkbox-size) / 2);
}

.bn-checkbox:checked::after,
.bn-radio:checked::after {
	border-color: rgb(var(--color-accent));
	background-color: rgb(var(--color-accent));
	background-image: url("/static/ui/bn/icon/check-mark-white.svg");
}

.bn-radio:checked::after {
	background-image: url("/static/ui/bn/icon/circle-white.svg");
}

.bn-checkbox:not(:disabled):checked:hover::after,
.bn-radio:not(:disabled):checked:hover::after {
	box-shadow: inset 0 0 0 160px rgba(var(--bn-color_light-grey), 0.3);
}

.bn-checkbox:not(:disabled):not(:checked):hover::after,
.bn-radio:not(:disabled):not(:checked):hover::after {
	border-color: rgb(var(--bn-color_dark-grey));
}

.bn-checkbox:focus::after,
.bn-radio:focus::after {
	border-color: rgb(var(--color-accent));
	/*box-shadow: 0 0 3px 0 rgba(var(--color-accent), 0.4);*/
}

.bn-checkbox:disabled::after,
.bn-radio:disabled::after {
	border-color: rgb(var(--bn-color_light-grey)) !important;
	background-color: rgb(var(--bn-color_light-grey));
	cursor: not-allowed;
}

.bn-checkbox:disabled + .bn-label,
.bn-label:has(.bn-checkbox:disabled),
.bn-radio:disabled + .bn-label,
.bn-label:has(.bn-radio:disabled) {
	cursor: not-allowed;
}

.bn-checkbox:checked:disabled::after {
	background-image: url("/static/ui/bn/icon/check-mark-grey.svg");
}

.bn-radio:checked:disabled::after {
	background-image: url("/static/ui/bn/icon/circle-grey.svg");
}

.bn-label {
	cursor: pointer;
	display: inline-block;
	/*white-space: nowrap;*/
}

/* Убирает пробел между чекбоксом и подписью */
.bn-checkbox + .bn-label,
.bn-radio + .bn-label {
	margin-left: -4px;
	padding-left: 4px;
}

/* Предзагрузка изображений для чекбоксов и радиокнопок */
body::after {
	content: url(/static/ui/bn/icon/check-mark-white.svg) url(/static/ui/bn/icon/check-mark-grey.svg) url(/static/ui/bn/icon/circle-white.svg) url(/static/ui/bn/icon/circle-grey.svg);
	height: 0;
	overflow: hidden;
	position: absolute;
	width: 0;
	z-index: -1;
}

/***********************************************************************************************************************