/* ============================================
   СТИЛИ ДЛЯ МОДАЛЬНЫХ ОКОН ВХОДА
   Админка и учителя
============================================ */

/* Оверлей (фон) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.95) 0%, 
        rgba(118, 75, 162, 0.95) 100%);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.4s ease-out;
    padding: 20px;
}

/* Анимация появления */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Контейнер модального окна */
.modal-container {
    background: white;
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
                0 8px 24px rgba(102, 126, 234, 0.2);
    animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

/* Декоративный элемент сверху */
.modal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, 
        #667eea 0%, 
        #764ba2 33%, 
        #f093fb 66%, 
        #f5576c 100%);
    border-radius: 24px 24px 0 0;
}

/* Для админки - другой градиент */
.modal-container.admin::before {
    background: linear-gradient(90deg, 
        #667eea 0%, 
        #4c51bf 33%, 
        #5a67d8 66%, 
        #434190 100%);
}

/* Для учителей - другой градиент */
.modal-container.teacher::before {
    background: linear-gradient(90deg, 
        #38b2ac 0%, 
        #319795 33%, 
        #2c7a7b 66%, 
        #285e61 100%);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Заголовок */
.modal-container h3 {
    text-align: center;
    color: #2d3748;
    margin-bottom: 32px;
    font-size: 1.75rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 16px;
}

.modal-container h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

/* Форма */
.modal-container form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Поля ввода */
.modal-container input[type="text"],
.modal-container input[type="password"] {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8fafc;
    color: #2d3748;
    box-sizing: border-box;
}

.modal-container input[type="text"]:focus,
.modal-container input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

/* Плейсхолдеры */
.modal-container input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

/* Кнопка входа */
.modal-container button[type="submit"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.modal-container button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.modal-container button[type="submit"]:active {
    transform: translateY(-1px);
}

/* Эффект при наведении */
.modal-container button[type="submit"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.modal-container button[type="submit"]:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(40, 40);
        opacity: 0;
    }
}

/* Иконка на кнопке */
.modal-container button[type="submit"]::before {
    content: '→';
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    opacity: 0;
    transition: all 0.3s ease;
}

.modal-container button[type="submit"]:hover::before {
    opacity: 1;
    right: 20px;
}

/* Сообщение об ошибке */
.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 16px;
    border-radius: 12px;
    margin-top: 16px;
    text-align: center;
    font-weight: 500;
    border-left: 4px solid #fc8181;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Декоративные элементы */
.modal-decoration {
    position: absolute;
    z-index: -1;
    opacity: 0.1;
}

.modal-decoration:nth-child(1) {
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: #667eea;
    border-radius: 50%;
}

.modal-decoration:nth-child(2) {
    bottom: -80px;
    left: -80px;
    width: 300px;
    height: 300px;
    background: #764ba2;
    border-radius: 50%;
}

/* Адаптивность */
@media (max-width: 480px) {
    .modal-container {
        padding: 32px 24px;
        margin: 16px;
        border-radius: 20px;
    }
    
    .modal-container h3 {
        font-size: 1.5rem;
        margin-bottom: 24px;
    }
    
    .modal-container input[type="text"],
    .modal-container input[type="password"] {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .modal-container button[type="submit"] {
        padding: 16px 24px;
        font-size: 15px;
    }
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
    .modal-container {
        background: #1a202c;
        color: white;
    }
    
    .modal-container h3 {
        color: #e2e8f0;
    }
    
    .modal-container input[type="text"],
    .modal-container input[type="password"] {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .modal-container input[type="text"]:focus,
    .modal-container input[type="password"]:focus {
        border-color: #667eea;
        background: #2d3748;
    }
    
    .error-message {
        background: #742a2a;
        color: #fc8181;
        border-left-color: #f56565;
    }
}