* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
}

body {
    background-color: #000;
    color: #b30000;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    background-color: #1a1a1a;
    padding: 15px;
    border-bottom: 2px solid #b30000;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 24px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #b30000, transparent);
}

.container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Изменено с center на flex-start */
    padding: 20px;
    overflow-y: auto; /* Добавлена прокрутка для контейнера */
}

.login-form, .temporary-pass-page, .temporary-pass-result {
    background-color: #0d0d0d;
    border: 1px solid #333;
    padding: 30px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 0 15px rgba(179, 0, 0, 0.3);
    position: relative;
    margin: 20px 0; /* Добавлены отступы */
}

.profile-page {
    background-color: #0d0d0d;
    border: 1px solid #333;
    padding: 30px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 0 15px rgba(179, 0, 0, 0.3);
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

/* ОСНОВНОЕ ИЗМЕНЕНИЕ: Добавляем прокрутку для временного пропуска */
.temporary-pass-page {
    max-height: 85vh; /* Ограничиваем высоту */
    overflow-y: auto; /* Включаем вертикальную прокрутку */
    margin: 20px 0;
}

.temporary-pass-page::-webkit-scrollbar {
    width: 8px;
}

.temporary-pass-page::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.temporary-pass-page::-webkit-scrollbar-thumb {
    background: #b30000;
    border-radius: 4px;
}

.temporary-pass-page::-webkit-scrollbar-thumb:hover {
    background: #ff0000;
}

.login-form::before, .profile-page::before, .temporary-pass-page::before, .temporary-pass-result::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #b30000, #4d0000, #b30000);
    z-index: -1;
    opacity: 0.5;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input, select {
    width: 100%;
    padding: 12px;
    background-color: #1a1a1a;
    border: 1px solid #333;
    color: #b30000;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
}

input:focus, select:focus {
    border-color: #b30000;
    box-shadow: 0 0 8px rgba(179, 0, 0, 0.5);
}

.submit-btn, .logout-btn, .temporary-pass-btn, .generate-btn, .back-btn, .propaganda-btn {
    background-color: #1a1a1a;
    color: #b30000;
    border: 1px solid #b30000;
    padding: 12px;
    width: 100%;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.submit-btn:hover, .logout-btn:hover, .temporary-pass-btn:hover, .generate-btn:hover, .back-btn:hover, .propaganda-btn:hover {
    background-color: #b30000;
    color: #000;
    box-shadow: 0 0 15px rgba(179, 0, 0, 0.7);
}

.submit-btn::after, .logout-btn::after, .temporary-pass-btn::after, .generate-btn::after, .back-btn::after, .propaganda-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.submit-btn:hover::after, .logout-btn:hover::after, .temporary-pass-btn:hover::after, .generate-btn:hover::after, .back-btn:hover::after, .propaganda-btn:hover::after {
    left: 100%;
}

.footer {
    background-color: #1a1a1a;
    padding: 10px;
    text-align: center;
    font-size: 12px;
    color: #666;
    border-top: 1px solid #333;
    flex-shrink: 0; /* Запрещаем сжатие футера */
}

.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #b30000, transparent);
    animation: scan 3s linear infinite;
    z-index: 100;
}

@keyframes scan {
    0% {
        top: 0%;
    }
    100% {
        top: 100%;
    }
}

.glitch {
    position: relative;
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #00ffff;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #ff00ff;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(42px, 9999px, 44px, 0);
    }
    5% {
        clip: rect(12px, 9999px, 59px, 0);
    }
    10% {
        clip: rect(48px, 9999px, 29px, 0);
    }
    15% {
        clip: rect(42px, 9999px, 73px, 0);
    }
    20% {
        clip: rect(63px, 9999px, 27px, 0);
    }
    25% {
        clip: rect(34px, 9999px, 55px, 0);
    }
    30% {
        clip: rect(86px, 9999px, 73px, 0);
    }
    35% {
        clip: rect(20px, 9999px, 20px, 0);
    }
    40% {
        clip: rect(26px, 9999px, 60px, 0);
    }
    45% {
        clip: rect(25px, 9999px, 66px, 0);
    }
    50% {
        clip: rect(57px, 9999px, 98px, 0);
    }
    55% {
        clip: rect(5px, 9999px, 46px, 0);
    }
    60% {
        clip: rect(82px, 9999px, 31px, 0);
    }
    65% {
        clip: rect(54px, 9999px, 27px, 0);
    }
    70% {
        clip: rect(28px, 9999px, 99px, 0);
    }
    75% {
        clip: rect(45px, 9999px, 69px, 0);
    }
    80% {
        clip: rect(23px, 9999px, 85px, 0);
    }
    85% {
        clip: rect(54px, 9999px, 84px, 0);
    }
    90% {
        clip: rect(45px, 9999px, 47px, 0);
    }
    95% {
        clip: rect(37px, 9999px, 20px, 0);
    }
    100% {
        clip: rect(4px, 9999px, 91px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
    }
    5% {
        clip: rect(52px, 9999px, 74px, 0);
    }
    10% {
        clip: rect(79px, 9999px, 85px, 0);
    }
    15% {
        clip: rect(75px, 9999px, 5px, 0);
    }
    20% {
        clip: rect(67px, 9999px, 61px, 0);
    }
    25% {
        clip: rect(14px, 9999px, 79px, 0);
    }
    30% {
        clip: rect(1px, 9999px, 66px, 0);
    }
    35% {
        clip: rect(86px, 9999px, 30px, 0);
    }
    40% {
        clip: rect(23px, 9999px, 98px, 0);
    }
    45% {
        clip: rect(85px, 9999px, 72px, 0);
    }
    50% {
        clip: rect(71px, 9999px, 75px, 0);
    }
    55% {
        clip: rect(2px, 9999px, 48px, 0);
    }
    60% {
        clip: rect(30px, 9999px, 16px, 0);
    }
    65% {
        clip: rect(59px, 9999px, 50px, 0);
    }
    70% {
        clip: rect(41px, 9999px, 62px, 0);
    }
    75% {
        clip: rect(2px, 9999px, 82px, 0);
    }
    80% {
        clip: rect(47px, 9999px, 73px, 0);
    }
    85% {
        clip: rect(3px, 9999px, 27px, 0);
    }
    90% {
        clip: rect(26px, 9999px, 55px, 0);
    }
    95% {
        clip: rect(42px, 9999px, 97px, 0);
    }
    100% {
        clip: rect(38px, 9999px, 49px, 0);
    }
}

.terminal-text {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 10px;
    color: #4d0000;
}

/* Скрываем элементы на главной странице */
.login-form, .temporary-pass-page, .temporary-pass-result {
    display: none;
}

/* Показываем профиль на отдельной странице профиля */
body:not(.main-page) .profile-page {
    display: block;
}

.profile-header, .temporary-pass-header, .temporary-pass-result-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
}

.profile-header h2, .temporary-pass-header h2, .temporary-pass-result-header h2 {
    font-size: 22px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-section, .temporary-pass-section, .temporary-pass-result-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #1a1a1a;
    border: 1px solid #333;
}

.profile-section h3, .temporary-pass-section h3, .temporary-pass-result-section h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #b30000;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.profile-section p, .temporary-pass-section p, .temporary-pass-result-section p {
    margin-bottom: 8px;
    line-height: 1.4;
}

.classified {
    color: #ff0000;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    font-weight: bold;
}

.error-message {
    color: #ff0000;
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    display: none;
}

.access-granted {
    color: #00ff00;
    text-align: center;
    margin-bottom: 15px;
    font-size: 14px;
    display: none;
}

.button-row {
    display: flex;
    gap: 10px;
}

.button-row button {
    flex: 1;
}

.id-number {
    font-size: 18px;
    font-weight: bold;
    color: #b30000;
    text-align: center;
    margin: 15px 0;
    padding: 10px;
    background-color: #1a1a1a;
    border: 1px solid #333;
}

.propaganda-section {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #1a0000, #4d0000);
    border: 1px solid #b30000;
    text-align: center;
}

.propaganda-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ff3333;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.propaganda-text {
    margin-bottom: 15px;
    line-height: 1.5;
}

.propaganda-image {
    height: 150px;
    background: linear-gradient(135deg, #330000, #660000);
    margin: 15px 0;
    border: 1px solid #b30000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff6666;
    font-style: italic;
}

.heroes-text {
    font-style: italic;
    margin-bottom: 15px;
    color: #ff6666;
}

/* Стили для скроллбара в Firefox */
.temporary-pass-page {
    scrollbar-width: thin;
    scrollbar-color: #b30000 #1a1a1a;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
        align-items: flex-start; /* Для мобильных тоже flex-start */
    }
    
    .login-form, .profile-page, .temporary-pass-page, .temporary-pass-result {
        padding: 20px;
        margin: 10px 0;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .button-row {
        flex-direction: column;
    }
    
    /* Для мобильных увеличиваем высоту формы временного пропуска */
    .temporary-pass-page {
        max-height: 90vh;
    }
}