/*
 * Открытая часть на Bootstrap 5.3 (vendor/bootstrap5): оформление элементов под вид сайта.
 * Подключается сразу после bootstrap.min.css, до стилей сайта (vkomap/styles, css/site*.css).
 * 1. Размеры, отступы и цвета элементов Bootstrap 5 по образцу Bootstrap 3.4.1 (MIT).
 * 2. Классы разметки сайта, которых нет в Bootstrap 5: btn-default, btn-xs, panel, checkbox, close, caret, input-group-btn.
 */

/* --- Основа страницы */
:root {
    --bs-font-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif;
    scroll-behavior: auto;
}

a {
    text-decoration: none;
}

    a:hover,
    a:focus {
        color: #23527c;
        text-decoration: underline;
    }

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: inherit;
    font-weight: 500;
    line-height: 1.1;
}

h1, .h1, h2, .h2, h3, .h3 {
    margin-top: 20px;
    margin-bottom: 10px;
}

h4, .h4, h5, .h5, h6, .h6 {
    margin-top: 10px;
    margin-bottom: 10px;
}

h1, .h1 { font-size: 36px; }
h2, .h2 { font-size: 30px; }
h3, .h3 { font-size: 24px; }
h4, .h4 { font-size: 18px; }
h5, .h5 { font-size: 14px; }
h6, .h6 { font-size: 12px; }

p {
    margin: 0 0 10px;
}

ul, ol {
    margin-top: 0;
    margin-bottom: 10px;
    padding-left: 40px;
}

    ul ul, ul ol, ol ul, ol ol {
        margin-bottom: 0;
    }

small, .small {
    font-size: 85%;
}

label {
    max-width: 100%;
    margin-bottom: 5px;
    font-weight: 700;
}

input[type="radio"],
input[type="checkbox"] {
    margin: 4px 0 0;
    line-height: normal;
}

th {
    text-align: left;
}

/* сетка: промежуток между колонками 30px */
.row:not(.g-0):not(.gx-0) {
    --bs-gutter-x: 30px;
}

/* --- Кнопки */
.btn {
    --bs-btn-padding-x: 12px;
    --bs-btn-padding-y: 6px;
    --bs-btn-font-size: 14px;
    --bs-btn-line-height: 1.42857143;
    --bs-btn-border-radius: 4px;
    transition: none;
}

    .btn:active,
    .btn.active {
        box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
    }

.btn-default {
    --bs-btn-color: #333;
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #ccc;
    --bs-btn-hover-color: #333;
    --bs-btn-hover-bg: #e6e6e6;
    --bs-btn-hover-border-color: #adadad;
    --bs-btn-focus-shadow-rgb: 204, 204, 204;
    --bs-btn-active-color: #333;
    --bs-btn-active-bg: #e6e6e6;
    --bs-btn-active-border-color: #adadad;
    --bs-btn-disabled-color: #333;
    --bs-btn-disabled-bg: #fff;
    --bs-btn-disabled-border-color: #ccc;
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #337ab7;
    --bs-btn-border-color: #2e6da4;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #286090;
    --bs-btn-hover-border-color: #204d74;
    --bs-btn-focus-shadow-rgb: 51, 122, 183;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #286090;
    --bs-btn-active-border-color: #204d74;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #337ab7;
    --bs-btn-disabled-border-color: #2e6da4;
}

.btn-success {
    --bs-btn-color: #fff;
    --bs-btn-bg: #5cb85c;
    --bs-btn-border-color: #4cae4c;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #449d44;
    --bs-btn-hover-border-color: #398439;
    --bs-btn-focus-shadow-rgb: 92, 184, 92;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #449d44;
    --bs-btn-active-border-color: #398439;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #5cb85c;
    --bs-btn-disabled-border-color: #4cae4c;
}

.btn-info {
    --bs-btn-color: #fff;
    --bs-btn-bg: #5bc0de;
    --bs-btn-border-color: #46b8da;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #31b0d5;
    --bs-btn-hover-border-color: #269abc;
    --bs-btn-focus-shadow-rgb: 91, 192, 222;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #31b0d5;
    --bs-btn-active-border-color: #269abc;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #5bc0de;
    --bs-btn-disabled-border-color: #46b8da;
}

.btn-sm {
    --bs-btn-padding-x: 10px;
    --bs-btn-padding-y: 5px;
    --bs-btn-font-size: 12px;
    --bs-btn-line-height: 1.5;
    --bs-btn-border-radius: 3px;
}

.btn-xs {
    --bs-btn-padding-x: 5px;
    --bs-btn-padding-y: 1px;
    --bs-btn-font-size: 12px;
    --bs-btn-line-height: 1.5;
    --bs-btn-border-radius: 3px;
}

/* --- Поля ввода */
.form-control {
    height: 34px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.42857143;
    color: #555;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}

    .form-control:focus {
        color: #555;
        border-color: #66afe9;
        outline: 0;
        box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
    }

    .form-control::placeholder {
        color: #999;
    }

textarea.form-control {
    height: auto;
}

/* группа «поле и кнопки»: кнопки в обёртке .input-group-btn */
/* ширина по наименьшему содержимому, как у ячейки таблицы с width: 1% в Bootstrap 3 */
.input-group-btn {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: min-content;
    font-size: 0;
    white-space: nowrap;
}

    .input-group-btn > .btn {
        position: relative;
    }

        .input-group-btn > .btn + .btn {
            margin-left: -1px;
        }

        .input-group-btn > .btn:hover,
        .input-group-btn > .btn:focus,
        .input-group-btn > .btn:active {
            z-index: 2;
        }

    .input-group-btn:first-child > .btn,
    .input-group-btn:first-child > .dropdown-toggle,
    .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }

    .input-group-btn:last-child > .btn,
    .input-group-btn:first-child > .btn:not(:first-child) {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }

/* --- Флажки */
.checkbox {
    position: relative;
    display: block;
    margin-top: 10px;
    margin-bottom: 10px;
}

    .checkbox label {
        min-height: 20px;
        padding-left: 20px;
        margin-bottom: 0;
        font-weight: 400;
        cursor: pointer;
    }

    .checkbox input[type="checkbox"] {
        position: absolute;
        margin-left: -20px;
    }

    .checkbox + .checkbox {
        margin-top: -5px;
    }

input[type="checkbox"][disabled],
.checkbox.disabled label {
    cursor: not-allowed;
}

/* --- Выпадающие меню */
.dropdown-menu {
    --bs-dropdown-min-width: 160px;
    --bs-dropdown-padding-y: 5px;
    --bs-dropdown-spacer: 2px;
    --bs-dropdown-font-size: 14px;
    --bs-dropdown-border-color: rgba(0, 0, 0, .15);
    --bs-dropdown-border-radius: 4px;
    --bs-dropdown-link-color: #333;
    --bs-dropdown-link-hover-color: #262626;
    --bs-dropdown-link-hover-bg: #f5f5f5;
    --bs-dropdown-link-active-color: #fff;
    --bs-dropdown-link-active-bg: #337ab7;
    --bs-dropdown-item-padding-x: 20px;
    --bs-dropdown-item-padding-y: 3px;
    color: inherit;
    box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
}

    .dropdown-menu > li > a {
        display: block;
        padding: 3px 20px;
        clear: both;
        font-weight: 400;
        line-height: 1.42857143;
        color: #333;
        white-space: nowrap;
    }

        .dropdown-menu > li > a:hover,
        .dropdown-menu > li > a:focus {
            color: #262626;
            text-decoration: none;
            background-color: #f5f5f5;
        }

/* стрелка у кнопки меню только там, где в разметке есть .caret */
.dropdown-toggle::after {
    display: none;
}

.caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 2px;
    vertical-align: middle;
    border-top: 4px dashed;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

/* --- Списки */
.list-group {
    --bs-list-group-border-color: #ddd;
    --bs-list-group-border-radius: 4px;
    --bs-list-group-item-padding-x: 15px;
    --bs-list-group-item-padding-y: 10px;
    --bs-list-group-active-bg: #337ab7;
    --bs-list-group-active-border-color: #337ab7;
    display: block;
    margin-bottom: 20px;
}

/* соседние пункты перекрываются рамкой (margin -1px), а не убирают верхнюю рамку, как в Bootstrap 5 */
.list-group-item {
    margin-bottom: -1px;
    color: inherit;
    background-color: #fff;
}

    .list-group-item:last-child {
        margin-bottom: 0;
    }

    .list-group-item + .list-group-item {
        border-top-width: var(--bs-list-group-border-width);
    }

button.list-group-item {
    width: 100%;
    text-align: left;
}

a.list-group-item,
button.list-group-item {
    color: #555;
}

    a.list-group-item:hover,
    a.list-group-item:focus,
    button.list-group-item:hover,
    button.list-group-item:focus {
        color: #555;
        text-decoration: none;
        background-color: #f5f5f5;
    }

/* --- Панели (окна карты) */
.panel {
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid transparent;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
}

.panel-body {
    padding: 15px;
}

    .panel-body::before,
    .panel-body::after {
        display: table;
        content: " ";
    }

    .panel-body::after {
        clear: both;
    }

.panel-heading {
    padding: 10px 15px;
    border-bottom: 1px solid transparent;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

.panel > .list-group {
    margin-bottom: 0;
}

    .panel > .list-group .list-group-item {
        border-width: 1px 0;
        border-radius: 0;
    }

    .panel > .list-group:first-child .list-group-item:first-child {
        border-top: 0;
        border-top-left-radius: 3px;
        border-top-right-radius: 3px;
    }

    .panel > .list-group:last-child .list-group-item:last-child {
        border-bottom: 0;
        border-bottom-right-radius: 3px;
        border-bottom-left-radius: 3px;
    }

.panel-heading + .list-group .list-group-item:first-child {
    border-top-width: 0;
}

.panel-default {
    border-color: #ddd;
}

    .panel-default > .panel-heading {
        color: #333;
        background-color: #f5f5f5;
        border-color: #ddd;
    }

/* --- Кнопка закрытия (×) */
.close {
    float: right;
    font-size: 21px;
    font-weight: bold;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: .2;
}

    .close:hover,
    .close:focus {
        color: #000;
        text-decoration: none;
        cursor: pointer;
        opacity: .5;
    }

button.close {
    padding: 0;
    cursor: pointer;
    background: transparent;
    border: 0;
    appearance: none;
}

/* --- Окна */
.modal {
    --bs-modal-zindex: 1050;
    --bs-modal-width: 600px;
    --bs-modal-margin: 10px;
    --bs-modal-padding: 15px;
    --bs-modal-header-padding: 15px;
    --bs-modal-border-color: rgba(0, 0, 0, .2);
    --bs-modal-border-radius: 6px;
    --bs-modal-inner-border-radius: 5px;
    --bs-modal-header-border-color: #e5e5e5;
    --bs-modal-footer-border-color: #e5e5e5;
    --bs-modal-title-line-height: 1.42857143;
}

.modal-backdrop {
    --bs-backdrop-zindex: 1040;
}

.modal-content {
    color: inherit;
    box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
}

.modal-header {
    display: block;
}

    .modal-header .close {
        margin-top: -2px;
    }

.modal-title {
    margin: 0;
}

.modal-footer {
    display: block;
    padding: 15px;
    text-align: right;
}

    .modal-footer > * {
        margin: 0;
    }

    .modal-footer .btn + .btn {
        margin-left: 5px;
    }

@media (min-width: 576px) and (max-width: 767.98px) {
    .modal-dialog {
        max-width: none;
        margin: var(--bs-modal-margin);
    }
}

@media (min-width: 768px) {
    .modal {
        --bs-modal-margin: 30px;
    }

    .modal-content {
        box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
    }
}

/* --- Подсказки */
.tooltip {
    --bs-tooltip-font-size: 12px;
    --bs-tooltip-padding-x: 8px;
    --bs-tooltip-padding-y: 3px;
    --bs-tooltip-border-radius: 4px;
    --bs-tooltip-arrow-width: 10px;
    --bs-tooltip-arrow-height: 5px;
    line-height: 1.42857143;
}
