/**
 * БМС Академия - Стили страницы авторизации
 * 
 * @author ElWin
 * @version 1.0
 * @date 2025-10-15
 */

/* ========================================
   CSS ПЕРЕМЕННЫЕ
   ======================================== */
:root {
    /* Цвета */
    --primary-blue: #3A557C;
    --dark-blue: #32496B;
    --gradient-blue: linear-gradient(-9deg, #3F638E 0%, #364B6F 100%);
    
    --text-dark: #363636;
    --text-light: #FFFFFF;
    --text-gray: #848484;
    
    --bg-light: #F6F8F7;
    --bg-white: #FFFFFF;
    
    --border-light: rgba(60, 90, 130, 0.19);
    --border-gray: #D3DAE2;
    
    /* Отступы */
    --border-radius: 12px;
    --input-radius: 8px;
    
    /* Шрифты */
    --font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ========================================
   RESET & BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   LAYOUT
   ======================================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 320px;
}

.login-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.08);
}

/* ========================================
   HEADER
   ======================================== */
.login-header {
    text-align: center;
    margin-bottom: 25px;
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.2;
}

.login-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-gray);
    line-height: 1.4;
}

/* ========================================
   ФОРМА ВХОДА
   ======================================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--input-radius);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.4;
}

.alert-error {
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.3);
    color: #ff5252;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4CAF50;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    width: 100%;
}

.form-input {
    width: 100%;
    height: 48px;
    background: var(--bg-white);
    border: 1px solid var(--border-gray);
    border-radius: var(--input-radius);
    padding: 0 16px;
    font-size: 15px;
    font-family: var(--font-family);
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.form-input::placeholder {
    color: var(--text-gray);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(58, 85, 124, 0.1);
}

.form-input.error {
    border-color: #ff5252;
}

/* ========================================
   КНОПКА
   ======================================== */
.btn {
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    width: 100%;
    height: 48px;
    background: var(--primary-blue);
    color: var(--text-light);
    border-radius: var(--input-radius);
    margin-top: 8px;
}

.btn-primary:hover {
    background: var(--dark-blue);
    box-shadow: 0 4px 12px rgba(58, 85, 124, 0.2);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(58, 85, 124, 0.2);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   ОШИБКИ ПОЛЕЙ
   ======================================== */
.field-error {
    color: #ff5252;
    font-size: 13px;
    margin-top: 5px;
}

/* ========================================
   АДАПТИВНОСТЬ
   ======================================== */

/* Мобильные устройства */
@media (max-width: 480px) {
    .login-card {
        padding: 24px 20px;
    }
    
    .login-title {
        font-size: 22px;
    }
    
    .login-subtitle {
        font-size: 13px;
    }
    
    .form-input,
    .btn-primary {
        height: 44px;
        font-size: 14px;
    }
}

/* ========================================
   АНИМАЦИИ
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    animation: fadeIn 0.4s ease-out;
}

/* Состояние загрузки формы */
.form-loading {
    position: relative;
    pointer-events: none;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--input-radius);
    z-index: 10;
}
