/* ===== ОСНОВНЫЕ ПЕРЕМЕННЫЕ ===== */
:root {
    --color-primary: #8B0000;
    --color-primary-dark: #6B0000;
    --color-primary-light: #a52a2a;
    --color-success: #28a745;
    --color-success-dark: #1e7e34;
    --color-white: #ffffff;
    --color-black: #1a1a1a;
    --color-gray-light: #f5f5f5;
    --color-gray: #e0e0e0;
    --color-gray-dark: #666666;
    --color-text: #333333;
    --color-text-muted: #666666;
}

/*===== БАЗОВЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-white);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== HEADER СТИЛИ ===== */
header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* ВАЖНО: исправлено header-container -> .header-container */
.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    /* нужно для выпадающего меню справа */
    position: relative;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-white);
    text-decoration: none;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);

    /* фиксируем слева */
    flex: 0 0 auto;
}
.logo span {
    color: #ffd700;
}

/* Навигация - стандартные ссылки */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;

    /* центрируем по середине */
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: var(--color-white);
    text-decoration: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.9;
}
.nav-link:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}
.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

/* Кнопки CTA - объёмные */
.header-buttons {
    display: flex;
    gap: 12px;

    /* прижимаем вправо */
    flex: 0 0 auto;
    margin-left: auto;
}

.btn-login {
    background: var(--color-white);
    color: var(--color-primary);
    border: 2px solid var(--color-white);
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}
.btn-login:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
}

.btn-register {
    background: var(--color-success);
    color: var(--color-white);
    border: 2px solid var(--color-success);
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
    transition: all 0.2s ease;
}
.btn-register:hover {
    background: var(--color-success-dark);
    border-color: var(--color-success-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

/* Мобильное меню (бургер) */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--color-white);
    font-size: 28px;
    cursor: pointer;
    padding: 5px;
}

@media (max-width: 1024px) {
    .nav-menu {
        display: none;
    }
    .mobile-menu-btn {
        display: block;

        /* бургер справа */
        margin-left: auto;
        order: 3;
    }
    .header-buttons {
        display: none;
    }
    .header-container {
        padding: 10px 15px;
        justify-content: space-between;
    }
}

/* Мобильная навигация */
.mobile-nav {
    display: none;
    background: var(--color-primary-dark);
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);

    /* панель справа под хедером */
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    max-width: 92vw;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    border-radius: 0 0 10px 10px;
    z-index: 1100;
}
.mobile-nav.open {
    display: block;
}
.mobile-nav a {
    display: block;
    color: var(--color-white);
    text-decoration: none;
    padding: 12px 0;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.mobile-nav a:last-child {
    border-bottom: none;
}

.mobile-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.mobile-buttons a {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
}

/* ✅ FIX: в мобильном меню кнопка ВХОД остаётся белой, а текст — цветом хедера */
.mobile-buttons .btn-login {
    background: var(--color-white);
    border: 2px solid var(--color-white);
    color: var(--color-primary) !important;
}
.mobile-buttons .btn-login:hover {
    background: #f0f0f0;
    color: var(--color-primary) !important;
}

/* На всякий случай явно фиксируем REGISTER в мобильном меню */
.mobile-buttons .btn-register {
    background: var(--color-success);
    border: 2px solid var(--color-success);
    color: var(--color-white) !important;
}
.mobile-buttons .btn-register:hover {
    background: var(--color-success-dark);
    border-color: var(--color-success-dark);
    color: var(--color-white) !important;
}

/* ===== MAIN CONTENT ===== */
main {
    background-color: var(--color-white);
    min-height: calc(100vh - 200px);
}

/* ===== СЕКЦИИ НА ВСЮ ШИРИНУ ===== */
.section {
    width: 100%;
    background-color: var(--color-gray-light);
    padding: 30px 20px;
    margin: 0;
}
.section:nth-child(even) {
    background-color: var(--color-white);
}
.section-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Альтернативный вариант секции */
.block {
    width: 100%;
    background-color: var(--color-gray-light);
    padding: 30px 20px;
    margin: 0;
}
.block:nth-child(even) {
    background-color: var(--color-white);
}
.block-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== ТИПОГРАФИКА ===== */
h1 {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 25px;
    color: var(--color-text);
    line-height: 1.3;
}
h2 {
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: var(--color-text);
}
h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--color-text);
}
p {
    margin-bottom: 15px;
    color: var(--color-text);
    line-height: 1.7;
}
ul, ol {
    margin-bottom: 15px;
    padding-left: 25px;
}
li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* ===== ТАБЛИЦЫ ===== */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 20px 0;
}
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-white);
    border: 1px solid var(--color-gray);
    border-radius: 8px;
    overflow: hidden;
}
th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-gray);
}
th {
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
td {
    font-size: 15px;
    color: var(--color-text);
}
tr:hover td {
    background: rgba(139, 0, 0, 0.05);
}
tr:last-child td {
    border-bottom: none;
}

/* ===== КНОПКИ CTA В КОНТЕНТЕ ===== */
.btn-center {
    text-align: center;
    margin: 25px 0;
}
.btn-cta {
    display: inline-block;
    background: var(--color-success);
    color: var(--color-white);
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
    transition: all 0.2s ease;
}
.btn-cta:hover {
    background: var(--color-success-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}
.btn-cta-primary {
    background: var(--color-primary);
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4);
}
.btn-cta-primary:hover {
    background: var(--color-primary-dark);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.5);
}

/* ===== ИЗОБРАЖЕНИЯ ===== */
.img-box {
    max-width: 800px;
    margin: 20px auto;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.img-box img {
    width: 100%;
    height: auto;
    display: block;
}

/* ===== FAQ СЕКЦИЯ ===== */
.faq-section {
    width: 100%;
    background: var(--color-gray-light);
    padding: 40px 20px;
}
.faq-container {
    max-width: 900px;
    margin: 0 auto;
}
.faq-title {
    text-align: center;
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--color-text);
}
.faq-item {
    background: var(--color-white);
    border: 1px solid var(--color-gray);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}
.faq-question {
    width: 100%;
    padding: 18px 20px;
    background: var(--color-white);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    text-align: left;
    transition: background 0.2s ease;
}
.faq-question:hover {
    background: var(--color-gray-light);
}
.faq-icon {
    font-size: 24px;
    color: var(--color-primary);
    font-weight: 300;
    transition: transform 0.3s ease;
}
.faq-item.active .faq-icon {
    transform: rotate(45deg);
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--color-gray-light);
}
.faq-item.active .faq-answer {
    max-height: 500px;
}
.faq-answer-inner {
    padding: 20px;
}
.faq-answer p {
    margin: 0;
    color: var(--color-text);
    line-height: 1.7;
}

/* ===== TOC (СОДЕРЖАНИЕ) ===== */
.toc-wrapper {
    margin: 20px 0;
}
.toc-toggle {
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease;
}
.toc-toggle:hover {
    background: var(--color-primary-dark);
}
.toc {
    background: var(--color-white);
    border: 1px solid var(--color-gray);
    border-radius: 8px;
    margin-top: 15px;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}
.toc.open {
    max-height: 1000px;
    padding: 20px;
}
.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.toc li {
    margin-bottom: 10px;
}
.toc a {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 15px;
    display: block;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.2s ease;
}
.toc a:hover {
    background: var(--color-gray-light);
}

/* ===== КНОПКА НАВЕРХ ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4);
    z-index: 999;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background: var(--color-primary-dark);
    transform: translateY(-3px);
}

/* ===== FOOTER ===== */
.footer {
    background-color: var(--color-black);
    color: var(--color-white);
    padding: 30px 20px;
    text-align: center;
}
.footer p {
    color: rgba(255, 255, 255, 0.8);
    margin: 5px 0;
    font-size: 14px;
}
.footer a {
    color: var(--color-white);
    text-decoration: none;
    margin: 0 10px;
    transition: opacity 0.2s ease;
}
.footer a:hover {
    opacity: 0.7;
}
.footer-links {
    margin-bottom: 15px;
}
.footer-copy {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    margin-top: 15px;
}

/* ===== EMOJI LIST ===== */
.emoji-list {
    list-style: none;
    padding-left: 0;
}
.emoji-list li {
    padding-left: 5px;
    position: relative;
    margin-bottom: 12px;
}

/* ===== STEP LIST ===== */
.step-list {
    counter-reset: step-counter;
    list-style: none;
    padding-left: 0;
}
.step-list li {
    counter-increment: step-counter;
    padding-left: 45px;
    position: relative;
    margin-bottom: 15px;
}
.step-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 30px;
    height: 30px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    h1 {
        font-size: 24px;
    }
    h2 {
        font-size: 20px;
    }
    h3 {
        font-size: 18px;
    }
    .section, .block {
        padding: 20px 15px;
    }
    th, td {
        padding: 10px 12px;
        font-size: 13px;
    }
    .btn-cta {
        padding: 12px 30px;
        font-size: 14px;
    }
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 22px;
    }
    h1 {
        font-size: 20px;
    }
    .table-wrapper {
        margin: 15px -15px;
        padding: 0 15px;
    }
}