/* --- Сброс стилей и основа --- */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #4c68d7 0%, #15a4fa 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #333;
}

/* --- Контейнер/Карточка входа (ДЕСКТОП) --- */
.login-container {
    background-color: #ffffff;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

.login-container h2 {
    text-align: center;
    color: #4c68d7;
    margin-bottom: 30px;
    font-weight: 600;
}

/* --- Стили для полей формы --- */
.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.form-field input[type="text"],
.form-field input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-field input:focus {
    border-color: #15a4fa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(21, 164, 250, 0.2);
}

/* --- Стили для кнопки --- */
.login-button {
    width: 100%;
    padding: 15px;
    background-color: #15a4fa;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s;
}

.login-button:hover {
    background-color: #0c8cd8;
}

/* --- Стили для ошибок --- */
.errorlist {
    color: #ff4545;
    list-style: none;
    padding: 0;
    margin: -10px 0 15px 0;
    font-size: 14px;
    font-weight: 500;
}

/* --- Стили для ссылок --- */
.link-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.link-footer a {
    color: #4c68d7;
    text-decoration: none;
    font-weight: 500;
}

.link-footer a:hover {
    text-decoration: underline;
}

/* =========================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   (Применяется ТОЛЬКО если экран меньше 768px)
   ========================================= */

@media (max-width: 768px) {

    /* 1. Исправляем фон и позиционирование */
    body {
        display: block !important; /* Убираем центрирование flex, чтобы страница скроллилась */
        padding: 20px 0 !important;
        height: auto !important;
        min-height: 100vh;
    }

    /* 2. Карточка входа: Широкая и удобная */
    .login-container {
        width: 92% !important;
        max-width: 100% !important;
        margin: 30px auto !important; /* Отступ сверху */
        padding: 25px 20px !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
    }

    /* 3. Заголовок чуть крупнее */
    .login-container h2 {
        font-size: 24px !important;
        margin-bottom: 25px !important;
    }

    /* 4. Поля ввода: Высокие для пальца */
    .form-field input[type="text"],
    .form-field input[type="password"] {
        height: 50px !important;       /* Высота 50px - удобно нажимать */
        font-size: 16px !important;    /* 16px чтобы не зумился экран на iPhone */
        padding: 0 15px !important;
        margin-bottom: 5px !important; /* Отступ внутри блока */
    }
    
    .form-field {
        margin-bottom: 20px !important; /* Отступ между блоками */
    }

    /* 5. Кнопка: Большая и заметная */
    .login-button {
        height: 55px !important;
        font-size: 18px !important;
        font-weight: bold !important;
        margin-top: 10px !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 6. Ссылки внизу */
    .link-footer {
        margin-top: 25px !important;
    }
    
    .link-footer p {
        font-size: 15px !important;
        margin-bottom: 10px !important;
        line-height: 1.5 !important;
    }

    .link-footer a {
        display: inline-block;
        padding: 8px; /* Увеличиваем область нажатия */
        font-size: 16px !important;
    }
}
/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ: ЛАНДШАФТНЫЙ РЕЖИМ (ГОРИЗОНТАЛЬНО)
   (Для телефонов, повернутых боком, когда высота экрана маленькая)
   ============================================================ */

@media (max-height: 500px) and (orientation: landscape) {
    
    /* 1. Убираем центрирование по вертикали, чтобы можно было скроллить */
    body {
        align-items: flex-start !important; /* Прижимаем к верху */
        padding: 20px 0 !important;         /* Небольшой отступ сверху/снизу */
        height: auto !important;            /* Разрешаем контенту растягивать body */
        min-height: 100vh;
    }

    /* 2. Уменьшаем отступы у карточки, чтобы влезала */
    .login-container {
        margin: 10px auto !important; /* Минимальный отступ сверху */
        width: 80% !important;        /* Не на весь экран по ширине (чтобы не было слишком широко) */
        max-width: 500px !important;
        padding: 15px 20px !important;
    }

    /* 3. Компактный заголовок */
    .login-container h2 {
        font-size: 20px !important;
        margin-bottom: 15px !important;
        margin-top: 0 !important;
    }

    /* 4. Компактные поля */
    .form-field {
        margin-bottom: 10px !important;
    }
    
    .form-field input[type="text"],
    .form-field input[type="password"] {
        height: 40px !important; /* Чуть меньше высота, чем в портретном режиме */
        margin-bottom: 5px !important;
        padding: 5px 10px !important;
    }

    /* 5. Компактная кнопка и ссылки */
    .login-button {
        height: 45px !important;
        margin-top: 10px !important;
        font-size: 16px !important;
    }
    
    .link-footer {
        margin-top: 10px !important;
    }
    
    .link-footer p {
        margin-bottom: 5px !important;
    }
}