/* css/login.css - Стили страницы входа - ФИНАЛЬНАЯ ВЕРСИЯ 2 */

/* =============================================
   БАЗОВЫЕ СТИЛИ СТРАНИЦЫ
   ============================================= */

body.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}

/* =============================================
   ССЫЛКИ В ВЕРХНЕЙ ЧАСТИ
   ============================================= */

.top-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px 0 20px 0;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.top-links .register-link,
.top-links .recover-link {
    text-decoration: none;
    font-size: 14px;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #5f302f !important;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.top-links .register-link:hover,
.top-links .recover-link:hover {
    background: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: rgba(95, 48, 47, 0.3) !important;
}

.top-links .recover-link {
    color: #cc383a !important;
}

/* =============================================
   КАРТОЧКА ФОРМЫ (сразу под ссылками)
   ============================================= */

.login-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    flex: 1;
}

.login-form {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
    box-sizing: border-box;
    min-height: auto;
}

.login-form:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.login-header {
    margin-bottom: 10px;
    text-align: center;
}

.logo {
    height: 60px;
    background: url('/img/logo.png') center no-repeat;
    background-size: contain;
    margin: 0 auto 10px;
}

.login-divider {
    background-color: #5f302f;
    margin: 0;
    height: 1px;
    border: none;
    opacity: 0.7;
}

/* =============================================
   ПОЛЯ ВВОДА
   ============================================= */

.login-form-inner .input-control {
    margin-bottom: 15px !important;
	height: 1rem !important;
}

.login-form-inner .input-control input {
    font-family: 'Consolas', 'Monaco', monospace;
    letter-spacing: 0.5px;
    width: 100%;
    box-sizing: border-box;
}

.login-form-inner .input-control .label {
    color: #5f302f !important;
    font-weight: 600;
    font-size: 0.9em;
}

.login-form-inner .input-control .informer {
    color: #666;
    font-size: 0.8em;
    margin-top: 3px;
    display: block;
}

/* =============================================
   УВЕДОМЛЕНИЯ И ПОДСКАЗКИ
   ============================================= */

.security-notice {
    font-size: 11px;
    margin: 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #666;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #5f302f;
}

.security-notice i {
    color: #5f302f;
}

.security-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 12px;
    border: 1px solid #e9ecef;
}

.security-info p {
    margin: 0 0 8px 0;
    color: #333;
    font-weight: 600;
    font-size: 13px;
}

.security-info ul {
    margin: 0;
    padding-left: 18px;
    color: #555;
    line-height: 1.4;
}

.security-info li {
    margin-bottom: 4px;
}

/* =============================================
   КНОПКИ И ССЫЛКИ
   ============================================= */

.form-actions {
    margin-top: 20px;
}

.login-submit {
    background: linear-gradient(to right, #5f302f, #8a4443) !important;
    border: none !important;
    color: white !important;
    width: 100%;
    padding: 12px !important;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 !important;
}

.login-submit:hover {
    background: linear-gradient(to right, #8a4443, #5f302f) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(95, 48, 47, 0.3) !important;
}

.login-submit:active {
    transform: translateY(0) !important;
}

/* Убираем старые login-links из формы, т.к. они теперь вверху */
.login-links {
    display: none;
}

/* =============================================
   ФУТЕР - В САМОМ НИЗУ
   ============================================= */

.login-wrapper .footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    line-height: 1.6;
    padding: 15px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    margin: 20px auto 0 auto;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Сбрасываем все возможные стили Metro UI для футера */
body.login-page .footer,
.login-page .footer,
.login-wrapper .footer {
    background: transparent !important;
    border: none !important;
    position: static !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
    bottom: auto !important;
    right: auto !important;
    display: block !important;
    float: none !important;
    clear: both !important;
}

/* =============================================
   АНИМАЦИИ И ЭФФЕКТЫ
   ============================================= */

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.login-form.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-form {
    animation: fadeIn 0.6s ease-out;
}

/* =============================================
   АДАПТИВНОСТЬ
   ============================================= */

@media (max-width: 480px) {
    body.login-page {
        padding: 10px;
    }
    
    .login-wrapper {
        padding: 10px;
        min-height: calc(100vh - 20px);
    }
    
    .top-links {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 5px 0 15px 0;
        margin-bottom: 5px;
    }
    
    .top-links .register-link,
    .top-links .recover-link {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        padding: 10px 15px !important;
        font-size: 13px;
    }
    
    .login-container {
        max-width: 100%;
    }
    
    .login-form {
        padding: 20px;
        border-radius: 10px;
        margin-bottom: 15px;
    }
    
    .logo {
        height: 50px;
    }
    
    .login-divider {
        margin: 15px 0;
    }
    
    .security-info {
        margin-top: 15px;
        padding: 12px;
        font-size: 11px;
    }
    
    .security-info p {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .security-info ul {
        padding-left: 15px;
        line-height: 1.3;
    }
    
    .login-wrapper .footer {
        padding: 12px 10px !important;
        font-size: 11px;
        margin-top: 15px !important;
    }
}

@media (max-width: 320px) {
    .login-form {
        padding: 15px;
    }
    
    .login-submit {
        padding: 10px !important;
        font-size: 14px;
    }
    
    .logo {
        height: 45px;
    }
}

/* =============================================
   ДОПОЛНИТЕЛЬНЫЕ ЭЛЕМЕНТЫ
   ============================================= */

.attempts-warning {
    background: linear-gradient(to right, #fff3cd, #ffeaa7);
    border: 1px solid #ffc107;
    color: #856404;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.5s ease;
}

.attempts-warning i {
    color: #ffc107;
    font-size: 16px;
}

/* Индикатор загрузки */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #5f302f;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =============================================
   ТЕМНАЯ ТЕМА (опционально)
   ============================================= */

@media (prefers-color-scheme: dark) {
    .login-form {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .top-links .register-link,
    .top-links .recover-link {
        background: rgba(45, 55, 72, 0.9) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
        color: #e2e8f0 !important;
    }
    
    .security-notice,
    .security-info {
        background: #4a5568;
        color: #cbd5e0;
    }
    
    .login-divider {
        background-color: #718096;
    }
    
    .input-control .label {
        color: #90cdf4 !important;
    }
    
    .input-control .informer {
        color: #a0aec0;
    }
}

/* =============================================
   СБРОС КОНФЛИКТУЮЩИХ СТИЛЕЙ METRO UI
   ============================================= */

/* Убираем конфликтующие стили Metro UI */
.login-page .input-control.underline::before,
.login-page .input-control.underline::after {
    background-color: #5f302f !important;
}

.login-page .button {
    min-width: auto !important;
}

/* Исправляем отображение placeholder */
.login-page .input-control input::placeholder {
    opacity: 0.5;
    color: #999;
}

/* Убираем лишние отступы и margin от Metro UI */
.login-page .padding20 {
    padding: 25px !important;
}

.login-page .block-shadow {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}