/* --- ПЕРЕМЕННЫЕ И БАЗА --- */
:root {
    --primary: #007bff;
    --primary-hover: #0056b3;
    --success: #28a745;
    --danger: #dc3545;
    --text-main: white;
    --text-muted: white;
    --bg-page: #f4f5f7;
    --bg-card: #77777716;
    --border-card: #ffffff55;
    --border-color: #e5e5e547;
    --radius-card: 24px;
    --radius-pill: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: white;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-page);
    background-image: url("/static/default/background-pc.jpg");
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 5vmin;
}

/* --- КАРТОЧКА --- */
.card {
    background-color: var(--bg-card);
    width: 100%;
    /* height: 80vh; */
    max-width: 400px;
    padding: 40px 30px;
    border-radius: var(--radius-card);
    border: solid var(--border-card) 0.1em;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-around;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-shrink: 0;
    backdrop-filter: blur(700px);
    -webkit-backdrop-filter: blur(700px);
}

.card-wide {
    max-width: 600px;
    align-items: stretch;
}

.card-admin {
    max-width: 900px;
    background-color: #d9d9d97a;
    color: black;
    align-items: stretch;
}

/* --- ХЕДЕР --- */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
    gap: 10px;
    flex-wrap: wrap;
}

.title {
    font-size: 20px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.text-muted {
    color: var(--text-muted);
}

/* --- ЛОГО --- */
.logo-wrapper {
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 24px;
    background-color: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 21vh;
    height: 21vh;
    box-sizing: border-box;
    padding: 10px;
}

.logo-picture {
    height: 21vh;
    object-fit: contain;
}

/* --- ФОРМЫ (ПИЛЮЛИ) --- */
.form-group {
    width: 100%;
    margin-bottom: 16px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: white;
    font-weight: 500;
    padding-left: 15px;
}

.form-input {
    width: 100%;
    padding: 14px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
    background: #3f3f3f22;
    backdrop-filter: blur(20px);
}

.form-input::placeholder {
    color: white;
}

.form-input:focus {
    background: #2e2e2e44;
    backdrop-filter: blur(50px);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-input-sm {
    padding: 10px 16px;
    font-size: 13px;
}

/* --- КНОПКИ --- */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 14px 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    background-color: #ffffff;
    color: #333;
}

.btn:hover {
    background-color: #f9f9f9;
    border-color: #d0d0d0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary {
    color: var(--primary);
}

.btn-success {
    color: var(--success);
}

.btn-dark {
    color: #1a1a1a;
    font-weight: 700;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 14px;
    width: auto;
}

.btn-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-pill);
    transition: all 0.2s;
}

.btn-link:hover {
    background: #f8d7da;
}

/* --- АЛЕРТЫ --- */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-pill);
    margin-bottom: 20px;
    font-size: 14px;
    width: 100%;
    text-align: center;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* --- ССЫЛКИ И УТИЛИТЫ --- */
.link-primary {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.link-primary:hover {
    color: var(--primary-hover);
}

.link-danger {
    color: var(--danger);
    text-decoration: none;
    font-weight: 600;
}

.link-danger:hover {
    color: #a71d2a;
}

.auth-link {
    margin-top: 20px;
    font-size: 14px;
    /* color: #666; */
}

.auth-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.w-100 {
    width: 100%;
}

.d-inline {
    display: inline;
}

.mb-5 {
    margin-bottom: 5px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-12 {
    margin-bottom: 12px;
}

.mb-15 {
    margin-bottom: 15px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-5 {
    margin-top: 5px;
}

.mr-10 {
    margin-right: 10px;
}

.mr-15 {
    margin-right: 15px;
}

.badge-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    transition: all 0.2s;
}

.badge-link:hover {
    background: #f9f9f9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.empty-state {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    width: 100%;
}

/* =========================================
   АДАПТИВНОСТЬ (МЕДИА-ЗАПРОСЫ)
   ========================================= */

/* Для мобильных устройств (ширина до 480px) */
@media (max-width: 480px) {
    body {
        padding: 15px;
        /* Уменьшаем отступы по краям экрана */
        /* background-image: url("/static/default/background-mobile.jpg") */
    }

    .card {
        padding: 30px 20px;
        /* Делаем карточку чуть компактнее */
        border-radius: 20px;
        overflow-y: scroll;
    }

    .header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    /* Кнопка "Выйти" и ссылки в шапке прижмутся вправо */
    .header-row>div:last-child,
    .header-row>a:last-child {
        align-self: flex-end;
        margin-top: -20px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}