* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a2980, #26d0ce);
    min-height: 100vh;
    /* ВКЛЮЧАЕМ СКРОЛЛ */
    overflow-y: auto;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a2980, #26d0ce);
    min-height: 100vh;
    /* Оставляем паддинг, но убираем flex-центрирование */
    padding: 40px 20px;
    min-height: 100vh;
    /* Оставляем скролл */
    overflow-y: auto;
    overflow-x: hidden;
    /* Убираем эти свойства: */
    /* display: flex; */
    /* justify-content: center; */
    /* align-items: center; */
}

/* === ОСНОВНОЙ КОНТЕЙНЕР === */
.auth-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    /* ВОЗВРАЩАЕМ flex для центрирования содержимого внутри */
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto; /* горизонтальное центрирование */
    padding: 30px;
    z-index: 100;
    transition: transform 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: translateX(0);
}

.auth-container {
    width: 75%;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    backdrop-filter: blur(15px);
    max-height: none;
}

.auth-header {
    background: linear-gradient(135deg, #2c3e50, #4a6491);
    color: white;
    padding: 50px 40px; /* Увеличиваем отступы */
    text-align: center;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px; /* Увеличиваем отступ */
    font-size: 3.2rem; /* Увеличиваем размер */
    margin-bottom: 25px;
}

.logo i {
    font-size: 3.5rem; /* Увеличиваем иконку */
    color: #3498db;
}

.logo span {
    font-weight: bold;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4);
}

.auth-header h1 {
    font-size: 2.5rem; /* Увеличиваем для ПК */
    margin-bottom: 15px;
    font-weight: 300;
    line-height: 1.3;
}

.auth-header p {
    opacity: 0.9;
    font-size: 1.2rem; /* Увеличиваем */
    line-height: 1.6;
}

.auth-card {
    padding: 50px; /* Увеличиваем отступы */
}

/* Выбор роли */
.role-selection {
    margin-bottom: 50px; /* Увеличиваем отступ */
    padding-bottom: 40px;
    border-bottom: 3px solid #eee; /* Утолщаем границу */
}

.role-selection h2 {
    color: #2c3e50;
    margin-bottom: 35px; /* Увеличиваем отступ */
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.8rem; /* Увеличиваем размер */
}

/* УЛУЧШАЕМ СЕТКУ ДЛЯ ПК */
.role-options {
    display: grid;
    /* Для ПК - 3 колонки, для планшетов - 2, для телефонов - 1 */
    grid-template-columns: repeat(3, 1fr);
    gap: 30px; /* Увеличиваем расстояние между карточками */
}

.role-option {
    background: white;
    border: 3px solid #e0e0e0; /* Утолщаем границу */
    border-radius: 15px; /* Увеличиваем скругление */
    padding: 35px 25px; /* Увеличиваем отступы */
    text-align: center;
    cursor: pointer;
    transition: all 0.4s ease; /* Увеличиваем время анимации */
    position: relative;
    overflow: hidden;
    min-height: 220px; /* Увеличиваем минимальную высоту */
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.role-option:hover {
    border-color: #3498db;
    transform: translateY(-10px) scale(1.02); /* Усиливаем эффект при наведении */
    box-shadow: 0 20px 40px rgba(52, 152, 219, 0.25);
}

.role-option.active {
    border-color: #2ecc71;
    background: linear-gradient(135deg, #f0f9ff, #e1f5fe);
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(39, 174, 96, 0.2);
}

.role-option i {
    font-size: 3.5rem; /* Увеличиваем иконки */
    color: #3498db;
    margin-bottom: 25px;
}

.role-option h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5rem; /* Увеличиваем размер заголовка */
}

.role-option p {
    color: #666;
    font-size: 1.05rem; /* Увеличиваем текст */
    line-height: 1.5;
}

/* Форма */
.auth-form {
    background: #f8f9fa;
    padding: 50px; /* Увеличиваем отступы */
    border-radius: 15px;
    border: 2px solid #e0e0e0; /* Утолщаем границу */
}

.selected-role {
    background: white;
    border: 3px solid #3498db;
    border-radius: 12px;
    padding: 25px 30px; /* Увеличиваем отступы */
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 25px;
    font-size: 1.3rem; /* Увеличиваем размер шрифта */
    color: #2c3e50;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.15);
}

.selected-role i {
    font-size: 2rem; /* Увеличиваем иконку */
    color: #3498db;
}

.form-group {
    margin-bottom: 35px; /* Увеличиваем отступы между полями */
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    color: #2c3e50;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.2rem; /* Увеличиваем размер */
}

.form-group input {
    width: 100%;
    padding: 22px 25px; /* Увеличиваем отступы внутри поля */
    border: 3px solid #ddd; /* Утолщаем границу */
    border-radius: 12px;
    font-size: 1.1rem; /* Увеличиваем размер текста */
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 5px rgba(52, 152, 219, 0.2); /* Усиливаем эффект фокуса */
}

.password-toggle {
    position: absolute;
    right: 25px;
    top: 60px; /* Корректируем позицию */
    cursor: pointer;
    color: #666;
    font-size: 1.3rem;
}

.password-toggle:hover {
    color: #3498db;
}

.login-btn {
    width: 100%;
    padding: 25px; /* Увеличиваем кнопку */
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.3rem; /* Увеличиваем текст */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s; /* Увеличиваем время анимации */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.login-btn:hover {
    background: linear-gradient(135deg, #219653, #27ae60);
    transform: translateY(-5px) scale(1.02); /* Усиливаем эффект */
    box-shadow: 0 10px 25px rgba(39, 174, 96, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.error-message {
    background: #ffeaea;
    border: 2px solid #ff7c7c; /* Утолщаем границу */
    color: #d32f2f;
    padding: 25px; /* Увеличиваем отступы */
    border-radius: 12px;
    margin-top: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    animation: slideIn 0.3s ease;
    font-size: 1.1rem;
}

.success-message {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    color: #2e7d32;
    padding: 25px; /* Увеличиваем отступы */
    border-radius: 12px;
    margin-bottom: 35px;
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 1.1rem;
}

.auth-info {
    margin-top: 50px; /* Увеличиваем отступ */
    padding: 30px; /* Увеличиваем отступы */
    background: white;
    border-radius: 12px;
    border-left: 6px solid #3498db; /* Утолщаем границу */
}

.auth-info h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.4rem; /* Увеличиваем размер */
}

.credentials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Увеличиваем минимальную ширину */
    gap: 25px; /* Увеличиваем расстояние */
}

.credential {
    background: #f8f9fa;
    padding: 20px 25px; /* Увеличиваем отступы */
    border-radius: 10px;
    font-size: 1.05rem; /* Увеличиваем текст */
    border: 2px solid #e0e0e0;
    line-height: 1.6;
}

.credential strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem; /* Увеличиваем жирный текст */
}

.auth-footer {
    background: #2c3e50;
    color: white;
    padding: 30px; /* Увеличиваем отступы */
    text-align: center;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.auth-footer p {
    margin: 10px 0; /* Увеличиваем отступы между строками */
    opacity: 0.9;
    font-size: 1.05rem; /* Увеличиваем текст */
    line-height: 1.6;
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 1200px) {
    .auth-wrapper {
        max-width: 1000px;
    }
    
    .auth-container {
        max-width: 95%;
    }
}

@media (max-width: 992px) {
    .auth-wrapper {
        max-width: 900px;
    }
    
    .role-options {
        grid-template-columns: repeat(2, 1fr); /* 2 колонки на планшетах */
    }
    
    .auth-card {
        padding: 40px 30px;
    }
    
    .auth-form {
        padding: 40px 30px;
    }
    
    .logo {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    body {
        padding: 20px 15px;
    }
    
    .auth-wrapper {
        padding: 15px;
    }
}
    
    .auth-container {
        border-radius: 15px;
        max-width: 100%;
    }
    
    .role-options {
        grid-template-columns: 1fr; /* 1 колонка на мобильных */
    }
    
    .credentials {
        grid-template-columns: 1fr;
    }
    
    .auth-card {
        padding: 25px 20px;
    }
    
    .auth-form {
        padding: 25px 20px;
    }
    
    .auth-header {
        padding: 35px 25px;
    }
    
    .logo {
        font-size: 2.3rem;
    }
    
    .logo i {
        font-size: 2.8rem;
    }
    
    .auth-header h1 {
        font-size: 1.8rem;
    }
    
    .auth-header p {
        font-size: 1.1rem;
    }
    
    .role-option {
        padding: 25px 20px;
        min-height: 180px;
    }
    
    .role-option i {
        font-size: 2.8rem;
    }
    
    .form-group input {
        padding: 20px;
    }
    
    .auth-info {
        padding: 25px 20px;
    }
}

@media (max-width: 480px) {
    .auth-header {
        padding: 25px 20px;
    }
    
    .logo {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .auth-header h1 {
        font-size: 1.5rem;
    }
    
    .auth-header p {
        font-size: 1rem;
    }
    
    .auth-card {
        padding: 20px 15px;
    }
    
    .role-option {
        padding: 20px 15px;
        min-height: 160px;
    }
    
    .role-option i {
        font-size: 2.5rem;
    }
    
    .form-group input {
        padding: 18px;
    }
    
    .auth-info {
        padding: 20px 15px;
    }
    
    .login-btn {
        padding: 20px;
        font-size: 1.1rem;
    }
}

/* === ЭКРАН ПЕРЕХОДА === */
.transition-screen {
    position: fixed;
    top: 0;
    left: 100%; /* Начинаем за пределами справа */
    width: 100vw; /* 100% ширины viewport */
    height: 100vh; /* 100% высоты viewport */
    background: linear-gradient(135deg, #1a2980, #26d0ce);
    display: none; /* Скрыт по умолчанию */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 101; /* Выше основной формы */
    padding: 50px;
    text-align: center;
    box-sizing: border-box;
    /* Начальная позиция */
    transform: translateX(0);
    will-change: transform;
}

.transition-loader {
    width: 120px; /* Увеличиваем для ПК */
    height: 120px;
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1.2s ease-in-out infinite;
    margin-bottom: 50px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.transition-title {
    font-size: 4rem; /* Увеличиваем для ПК */
    margin-bottom: 35px;
    font-weight: 300;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease 0.3s forwards;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
}

.transition-subtitle {
    font-size: 1.8rem; /* Увеличиваем для ПК */
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease 0.6s forwards;
    max-width: 800px; /* Увеличиваем максимальную ширину */
    line-height: 1.6;
    opacity: 0.9;
}

.transition-btn {
    background: white;
    color: #1a2980;
    border: none;
    padding: 30px 70px; /* Увеличиваем для ПК */
    border-radius: 60px;
    font-size: 1.7rem; /* Увеличиваем текст */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease 0.9s forwards;
    display: flex;
    align-items: center;
    gap: 25px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25); /* Усиливаем тень */
    margin-bottom: 50px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.transition-btn:hover {
    transform: translateY(-8px) scale(1.05); /* Усиливаем эффект */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.transition-countdown {
    font-size: 2.5rem; /* Увеличиваем для ПК */
    opacity: 0;
    animation: fadeInUp 0.6s ease 1.2s forwards;
    font-weight: 300;
    background: rgba(255, 255, 255, 0.15);
    padding: 20px 40px; /* Увеличиваем отступы */
    border-radius: 20px;
    backdrop-filter: blur(15px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Скрываем основную форму при активном экране перехода */
body.transition-active {
    overflow: hidden;
}

/* Кастомный скроллбар */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.5);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.7);
}

/* Для Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(52, 152, 219, 0.5) rgba(255, 255, 255, 0.1);
}