/* static/css/login.css - КОМПАКТНАЯ ВЕРСИЯ ДЛЯ МОБИЛЬНЫХ */

/* Базовые стили для страницы логина */
.login-page {
    background: linear-gradient(135deg, #0c074d, #1a5f7a) !important;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 10px;
    overflow-y: auto;
}

.login-page .mobile-container {
    max-width: 100%;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #0c074d, #1a5f7a);
    border-radius: 0;
    box-shadow: none;
    overflow-y: auto;
    border: none;
}

.login-page .app-layout {
    height: 100vh;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(12, 7, 77, 0.95), rgba(26, 95, 122, 0.95));
    display: flex;
    flex-direction: column;
}

/* Верхняя панель - КОМПАКТНАЯ */
.login-page .notification-bar {
    background: linear-gradient(90deg, #0a41a5, #1a7fad) !important;
    min-height: 50px !important;
    height: 8vh !important;
    max-height: 60px;
    padding: 8px 15px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.login-page .notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
}

.login-page .notification-icon {
    font-size: 18px !important;
    color: rgba(255, 255, 255, 0.9);
    animation: none;
}

.login-page .notification-text {
    font-size: 14px !important;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.login-page .current-date {
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.8);
}

/* Основная область - КОМПАКТНАЯ */
.login-page .main-content {
    background: transparent !important;
    padding: 15px !important;
    height: auto;
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    overflow-y: auto;
    min-height: 0;
}

.auth-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding-top: 10px;
}

/* Логотип - КОМПАКТНЫЙ */
.auth-header {
    text-align: center;
    margin-bottom: 20px !important;
    padding: 0 10px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 28px !important;
    color: #64b5f6;
    background: rgba(255, 255, 255, 0.1);
    width: 50px !important;
    height: 50px !important;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.logo h2 {
    font-size: 22px !important;
    color: white;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.auth-subtitle {
    color: #b3e0ff;
    font-size: 14px !important;
    font-weight: 400;
    margin-top: 3px;
}

/* Формы - КОМПАКТНЫЕ */
.auth-form {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    padding: 20px !important;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px !important; /* Уменьшено для компенсации error-message */
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px !important;
    color: white;
    font-weight: 500;
    font-size: 14px !important;
}

.form-group label i {
    color: #64b5f6;
    width: 16px;
    font-size: 14px;
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px !important;
    top: 50%;
    transform: translateY(-50%);
    color: #b3e0ff;
    font-size: 16px !important;
    z-index: 1;
}

.auth-form input {
    width: 100%;
    padding: 12px 15px 12px 45px !important;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 15px !important;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    position: relative;
    height: 48px;
    box-sizing: border-box;
}

.auth-form input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.auth-form input:focus {
    outline: none;
    border-color: #64b5f6;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(100, 181, 246, 0.2);
    color: white;
}

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 50px !important;
}

.toggle-password {
    position: absolute;
    right: 15px !important;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 16px !important;
    width: 36px !important;
    height: 36px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s;
    padding: 0;
}

.toggle-password:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.05);
}

/* ОЧЕНЬ КОМПАКТНЫЕ СООБЩЕНИЯ ОБ ОШИБКАХ */
.input-hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px !important; /* Уменьшено */
    margin-top: 3px !important; /* Уменьшено */
    margin-bottom: 0 !important;
    font-style: italic;
    line-height: 1.2 !important; /* Уменьшено */
    padding: 0;
    min-height: 0;
}

.error-message {
    color: #ff8a80;
    font-size: 11px !important; /* Уменьшено */
    margin-top: 3px !important; /* Уменьшено */
    margin-bottom: 0 !important;
    min-height: 14px !important; /* Уменьшено */
    line-height: 1.2 !important; /* Уменьшено */
    padding: 0;
    font-weight: 500;
}

/* Вариант для очень маленьких экранов */
.error-message.compact {
    font-size: 10px !important;
    margin-top: 2px !important;
    min-height: 12px !important;
    line-height: 1.1 !important;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px !important;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px !important;
    color: rgba(255, 255, 255, 0.9);
}

.checkbox-label input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    margin: 0;
    accent-color: #64b5f6;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

.forgot-password {
    color: #64b5f6;
    text-decoration: none;
    font-size: 13px !important;
    font-weight: 500;
    transition: all 0.3s;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(100, 181, 246, 0.1);
    border: 1px solid rgba(100, 181, 246, 0.2);
    white-space: nowrap;
}

.forgot-password:hover {
    color: #90caf9;
    background: rgba(100, 181, 246, 0.2);
    border-color: rgba(100, 181, 246, 0.3);
    text-decoration: none;
}

/* Кнопки - КОМПАКТНЫЕ */
.btn {
    width: 100%;
    padding: 14px !important;
    border: none;
    border-radius: 10px;
    font-size: 15px !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px !important;
    height: 50px;
    box-sizing: border-box;
}

.btn-primary {
    background: linear-gradient(135deg, #64b5f6, #2196F3);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 3px 10px rgba(33, 150, 243, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.divider {
    text-align: center;
    margin: 15px 0 !important;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.divider span {
    background: rgba(12, 7, 77, 0.8);
    padding: 0 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px !important;
    position: relative;
    font-weight: 500;
}

/* Сообщения - КОМПАКТНЫЕ */
.message-box {
    padding: 15px !important;
    border-radius: 10px;
    margin-bottom: 15px;
    display: none;
    animation: fadeIn 0.3s ease-out;
    border: 1px solid;
    backdrop-filter: blur(10px);
    font-size: 14px;
}

.message-box.success {
    background: rgba(76, 175, 80, 0.15);
    color: #c8e6c9;
    border-color: rgba(76, 175, 80, 0.3);
}

.message-box.error {
    background: rgba(244, 67, 54, 0.15);
    color: #ffcdd2;
    border-color: rgba(244, 67, 54, 0.3);
}

.message-box .message-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.message-box i {
    font-size: 18px !important;
    margin-top: 1px;
    flex-shrink: 0;
}

.message-box .message-content div {
    flex: 1;
    line-height: 1.4;
}

/* Информация о статусах - КОМПАКТНАЯ */
.status-info-box {
    margin-top: 20px !important;
    padding: 15px !important;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-info-box h4 {
    color: white;
    margin-bottom: 12px !important;
    font-size: 15px !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-info-box h4 i {
    color: #64b5f6;
    font-size: 16px;
}

.status-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    width: 22px !important;
    height: 22px !important;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px !important;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.status-badge.status-0 {
    background: #FF9800;
}

.status-badge.status-1 {
    background: #4CAF50;
}

.status-badge.status-2 {
    background: #f44336;
}

.status-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px !important;
    line-height: 1.3;
}

.note {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px !important;
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.4;
}

.note i {
    margin-right: 6px;
    font-size: 12px;
}

/* Модальные окна - КОМПАКТНЫЕ */
.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 15px;
    backdrop-filter: blur(5px);
}

.login-modal-content {
    background: linear-gradient(135deg, #0c074d, #1a5f7a) !important;
    border-radius: 15px;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    max-width: 100%;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.login-modal-header {
    background: linear-gradient(90deg, #0a41a5, #1a7fad);
    color: white;
    padding: 20px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.login-modal-header h3 {
    margin: 0;
    font-size: 18px !important;
    font-weight: 600;
}

.login-modal-body {
    padding: 20px !important;
    color: white;
    font-size: 14px;
    line-height: 1.4;
}

.login-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px !important;
    cursor: pointer;
    line-height: 1;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.login-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
    border-color: rgba(255, 255, 255, 0.3);
}

.terms-content {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

.terms-content h4 {
    color: white;
    margin-bottom: 12px !important;
    font-size: 15px !important;
}

.terms-content p {
    margin-bottom: 15px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Анимация загрузки */
.spinner {
    animation: spin 1s linear infinite;
}

/* ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ (до 360px) */
@media (max-width: 360px) {
    .login-page {
        padding: 5px;
    }

    .login-page .notification-bar {
        padding: 6px 10px !important;
        min-height: 45px !important;
    }

    .notification-text {
        font-size: 13px !important;
    }

    .logo i {
        width: 45px !important;
        height: 45px !important;
        font-size: 24px !important;
    }

    .logo h2 {
        font-size: 20px !important;
    }

    .auth-subtitle {
        font-size: 13px !important;
    }

    .auth-form {
        padding: 15px !important;
    }

    .auth-form input {
        padding: 10px 12px 10px 40px !important;
        font-size: 14px !important;
        height: 44px;
    }

    .input-icon {
        left: 12px !important;
        font-size: 14px !important;
    }

    .toggle-password {
        right: 12px !important;
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
    }

    /* Еще более компактные error-message на очень маленьких экранах */
    .error-message {
        font-size: 10px !important;
        margin-top: 2px !important;
        min-height: 12px !important;
        line-height: 1.1 !important;
    }

    .input-hint {
        font-size: 10px !important;
        margin-top: 2px !important;
        line-height: 1.1 !important;
    }

    .btn {
        padding: 12px !important;
        font-size: 14px !important;
        height: 46px;
    }

    .status-info-box {
        padding: 12px !important;
    }
}

/* ВЫСОКИЕ ЭКРАНЫ (минимальная высота 700px) */
@media (min-height: 700px) {
    .login-page .app-layout {
        justify-content: center;
    }

    .auth-container {
        padding-top: 20px;
    }
}

/* ЛАНДШАФТНАЯ ОРИЕНТАЦИЯ */
@media (max-width: 900px) and (orientation: landscape) {
    .login-page {
        padding: 5px;
        align-items: flex-start;
    }

    .login-page .mobile-container {
        height: auto;
        min-height: auto;
        max-height: 95vh;
        overflow-y: auto;
    }

    .login-page .app-layout {
        height: auto;
        min-height: auto;
    }

    .login-page .notification-bar {
        height: auto !important;
        min-height: 45px !important;
        padding: 5px 10px !important;
    }

    .login-page .main-content {
        padding: 10px !important;
        overflow-y: visible;
    }

    .auth-header {
        margin-bottom: 10px !important;
    }

    .logo {
        margin-bottom: 5px;
    }

    .logo i {
        width: 40px !important;
        height: 40px !important;
        font-size: 20px !important;
    }

    .logo h2 {
        font-size: 18px !important;
    }

    .auth-form {
        padding: 15px !important;
        margin-bottom: 10px;
    }

    .form-group {
        margin-bottom: 10px !important;
    }

    .auth-form input {
        padding: 8px 10px 8px 35px !important;
        height: 40px;
        font-size: 14px !important;
    }

    .input-icon {
        left: 10px !important;
        font-size: 14px !important;
    }

    .error-message {
        font-size: 10px !important;
        margin-top: 2px !important;
        min-height: 10px !important;
    }

    .input-hint {
        font-size: 10px !important;
        margin-top: 2px !important;
    }

    .btn {
        padding: 10px !important;
        height: 42px;
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }

    .status-info-box {
        margin-top: 10px !important;
        padding: 10px !important;
    }
}

/* iPhone SE и другие маленькие устройства */
@media (max-width: 320px) {
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .forgot-password {
        align-self: flex-start;
    }

    .status-item {
        align-items: flex-start;
    }

    .status-text {
        font-size: 12px !important;
    }

    /* Самые компактные error-message */
    .error-message {
        font-size: 9px !important;
        margin-top: 1px !important;
        min-height: 10px !important;
        line-height: 1 !important;
    }

    .input-hint {
        font-size: 9px !important;
        margin-top: 1px !important;
        line-height: 1 !important;
    }
}

/* Адаптация для клавиатуры на мобильных */
@media (max-height: 500px) {
    .login-page .notification-bar {
        display: none;
    }

    .login-page .main-content {
        padding-top: 5px !important;
    }

    .auth-header {
        margin-bottom: 10px !important;
    }

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

/* Фикс для iOS Safari */
@supports (-webkit-touch-callout: none) {
    .login-page {
        height: -webkit-fill-available;
    }

    .login-page .mobile-container {
        height: -webkit-fill-available;
    }

    .login-page .app-layout {
        height: -webkit-fill-available;
    }
}

/* Фикс для Android Chrome */
@supports (height: 100dvh) {
    .login-page {
        min-height: 100dvh;
    }

    .login-page .mobile-container {
        height: 100dvh;
    }

    .login-page .app-layout {
        height: 100dvh;
    }
}