/* ===== Общие стили: Электронная очередь ИУ10-19/6 ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: #0d1033;
    background-image: linear-gradient(160deg, #0d1033 0%, #1a1052 45%, #2a1060 75%, #3d0f6b 100%);
}


body {
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #0d1033;
    background-image: linear-gradient(160deg, #0d1033 0%, #1a1052 45%, #2a1060 75%, #3d0f6b 100%);
    color: #e8e6ff;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 24px;
    position: relative;
}


body {
    min-height: 100vh;
    min-height: 100dvh;      /* высота экрана без адресной строки на мобильных */
    background-color: #0d1033;
    background-image: linear-gradient(160deg, #0d1033 0%, #1a1052 45%, #2a1060 75%, #3d0f6b 100%);
    color: #e8e6ff;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 24px;
    position: relative;
}


/* ---- Заголовки ---- */

.page-title {
    font-size: 26px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
}

.subtitle {
    font-size: 20px;
    font-weight: 500;
    text-align: center;
    margin-top: 10px;
}

/* BMSTU с фоновым свечением */
.main-title {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: 4px;
    color: #ffffff;
    text-align: center;
    text-shadow: 0 0 25px rgba(140, 100, 255, 0.9),
                 0 0 60px rgba(100, 60, 220, 0.6);
}

/* ---- Строка заголовка: кнопка слева / текст в центре / ping справа ---- */

.header-row {
    width: 100%;
    max-width: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 8px;
}

.header-row .side-left,
.header-row .side-right {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-row .side-left  { left: 0; }
.header-row .side-right { right: 0; }

/* ---- Кнопки ---- */

.btn {
    display: inline-block;
    border: none;
    border-radius: 12px;
    padding: 13px 30px;
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
    text-align: center;
}

.btn:hover  { background: rgba(255, 255, 255, 0.2); }
.btn:active { transform: scale(0.97); }

.btn-red {
    background: #b3253a;
}
.btn-red:hover {
    background: #cc2e46;
}

.btn-green {
    background: #2e9e5b;
}
.btn-green:hover {
    background: #37b569;
}

/* Кнопка-иконка (назад, настройки) */
.icon-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.22); }

.icon-btn img {
    width: 24px;
    height: 24px;
}

/* Маленькая иконка в строке списка очереди */
.list-icon {
    width: 28px;
    height: 28px;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.list-icon:hover { opacity: 1; }

/* ---- Поля ввода ---- */

.text-input {
    width: 100%;
    max-width: 340px;
    padding: 13px 16px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.text-input::placeholder { color: rgba(232, 230, 255, 0.5); }

.text-input:focus { border-color: rgba(160, 120, 255, 0.8); }

/* ---- Блок ping ---- */

.ping-block {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 14px;
    color: rgba(232, 230, 255, 0.85);
}

.ping-block .ping-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #4cd97b;
    animation: ping-pulse 2s infinite;
}

.ping-block.ping-warn .ping-dot { background: #e0b64c; }
.ping-block.ping-bad .ping-dot { background: #d94c4c; }

@keyframes ping-pulse {
    0%   { opacity: 1; }
    50%  { opacity: 0.4; }
    100% { opacity: 1; }
}

/* ---- Список очереди ---- */

.queue-list {
    width: 100%;
    max-width: 700px;
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background 0.3s;
}

.queue-item.done {
    background: rgba(46, 158, 91, 0.6);
    border-color: rgba(46, 158, 91, 0.5);
}

.queue-item .q-num {
    font-size: 18px;
    font-weight: 700;
    min-width: 36px;
    color: #a08cff;
}

.queue-item .q-name {
    flex: 1;
    font-size: 16px;
}

.queue-item .q-nick {
    color: rgba(232, 230, 255, 0.6);
    font-size: 14px;
}

/* ---- Модальные окна ---- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 20, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-overlay.open { display: flex; }

.modal {
    width: 92%;
    max-width: 420px;
    background: #1c1444;
    border: 1px solid rgba(160, 120, 255, 0.35);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal .modal-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.modal .modal-row .grow { flex: 1; }

.modal .modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 6px;
}

/* ---- Тосты ---- */

#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.toast {
    padding: 12px 22px;
    border-radius: 12px;
    font-size: 15px;
    color: #ffffff;
    background: rgba(200, 60, 80, 0.95);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    animation: toast-in 0.25s ease;
}

.toast.toast-ok { background: rgba(46, 158, 91, 0.95); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Футер ---- */

.footer {
    margin-top: auto;          /* прижимает к низу, когда контента мало */
    padding: 12px 16px;
    text-align: center;
    font-size: 13px;
    color: rgba(232, 230, 255, 0.55);
    line-height: 1.5;
    pointer-events: none;
}


/* ---- Форма авторизации ---- */

.auth-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;                 /* занимает всё свободное место между заголовком и пингом */
    width: 100%;
}

/* ---- Колонка действий на странице выбора ---- */

.page-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
    gap: 14px;
}

/* ---- Компоновка страницы очереди ---- */

.page-columns {
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

/* ---- Панель управления ---- */

/* Иконки-предупреждения по бокам заголовка */
.title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Кнопка «Добавить» справа от «ЛР3» */
.lab-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 6px;
}

.lab-row .lab-name {
    font-size: 20px;
    font-weight: 500;
}

/* Кнопка-иконка загрузки файла в модалке */
.upload-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    transition: background 0.2s;
}

.upload-icon:hover { background: rgba(255, 255, 255, 0.22); }

.upload-icon img { width: 24px; height: 24px; }

/* Строки модалки */
.modal .modal-label {
    font-size: 14px;
    color: rgba(232, 230, 255, 0.7);
}

.modal .modal-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

/* Выбранное имя файла в модалке */
.modal .file-name {
    font-size: 14px;
    color: rgba(232, 230, 255, 0.85);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#confirm-modal {
    z-index: 200;
}

body.panel-red {
    background: linear-gradient(160deg, #33101c 0%, #4d1030 45%, #5f0f38 75%, #6b0f3d 100%);
}


.upload-hint {
    font-size: 13px;
    color: rgba(232, 230, 255, 0.55);
    margin-bottom: 10px;
    text-align: center;
}

.q-nick {
    color: inherit;
    text-decoration: none;
}

.q-nick:hover {
    text-decoration: underline;
}

/* ---- Верхний блок на главной ---- */
.top-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}
