body {
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

.login-box {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 2.5em 2em 2em 2em;
    max-width: 370px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5em;
}

.login-title {
    font-size: 2em;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin-bottom: 0.2em;
}

.login-subtitle {
    color: #888;
    text-align: center;
    font-size: 1em;
    margin-bottom: 0.5em;
}

.alert {
    background: #dc3545;
    color: #fff;
    border-radius: 7px;
    padding: 1em;
    text-align: center;
    font-size: 1em;
    margin-bottom: 0.5em;
    animation: fadeIn 0.3s ease-in;
}

.alert-error {
    background: #dc3545;
    color: #fff;
    border-left: 4px solid #c82333;
}

.alert-warning {
    background: #ffc107;
    color: #212529;
    border-left: 4px solid #e0a800;
}

.alert-success {
    background: #28a745;
    color: #fff;
    border-left: 4px solid #1e7e34;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

label {
    font-weight: 500;
    color: #444;
    font-size: 1.08em;
}

input[type="text"], 
input[type="password"] {
    padding: 1.1em;
    border: 2px solid #e1e5e9;
    border-radius: 7px;
    font-size: 1.15em;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.btn-primary {
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 1.1em;
    font-size: 1.15em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 0.5em;
    width: 100%;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: scale(0.98);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #aaa;
    font-size: 0.95em;
    margin: 1em 0 0.5em 0;
}

.divider::before, 
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e1e5e9;
}

.divider:not(:empty)::before {
    margin-right: .7em;
}

.divider:not(:empty)::after {
    margin-left: .7em;
}

.telegram-widget {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5em;
}

/* Мобильные стили */
@media (max-width: 500px) {
    .login-box { 
        padding: 1.2em 0.5em; 
        margin: 1rem;
        border-radius: 10px;
    }
    
    .login-title { 
        font-size: 1.6em; 
    }
    
    .login-subtitle { 
        font-size: 0.9em; 
    }
    
    input[type="text"], 
    input[type="password"] { 
        padding: 1em; 
        font-size: 1.1em; 
    }
    
    .btn-primary { 
        padding: 1em; 
        font-size: 1.1em; 
    }
}

@media (max-width: 360px) {
    .login-box { 
        padding: 1em 0.4em; 
        margin: 0.5rem;
    }
    
    .login-title { 
        font-size: 1.4em; 
    }
    
    .login-subtitle { 
        font-size: 0.85em; 
    }
    
    input[type="text"], 
    input[type="password"] { 
        padding: 0.9em; 
        font-size: 1em; 
    }
    
    .btn-primary { 
        padding: 0.9em; 
        font-size: 1em; 
    }
}

/* Улучшения для touch-устройств */
@media (hover: none) and (pointer: coarse) {
    input[type="text"], 
    input[type="password"] { 
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    .btn-primary:active { 
        transform: scale(0.98); 
    }
}

/* Улучшения доступности */
input[type="text"]:focus,
input[type="password"]:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.btn-primary:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Стили для логотипа */
.login-logo {
    text-align: center;
    margin-bottom: 1rem;
}

.login-logo img {
    max-height: 60px;
    max-width: 200px;
    object-fit: contain;
}

/* Стили для ошибок */
.alert {
    border: none;
    border-radius: 7px;
    font-weight: 500;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Стили для успешных сообщений */
.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box {
    animation: fadeIn 0.5s ease-out;
}

/* Стили для загрузки */
.btn-primary:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.btn-primary:disabled:hover {
    background-color: #6c757d;
    transform: none;
}

/* Стили для валидации */
input:invalid {
    border-color: #dc3545;
}

input:valid {
    border-color: #28a745;
}

/* Стили для placeholder */
input::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

/* Стили для автозаполнения */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: #333 !important;
} 