/* ============================================================
   apply.krasgmu.ru — фирменная тема КрасГМУ
   Подключается ПОСЛЕ остальных стилей и приводит кабинет
   к визуальному стилю abiturient.krasgmu.ru / foreign.krasgmu.ru
   ============================================================ */

:root {
    --primary-blue: #040D2E;
    --secondary-blue: #011C73;
    --light-blue: #051246;
    --accent-blue: #052091;
    --primary-red: #440821;
    --secondary-red: #8A082E;
    --accent-red: #6A0A2F;
    --bright-red: #AB052B;
    --light-grey: #EDEBEC;
    --medium-grey: #9C9C9A;
    --dark-grey: #C6C4C5;
    --brand-red: #EB002D;
    --brand-blue: #001B72;
    --white: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --background-light: #f8fafc;
    --border-light: #e9ecef;
    --grad-red: linear-gradient(90deg, #8A082E 0%, #EB002D 100%);
    --grad-red-hover: linear-gradient(90deg, #6A0A2F 0%, #C40027 100%);
}

/* ------------------------------------------------------------
   Шрифт: везде Stem. Исключения — только иконочные шрифты
   (Font Awesome, DHX, Summernote), иначе иконки превратятся
   в квадраты.
   ------------------------------------------------------------ */
html, body,
body :not(i):not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not([class*="fa-"]):not([class^="dxi"]):not([class*=" dxi"]):not([class*="note-icon"]) {
    font-family: 'Stem', Arial, sans-serif !important;
}

/* Фоновая фирменная графика с молочной подложкой */
body {
    background-color: var(--background-light) !important;
    background-image:
        linear-gradient(rgba(248, 250, 252, 0.93), rgba(248, 250, 252, 0.93)),
        url('/img/Graphika_RGB_grey.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
}

main {
    min-height: 100px;
    max-width: 1920px;
    height: 100%;
    width: 100%;
}

/* ------------------------------------------------------------
   Шапка: прозрачная на десктопе, с фоном на мобильных
   ------------------------------------------------------------ */
header {
    background-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}

@media (max-width: 1090px) {
    header {
        background: rgb(248, 248, 248) !important;
        background-color: rgb(248, 248, 248) !important;
        box-shadow: 0 2px 14px rgba(4, 13, 46, 0.1) !important;
    }
}

@media screen and (max-width: 760px) {
    nav {
        width: 90%;
        max-width: 100%;
    }
}

/* ------------------------------------------------------------
   Логотип: иконка + «ПОРТАЛ АБИТУРИЕНТА / КРАСГМУ»
   (красный градиент и на иконке — внутри SVG, и на тексте)
   ------------------------------------------------------------ */
.apply-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.apply-logo__icon {
    height: 50px;
    width: 50px;
    flex-shrink: 0;
}

.apply-logo__divider {
    width: 2px;
    height: 46px;
    background: var(--secondary-red);
    opacity: 0.9;
    flex-shrink: 0;
}

.apply-logo__name {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.apply-logo__line {
    display: block;
    font-weight: 500;
    font-size: 20px;
    line-height: 1.25;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--bright-red);
    background: linear-gradient(90deg, #8A082E 0%, #EB002D 85%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 600px) {
    .apply-logo__icon { height: 42px; width: 42px; }
    .apply-logo__divider { height: 36px; }
    .apply-logo__line { font-size: 16px; }
}

/* ------------------------------------------------------------
   Скроллбар: тонкий и ненавязчивый
   ------------------------------------------------------------ */
body::-webkit-scrollbar {
    width: 8px;
}

body::-webkit-scrollbar-track {
    background-color: transparent;
    box-shadow: none;
    -webkit-box-shadow: none;
}

body::-webkit-scrollbar-thumb {
    background: var(--dark-grey);
    border-radius: 8px;
}

body::-webkit-scrollbar-thumb:hover {
    background: var(--bright-red);
}

/* ------------------------------------------------------------
   Кнопки: единый стиль на всех страницах — красный градиент,
   белый текст, одинаковое скругление и состояние disabled
   ------------------------------------------------------------ */
.all_button {
    background: var(--grad-red) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 14px rgba(171, 5, 43, 0.25) !important;
    -webkit-box-shadow: 0 4px 14px rgba(171, 5, 43, 0.25) !important;
    transition: opacity 0.25s ease, box-shadow 0.25s ease;
}

.all_button:hover:not(:disabled):not([disabled]) {
    background: var(--grad-red-hover) !important;
}

.all_button:disabled,
.all_button[disabled] {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
}

/* Ссылки-акценты */
a.link_text_red_pr {
    color: var(--bright-red);
}

a.link_text_red_pr:hover {
    color: var(--brand-red);
}

/* ------------------------------------------------------------
   Единая типографика на всех страницах
   ------------------------------------------------------------ */
.all_button,
.login-submit,
.login-submit-blue,
.login-sso,
.tab-button {
    font-size: 16px !important;
    font-weight: 500 !important;
}

/* Кнопка «Назад» над формами */
.back_button {
    color: #575757 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    margin-top: 30px;
    margin-bottom: 10px;
    text-decoration: none;
    width: 80px;
}

.dashboard_content_title,
.auth_label {
    font-size: 28px !important;
    font-weight: 500 !important;
}

/* Info-блоки (auth_info): одинаковые на всех страницах,
   !important перебивает разнобой inline-стилей в шаблонах */
.auth_info {
    background-color: #ECECFF !important;
    border: 1px solid #DCDCFF !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
    display: flex !important;
    align-items: flex-start;
    line-height: 1.5;
}

.auth_info h2 {
    font-size: 18px !important;
    font-weight: 400 !important;
    margin: 0 !important;
    line-height: 1.5 !important;
}

.auth_info ul {
    margin: 0;
    list-style: none;
    padding-left: 0;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea,
.select2-container--default .select2-selection--single .select2-selection__rendered {
    font-size: 16px;
}

.auth_input_label,
.modal_body_column_label,
.remember_me_label,
.form_check_label {
    font-size: 14px !important;
    font-weight: 500;
}

/* Кружок-шеврон у аккаунта в шапке — без заливки */
.account_img.account_chevron,
.account_chevron {
    background: none !important;
    box-shadow: none !important;
}

/* Основной контейнер кабинета — без подложки */
.dashboard_main {
    display: flex;
    min-height: 100vh;
    background-color: transparent !important;
}

/* Аватар-заглушка: градиент без рамки */
.preview_avatar {
    border-radius: 50%;
    min-width: 100%;
    min-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none !important;
    font-size: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--grad-red);
}

/* Мобильная версия: карточки форм без фона и тени */
@media (max-width: 760px) {
    .auth_form_container {
        display: flex;
        flex-direction: column;
        justify-content: center;
        background-color: transparent !important;
        background: transparent !important;
        padding-left: 24px;
        padding-right: 24px;
        padding-bottom: 18px;
        padding-top: 4px;
        border-radius: 12px;
        margin-top: 30px;
        box-shadow: none !important;
        -webkit-box-shadow: none !important;
        -moz-box-shadow: none !important;
    }
}

/* ------------------------------------------------------------
   Современные модальные окна (замена iframe-модалок).
   Скроллится сам оверлей (визуально — страница), фон заморожен
   через body{overflow:hidden}, внутреннего скролла у окна нет.
   ------------------------------------------------------------ */
.apply-modal {
    position: fixed;
    inset: 0;
    z-index: 2000 !important;
    display: none;
    height: auto !important;
    width: auto !important;
    background-color: transparent !important;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.apply-modal.active {
    /* !important — перебиваем старое правило #modal{display:none} из adminPanel.css */
    display: block !important;
}

.apply-modal__overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 13, 46, 0.55);
    backdrop-filter: blur(3px);
    animation: amFade 0.25s ease;
}

.apply-modal__dialog {
    position: relative;
    z-index: 1;
    width: calc(100% - 40px);
    max-width: 640px;
    margin: 48px auto;
    background: var(--white);
    border-radius: 24px;
    padding: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    animation: amPop 0.28s ease;
}

.apply-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--light-grey);
    color: var(--text-dark);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.apply-modal__close:hover {
    background: var(--grad-red);
    color: #fff;
    transform: rotate(90deg);
}

@keyframes amFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes amPop {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* Скроллбар оверлея — как у страницы */
.apply-modal::-webkit-scrollbar {
    width: 8px;
}

.apply-modal::-webkit-scrollbar-track {
    background: transparent;
}

.apply-modal::-webkit-scrollbar-thumb {
    background: var(--dark-grey);
    border-radius: 8px;
}

/* Контент, приехавший из бывших iframe-страниц */
.apply-modal .iframe_body {
    margin-top: 0;
    padding-top: 0;
}

.apply-modal .iframeform_container {
    width: 100% !important;
    max-width: 100%;
    box-shadow: none;
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
}

/* Без рамок у контента модалок (перебивает bootstrap .modal-content) */
.modal-content,
.apply-modal .modal_content {
    border: none !important;
}

.apply-modal .modal_content {
    border-radius: 24px;
}

@media (max-width: 600px) {
    .apply-modal__dialog {
        width: calc(100% - 16px);
        margin: 24px auto;
        border-radius: 16px;
    }
}

/* ------------------------------------------------------------
   Календарь DHX: фирменный вид
   ------------------------------------------------------------ */
.dhx_calendar {
    font-family: 'Stem', Arial, sans-serif !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 40px rgba(4, 13, 46, 0.16) !important;
    overflow: hidden;
}

.dhx_calendar-day {
    border-radius: 50% !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dhx_calendar-day:hover:not(.dhx_calendar-day--selected):not(.dhx_calendar-day--disabled) {
    background-color: #FBEDF1 !important;
    color: var(--bright-red) !important;
}

.dhx_calendar-day--selected,
.dhx_calendar-day--selected:before {
    /*
    background: var(--grad-red) !important;
    */
    color: #fff !important;
    border-radius: 50% !important;
}

.dhx_calendar-weekday {
    color: var(--text-light) !important;
    font-weight: 500 !important;
}

.dhx_calendar-day--weekend:not(.dhx_calendar-day--selected) {
    color: var(--bright-red);
}

.dhx_calendar-month,
.dhx_calendar-year {
    color: var(--text-dark) !important;
    font-weight: 500 !important;
}

.dhx_calendar-month--selected {
    background: var(--grad-red) !important;
    color: #fff !important;
}

/* Кнопка-глаз в поле пароля */
.password-control {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-block;
    width: 20px;
    height: 20px;
    color: #000;
    cursor: pointer;
    background: url(/img/eye_open.svg) 0 0 no-repeat;
}

/* «Забыли пароль?» и «Зарегистрироваться» — одинаковый шрифт */
a.link_text_red_pr {
    font-size: 14px !important;
    font-weight: 300 !important;
}

/* Белая кнопка «Отмена»: единый вид с остальными кнопками */
.modal_button_cancel {
    background: #fff !important;
    border: 1px solid var(--bright-red) !important;
    color: var(--bright-red) !important;
    border-radius: 14px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    height: 40px;
    transition: all 0.25s ease;
}

.modal_button_cancel:hover {
    background: #FBEDF1 !important;
    color: var(--bright-red) !important;
}

/* ------------------------------------------------------------
   Мобильное меню: бургер на FontAwesome-иконке, плавное
   появление панели, шапка при открытии — rgb(248,248,248)
   ------------------------------------------------------------ */
.burger_label::before,
.burger_label::after,
.burger_label span {
    display: none !important;
    content: none !important;
    background: none !important;
}

.burger_label i {
    font-size: 26px;
    color: var(--text-dark);
    transition: color 0.3s ease, transform 0.3s ease;
}

.burger_label:hover i {
    color: var(--bright-red);
}

.burger_label .fa-xmark {
    display: none;
}

#burger-toggle:checked ~ .burger_label .fa-bars {
    display: none;
}

#burger-toggle:checked ~ .burger_label .fa-xmark {
    display: inline-block;
    color: var(--bright-red);
    transform: rotate(90deg);
}

header:has(#burger-toggle:checked) {
    background: rgb(248, 248, 248) !important;
    background-color: rgb(248, 248, 248) !important;
    box-shadow: none !important;
}

@media (max-width: 1090px) {
    .burger_label {
        display: flex !important;
        align-items: center;
        justify-content: center;
        height: 30px;
        width: 30px;
        min-width: 30px;
        order: 999;
        margin-left: auto;
        cursor: pointer;
    }

    /* Панель меню: вместо сдвига из-за экрана — плавное появление */
    .header__list {
        left: 0 !important;
        right: 0 !important;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-14px);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    }

    #burger-toggle:checked ~ .header__list {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* ------------------------------------------------------------
   Единый крест закрытия модалок — как в диалоге
   «У вас есть черновик заявления» (editingConfirm)
   ------------------------------------------------------------ */
.apply-modal__close {
    background: transparent !important;
    color: #1a1a1a !important;
    font-size: 20px !important;
    width: 36px;
    height: 36px;
    top: 16px;
    right: 16px;
}

.apply-modal__close:hover {
    background: transparent !important;
    color: var(--bright-red) !important;
    transform: rotate(90deg);
}

/* Внутренние кресты подгружаемых модальных страниц скрываем —
   закрытие единым крестом самого окна */
.apply-modal .modal_close {
    display: none !important;
}

/* ------------------------------------------------------------
   Поля ввода: единый шрифт 16px
   ------------------------------------------------------------ */
.select_input_form_container .select2-container .select2-selection--single .select2-selection__rendered {
    display: block;
    padding-left: 0px;
    padding-right: 40px;
    font-size: 16px;
    height: 40px !important;
}

.modal_body_column_input {
    height: 40px;
    width: 100%;
    border: 2px solid #e7e7e7;
    border-radius: 8px;
    padding-left: 12px;
    padding-right: 12px;
    font-size: 16px;
}

.modal_body_column_textarea,
.auth_input,
.select2-container .select2-selection__rendered,
.select2-search__field {
    font-size: 16px !important;
}

/* ------------------------------------------------------------
   Спиннер загрузки модалок — фирменные цвета
   ------------------------------------------------------------ */
.apply-modal__spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 70px 0;
}

.apply-modal__spinner::after {
    content: '';
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 4px solid #FBEDF1;
    border-top-color: var(--bright-red);
    animation: applySpin 0.8s linear infinite;
}

@keyframes applySpin {
    to { transform: rotate(360deg); }
}
