:root {
    --header-height: 60px;
    --footer-height: 60px;
    --main-color: #2c3e50;
    --accent-color: #e74c3c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #111;
}

/* Фиксированный хедер */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: #111;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Левая часть - лого и название */
.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    color: white;
    overflow: hidden;
}

.logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.site-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
}

/* Правая часть - меню */
.header-right {
    display: flex;
    align-items: center;
    position: relative;
}

/* Десктопное меню */
.desktop-menu {
    display: flex;
    gap: 25px;
    list-style: none;
}

.desktop-menu a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background 0.3s;
}

.desktop-menu a:hover {
    background: rgba(255,255,255,0.1);
}

/* Кнопка мобильного меню */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

/* Мобильное меню */
.mobile-menu {
    display: none;
    position: absolute;
    top: calc( var(--header-height) - 10px );
    right: 0;
    width: 12rem;
    background: #bf2517;
    flex-direction: column;
    list-style: none;
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    border-radius: 0 0 8px 8px;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    border-bottom: 1px solid #c93528;
    transition: background 0.3s;
}

.mobile-menu a:hover {
    background: #7d312b;
}

.mobile-menu li:last-child a {
    border-bottom: none;
}

/* Основной контент */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--header-height) 20px var(--footer-height) 20px;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height) - var(--footer-height) );
    background-color: #222;
}

.centered-block {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.centered-block h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.centered-block p {
    line-height: 1.6;
    color: #666;
}

.centered-block a {
    color: #e74c3c;
    text-decoration: none;
}

.centered-block a:hover {
    text-decoration: underline;
}

/* Футер */
.footer {
    height: var(--footer-height);
    background: #111;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center; /* Центрируем по умолчанию */
    padding: 0 20px;
    margin-top: auto;
    position: relative; /* Для абсолютного позиционирования PEGI */
}

.footer-content {
    text-align: center;
}

.footer-pegi {
    position: absolute;
    right: 20px; /* Прижимаем к правому краю */
    top: 50%;
    transform: translateY(-50%); /* Вертикальное центрирование */
}

/* Мобильная версия */
@media (max-width: 768px) {
    .footer {
        flex-direction: column;
        justify-content: center;
        height: auto;
        padding: 20px;
        position: relative;
    }
    
    .footer-pegi {
        position: static; /* Убираем абсолютное позиционирование */
        transform: none;
        order: -1; /* Перемещаем PEGI сверху */
        margin-bottom: 15px;
    }
    
    .footer-content {
        order: 1; /* Контент снизу */
    }
}

.footer a {
    color: #cb3d3d;
    transition: all 0.1s linear;
    text-decoration: none;
}

.footer a:hover {
    color: #E30A0A;
    text-decoration: underline;
}

/* Стили для контейнера форм */
.forms {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

/* Общие стили для всех форм */
.form_enter,
.form_register,
.form_forgot {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

/* Стили для полей ввода */
.forms input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.forms input:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Стили для кнопок */
.forms button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.forms button[type="submit"] {
    background: var(--accent-color);
    color: white;
    flex: 2;
}

.forms button[type="submit"]:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.forms button[type="button"] {
    background: #34495e;
    color: white;
    flex: 1;
}

.forms button[type="button"]:hover {
    background: #2c3e50;
    transform: translateY(-2px);
}

/* Контейнер для кнопок */
.forms form > div:nth-child(3) {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

/* Ссылки */
.forms a {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.3s ease;
}

.forms a:hover {
    color: #c0392b;
    text-decoration: underline;
}

/* Заголовки форм */
.forms h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--main-color);
    font-size: 1.5rem;
}

/* Анимация появления */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form_enter,
.form_register,
.form_forgot {
    animation: fadeIn 0.3s ease;
}

/* Сообщения об ошибках/успехе */
.form-message {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    text-align: center;
    font-size: 14px;
}

.form-message.error {
    background: #ffeaea;
    color: #d63031;
    border: 1px solid #ff7675;
}

.form-message.success {
    background: #eaffea;
    color: #00b894;
    border: 1px solid #55efc4;
}

/* Стили для форм */
.form-actions {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.form-actions button,
.form-actions .btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    line-height: 1;
    vertical-align: middle;
}

.form-actions a.btn-secondary {
    display: inline-flex;
    text-decoration: none;
    margin: 5px;
}

.form-actions button {
    background: var(--accent-color);
    color: white;
}

.form-actions button:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-secondary {
    display: inline-block;
    background: #34495e;
    color: white;
}

.btn-secondary:hover {
    background: #2c3e50;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

.form-links {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e1e1;
}

.form-links a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.form-links a:hover {
    color: #c0392b;
    text-decoration: underline;
}

/* Стили для ошибок валидации */
.forms input.error {
    border-color: #e74c3c;
    background-color: #ffeaea;
}

.forms input.error:focus {
    border-color: #c0392b;
}

/* Медиа-запросы для мобильных устройств */
@media (max-width: 768px) {
    .desktop-menu {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .site-name {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0 15px;
    }

    .site-name {
        font-size: 1rem;
    }

    .logo {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .centered-block {
        padding: 30px 20px;
    }
    
    .forms {
        padding: 0 10px;
    }
    
    .form_enter,
    .form_register,
    .form_forgot {
        padding: 20px 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button,
    .form-actions .btn-secondary {
        width: 100%;
        margin: 5px 0;
    }
    
    .forms form > div:nth-child(3) {
        flex-direction: column;
    }
    
    .forms button {
        width: 100%;
        margin: 5px 0;
    }
}

/* iOS */
@supports (-webkit-touch-callout: none) {
    .main-content {
        min-height: calc(100vh - var(--header-height) - var(--footer-height) - 34px );
    }
    .footer {
        height: calc( var(--footer-height) + 34px );
        padding-bottom: 34px;
    }
}