﻿/* ============================================================
   Фабрика Инвест — style.css
   Палитра: #FFFFFF / #3A3A3A / #2E1A47 / #0693e3 / #8B4513
            #7CFC00 / #1A237E / #A8D89A / #C71585
   Шрифты:  Oswald (заголовки), Open Sans (текст)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;600;700&family=Open+Sans:wght@400;600&display=swap');

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background: #FFFFFF;
    color: #3A3A3A;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

a {
    color: #0693e3;
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover { color: #8B4513; }

h1, h2, h3, h4 {
    font-family: 'Oswald', Arial, sans-serif;
    color: #2E1A47;
    margin: 0.4em 0;
}
h1 { font-size: 48px; }
h2 { font-size: 36px; }
h3 { font-size: 28px; }
h4 { font-size: 22px; }

/* ---------- Шапка ---------- */
header {
    background: #FFFFFF;
    padding: 12px 24px;
    border-bottom: 3px solid #7CFC00;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
header h1 {
    margin: 0;
    font-size: 32px;
}
header h1 a {
    color: #7CFC00 !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.15);
}
header nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
header nav a {
    color: #7CFC00;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.15);
    padding: 6px 10px;
    border-radius: 6px;
    transition: 0.3s ease;
}
header nav a:hover {
    background: #2E1A47;
    color: #7CFC00;
}

/* ---------- Основной контейнер ---------- */
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

/* ---------- Кнопки ---------- */
.btn, button.btn {
    display: inline-block;
    background: #1A237E;
    color: #FFFFFF;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s ease;
    text-decoration: none;
}
.btn:hover {
    color: #7CFC00;
}
.btn:active {
    background: #0D1454;
    color: #7CFC00;
}

/* ---------- Подвал ---------- */
.site-footer {
    background: #000000;
    color: #FFFFFF;
    text-align: center;
    padding: 24px 16px;
    font-size: 14px;
    margin-top: 48px;
}
.site-footer a { color: #7CFC00; }
.site-footer a:hover { color: #C71585; }

/* ---------- Живая лента Фабрики ---------- */
.live-feed { margin: 32px 0; }
.live-feed h2 { margin-bottom: 4px; }
.feed-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin: 16px 0;
}
@media (max-width: 1200px) {
    .feed-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
    .feed-grid { grid-template-columns: repeat(2, 1fr); }
}
.feed-item {
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.feed-item video,
.feed-item img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

/* ---------- Утилиты ---------- */
.muted { color: #666; font-size: 0.9em; }
.limit { color: #999; font-size: 0.85em; margin: 4px 0 8px 0; }
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 24px;
    margin-bottom: 24px;
}

/* ===== Hero-картинка под шапкой ===== */
.hero {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    line-height: 0;
    max-height: 450px; /* Ограничиваем высоту баннера */
}
.hero img {
    width: 100%;
    max-height: 450px;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: center;
}


/* ===== Блок цитаты дня ===== */
.quote-block {
    max-width: 900px;
    margin: 24px auto;
    padding: 24px 32px;
    background: linear-gradient(135deg, #f8f4ff 0%, #f0f8f7 100%);
    border-left: 6px solid #7CFC00;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(46, 26, 71, 0.08);
}
.quote-block blockquote {
    margin: 0 0 16px 0;
    padding: 0;
}
.quote-block .quote-text {
    font-family: 'Oswald', sans-serif;
    font-size: 24px;
    line-height: 1.4;
    color: #2E1A47;
    font-weight: 400;
    margin: 0 0 12px 0;
}
.quote-block .quote-author {
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    font-style: italic;
    color: #666;
    text-align: right;
}
.quote-block .btn-quote {
    display: inline-block;
    background: #1A237E;
    color: #FFFFFF;
    padding: 12px 22px;
    border-radius: 6px;
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    text-decoration: none;
    transition: 0.3s ease;
}
.quote-block .btn-quote:hover {
    color: #7CFC00;
}


/* ===== Блок SYNTX — 6 видео в ряд ===== */
.syntx-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin: 16px 0;
}
@media (max-width: 1200px) {
    .syntx-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
    .syntx-grid { grid-template-columns: repeat(2, 1fr); }
}

.syntx-item {
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.syntx-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}
.syntx-item video {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
.syntx-caption {
    padding: 8px 10px;
    background: #fff;
}
.syntx-title {
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    color: #2E1A47;
    line-height: 1.2;
    margin-bottom: 4px;
}
.syntx-replica {
    font-size: 12px;
    color: #666;
    font-style: italic;
    line-height: 1.3;
}

/* ===== Модальное окно SYNTX ===== */
.syntx-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.syntx-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
}
.syntx-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}
.syntx-modal-close:hover {
    color: #C71585;
}
.syntx-modal h3 {
    font-family: 'Oswald', sans-serif;
    color: #2E1A47;
    margin: 12px 0 4px 0;
    font-size: 20px;
}
.syntx-modal-prompt {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}


/* ===== Карусель (галерея примеров) ===== */
.carousel { position: relative; margin: 16px 0; }
.slide { display: none; text-align: center; }
.slide.active { display: block; }
.slide img { max-width: 100%; max-height: 360px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.caption { margin: 8px 0 0 0; font-size: 0.9em; color: #555; }
.placeholder-img {
    width: 100%; height: 360px; background: #e0e0e0; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #888; font-size: 16px; text-align: center;
}
.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,150,136,0.8); color: #fff; border: none;
    width: 40px; height: 40px; border-radius: 50%; font-size: 24px; cursor: pointer;
}
.carousel-btn:hover { background: #009688; }
.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }


/* ===== Кнопки: состояние disabled ===== */
button:disabled,
button[disabled] {
    background: #ccc !important;
    color: #888 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}


/* ===== Layout: основной контент + сайдбар ===== */
/* old layout removed */

.layout-main {
    min-width: 0;
}

/* ===== Сайдбар ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: static;
}

.sidebar-block {
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    padding: 12px;
}

.sidebar-block h3 {
    margin: 0 0 8px 0;
    font-family: Oswald, sans-serif;
    color: #2E1A47;
    font-size: 16px;
}

.sidebar-search input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #CCC;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.banner-placeholder,
.ad-placeholder,
.ad-slot {
    text-align: center;
    padding: 18px 8px;
    background: #F5F5F5;
    border-radius: 6px;
    font-size: 13px;
    color: #3A3A3A;
    line-height: 1.4;
}

.sidebar-banner a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.sidebar-ad .ad-placeholder a,
.sidebar-block a {
    color: #0693e3;
    text-decoration: none;
}

.sidebar-block a:hover {
    color: #8B4513;
}

.activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13px;
    color: #3A3A3A;
}

.activity-list li {
    padding: 6px 0;
    border-bottom: 1px solid #EEE;
}

.activity-list li:last-child {
    border-bottom: none;
}

.sidebar-links p {
    margin: 6px 0;
}

.muted {
    color: #888;
    font-size: 13px;
}

/* ===== Мобильные: сайдбар скрыт ===== */
@media (max-width: 900px) {
    /* old layout removed */
    .sidebar {
        display: none;
    }
}


/* ===== layout override (фикс конфликта с main{max-width}) ===== */
/* old layout removed */
main.layout-main,
.layout > main.layout-main,
.layout main.layout-main {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* TEXT LEFT — выравнивание текста в сайдбаре по левому краю */
.sidebar,
.sidebar-block,
.sidebar-block h3,
.sidebar-search input,
.activity-list,
.activity-list li,
.sidebar-links,
.sidebar-links p,
.sidebar-banner,
.sidebar-ad,
.banner-placeholder,
.ad-placeholder,
.ad-slot {
    text-align: left !important;
}

/* Заголовки и ссылки в сайдбаре — слева */
.sidebar h3 {
    text-align: left !important;
}

/* Активности — слева */
.sidebar .activity-list li {
    text-align: left !important;
}


/* ===== QUOTES PAGE ===== */
.quotes-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
}

.quotes-page h1 {
    text-align: left;
    margin-bottom: 8px;
}

/* --- Блок «Новые темы» --- */
.pending-block {
    margin: 24px 0;
    padding: 16px;
    background: #FFF8E1;
    border-left: 4px solid #FFC107;
    border-radius: 8px;
}

.pending-block h2 {
    margin-top: 0;
    color: #E65100;
}

.pending-card {
    background: #FFFFFF;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.pending-card.failed {
    border-left: 4px solid #C71585;
}

.pending-name {
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    color: #2E1A47;
    margin-bottom: 4px;
}

.pending-status {
    font-size: 14px;
    color: #666;
    margin-top: 6px;
}

.pending-status.failed {
    color: #C71585;
    font-weight: 600;
}

/* --- Карточки цитат --- */
.quotes-list {
    margin: 24px 0;
}

.quote-card {
    background: #FFFFFF;
    border-radius: 10px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(46, 26, 71, 0.08);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.quote-card.open {
    box-shadow: 0 4px 16px rgba(46, 26, 71, 0.15);
}

.quote-header {
    padding: 16px 20px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease;
}

.quote-header:hover {
    background: #F9F7FC;
}

.quote-topic {
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    color: #0693e3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.quote-text {
    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    line-height: 1.4;
    color: #2E1A47;
    margin-bottom: 8px;
}

.quote-author {
    font-size: 14px;
    font-style: italic;
    color: #666;
    text-align: right;
}

.quote-toggle {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 18px;
    color: #999;
    transition: transform 0.2s ease;
}

.quote-card.open .quote-toggle {
    transform: rotate(180deg);
}

.quote-body {
    padding: 0 20px 20px;
    border-top: 1px solid #EEE;
}

.quote-story,
.quote-facts {
    margin-top: 16px;
}

.quote-story h3,
.quote-facts h3 {
    font-size: 18px;
    color: #2E1A47;
    margin-bottom: 8px;
}

.quote-story p,
.quote-facts p {
    font-size: 15px;
    line-height: 1.6;
    color: #3A3A3A;
    margin: 8px 0;
}

.quote-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: #8B4513 !important;
}

.btn-secondary:hover {
    color: #7CFC00 !important;
}

.quote-contest {
    margin-top: 16px;
    padding: 12px 16px;
    background: #F0F8E8;
    border-left: 4px solid #7CFC00;
    border-radius: 6px;
    font-size: 14px;
    color: #2E1A47;
}

/* --- Форма «Предложить тему» --- */
.suggest-topic {
    margin: 40px 0 24px;
    padding: 24px;
    background: #F9F7FC;
    border-radius: 10px;
}

.suggest-topic h2 {
    margin-top: 0;
}

.suggest-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.suggest-form input,
.suggest-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #CCC;
    border-radius: 6px;
    font-family: 'Open Sans', sans-serif;
    font-size: 15px;
    box-sizing: border-box;
}

.suggest-form textarea {
    min-height: 80px;
    resize: vertical;
}

.suggest-form button {
    align-self: flex-start;
}

.suggest-error {
    background: #FFF0F0;
    border-left: 4px solid #C71585;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.suggest-error > div:first-child {
    font-weight: 600;
    color: #C71585;
    margin-bottom: 8px;
}

.banned-words {
    font-size: 13px;
    color: #666;
    margin-top: 6px;
}

.suggest-suggestions {
    margin-top: 12px;
}

.suggest-suggestions > div {
    font-weight: 600;
    margin-bottom: 8px;
}

.suggest-suggestions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.suggest-suggestions li {
    margin: 6px 0;
}

.btn-small {
    font-size: 13px !important;
    padding: 6px 12px !important;
}

@media (max-width: 700px) {
    .quote-text { font-size: 17px; }
    .quote-actions { flex-direction: column; }
    .quote-actions .btn { width: 100%; text-align: center; }
}


/* ===== QUIZ SESSION (страница 10 вопросов) ===== */
.quiz-session,
.quiz-results {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
}

.quiz-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #F8F4FF 0%, #F0F8F7 100%);
    border-left: 6px solid #7CFC00;
    border-radius: 10px;
    margin-bottom: 24px;
}

.quiz-topic {
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    color: #0693e3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.quiz-quote {
    font-family: 'Oswald', sans-serif;
    font-size: 22px;
    line-height: 1.4;
    color: #2E1A47;
    margin: 0 0 8px;
    padding: 0;
    border: none;
}

.quiz-author {
    font-style: italic;
    color: #666;
    text-align: right;
    font-size: 14px;
}

.quiz-form {
    margin: 16px 0;
}

.quiz-question {
    background: #FFFFFF;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 16px 20px;
    margin-bottom: 16px;
}

.quiz-q-num {
    font-size: 13px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.quiz-q-text {
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    color: #2E1A47;
    line-height: 1.4;
    margin-bottom: 12px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-option {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #F9F7FC;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s ease;
}

.quiz-option:hover {
    background: #EFE8FA;
}

.quiz-option input[type="radio"] {
    display: none;
}

.quiz-option input[type="radio"]:checked + .quiz-option-text {
    font-weight: 700;
    color: #1A237E;
}

.quiz-option:has(input:checked) {
    background: #E8F0FE;
    border-color: #1A237E;
}

.quiz-option-text {
    flex: 1;
    font-size: 15px;
    color: #3A3A3A;
}

.quiz-submit {
    margin-top: 24px;
    text-align: center;
}

.quiz-submit .btn {
    padding: 14px 32px;
    font-size: 17px;
}

.quiz-score {
    text-align: center;
    padding: 24px;
    background: #F0F8E8;
    border-radius: 10px;
    margin-bottom: 24px;
}

.quiz-score-num {
    font-family: 'Oswald', sans-serif;
    font-size: 48px;
    color: #1A237E;
    line-height: 1;
}

.quiz-score-label {
    margin-top: 8px;
    font-size: 18px;
    color: #2E1A47;
}

.quiz-guest {
    padding: 16px;
    background: #FFF8E1;
    border-left: 4px solid #FFC107;
    border-radius: 8px;
    margin-bottom: 24px;
}

.quiz-answers {
    margin: 16px 0;
}

.quiz-answer-card {
    background: #FFFFFF;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 16px 20px;
    margin-bottom: 16px;
    border-left: 4px solid #DDD;
}

.quiz-answer-card.correct {
    border-left-color: #7CFC00;
    background: #FAFFF5;
}

.quiz-answer-card.wrong {
    border-left-color: #C71585;
    background: #FFF7FB;
}

.quiz-answer-options {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.quiz-answer-options li {
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 6px;
    font-size: 15px;
    background: #F9F7FC;
}

.quiz-answer-options li.opt-correct {
    background: #E8F8D8;
    font-weight: 600;
    color: #1A237E;
}

.quiz-answer-options li.opt-wrong {
    background: #FFE8F0;
    color: #C71585;
}

.quiz-answer-options li small {
    color: #666;
    font-size: 12px;
}

.quiz-explanation {
    margin-top: 12px;
    padding: 12px 16px;
    background: #F0F4FF;
    border-left: 4px solid #0693e3;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    color: #2E1A47;
}

.quiz-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    flex-wrap: wrap;
    justify-content: center;
}


/* ===== QUIZ: неотвеченный вопрос ===== */
.quiz-question.missing-answer {
    border: 2px solid #C71585;
    box-shadow: 0 0 12px rgba(199, 21, 133, 0.3);
    animation: shake 0.4s ease;
}

.quiz-question.missing-answer::after {
    content: "Ответьте на этот вопрос";
    display: block;
    margin-top: 12px;
    padding: 8px 12px;
    background: #FFE8F0;
    color: #C71585;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}


/* ===== MENU + FOOTER ===== */
.site-header {
    background: #FFFFFF;
    border-bottom: 3px solid #7CFC00;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #2E1A47;
    font-family: 'Oswald', sans-serif;
    font-size: 24px;
    font-weight: 600;
}
.logo img {
    height: 56px;
    width: auto;
    border-radius: 8px;
}

/* Бургер — только на мобильных */
.burger {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #2E1A47;
    padding: 4px 10px;
}

/* Основное меню */
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.main-nav > a,
.nav-item > a {
    color: #2E1A47;
    text-decoration: none;
    font-family: 'Oswald', sans-serif;
    font-size: 15px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: 0.2s ease;
    white-space: nowrap;
}
.main-nav > a:hover,
.nav-item > a:hover {
    background: #F0F8E8;
    color: #1A237E;
}

/* Выпадающее подменю */
.nav-item {
    position: relative;
}
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 220px;
    padding: 8px 0;
    margin-top: 4px;
    z-index: 200;
}
.nav-item:hover .submenu {
    display: block;
}
.submenu a {
    display: block;
    padding: 10px 16px;
    color: #3A3A3A;
    text-decoration: none;
    font-size: 14px;
    transition: 0.15s ease;
}
.submenu a:hover {
    background: #F0F8E8;
    color: #1A237E;
}

/* Кнопки входа / регистрации */
.nav-auth {
    display: flex;
    gap: 8px;
    margin-left: 12px;
}
.btn-login,
.btn-register {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    transition: 0.2s ease;
}
.btn-login {
    background: transparent;
    color: #1A237E;
    border: 2px solid #1A237E;
}
.btn-login:hover {
    background: #1A237E;
    color: #FFFFFF;
}
.btn-register {
    background: #1A237E;
    color: #FFFFFF;
    border: 2px solid #1A237E;
}
.btn-register:hover {
    background: #7CFC00;
    color: #1A237E;
    border-color: #7CFC00;
}

/* Мобильные */
@media (max-width: 900px) {
    .burger { display: block; }
    .main-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        align-items: stretch;
        padding: 8px 0;
    }
    .main-nav.open { display: flex; }
    .nav-item { width: 100%; }
    .nav-item > a { display: block; padding: 12px 16px; }
    .submenu {
        position: static;
        box-shadow: none;
        border: none;
        background: #F9F7FC;
        margin: 0;
        border-radius: 0;
    }
    .nav-auth {
        margin: 8px 0;
        justify-content: center;
    }
}

/* ===== FOOTER ===== */
.site-footer {
    background: #000000;
    color: #FFFFFF;
    margin-top: 48px;
    padding: 48px 24px 16px;
}
.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
    gap: 32px;
    align-items: start;
}
.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}
.footer-logo-big {
    height: 80px;
    width: auto;
    border-radius: 10px;
}
.footer-logo-text {
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    line-height: 1.3;
    color: #FFFFFF;
    font-weight: 600;
    text-align: center;
}
.footer-col {
    text-align: left;
    padding-top: 56px;
}
.footer-col h4 {
    font-family: 'Oswald', sans-serif;
    color: #7CFC00;
    font-size: 16px;
    margin: 0 0 14px 0;
    text-align: center;
}
.footer-col a {
    display: block;
    color: #DDDDDD;
    text-decoration: none;
    font-size: 14px;
    padding: 5px 0;
    transition: 0.2s ease;
    text-align: left;
}
.footer-col a:hover {
    color: #7CFC00;
}
.footer-req-center {
    max-width: 900px;
    margin: 40px auto 0;
    padding-top: 24px;
    border-top: 1px solid #333333;
    text-align: center;
    font-size: 16px;
    line-height: 1.8;
    color: #CCCCCC;
}
.footer-bottom {
    max-width: 1400px;
    margin: 24px auto 0;
    padding-top: 16px;
    border-top: 1px solid #222222;
    text-align: center;
    font-size: 14px;
    color: #999999;
}

@media (max-width: 900px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
    .footer-brand {
        grid-column: 1 / -1;
    }
    .footer-logo-big { height: 80px; }
    .footer-col { padding-top: 16px; }
}
@media (max-width: 600px) {
    .footer-inner {
        grid-template-columns: 1fr;
    }
    .footer-logo-big { height: 70px; }
}
/* ===== FACTORY PAGE ===== */
.factory-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}
.factory-hero {
    text-align: center;
    padding: 48px 24px;
    background: linear-gradient(135deg, #1A237E 0%, #2E1A47 100%);
    color: #FFFFFF;
    border-radius: 16px;
    margin-bottom: 48px;
}
.factory-hero h1 {
    color: #7CFC00;
    font-size: 48px;
    margin-bottom: 16px;
}
.factory-tagline {
    font-family: 'Oswald', sans-serif;
    font-size: 22px;
    line-height: 1.5;
    color: #FFFFFF;
    margin-bottom: 32px;
}
.factory-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
.btn-big {
    padding: 14px 28px !important;
    font-size: 17px !important;
}
.factory-block {
    margin-bottom: 48px;
    padding: 32px 24px;
    background: #F9F7FC;
    border-radius: 12px;
}
.factory-block h2 {
    text-align: center;
    font-size: 32px;
    color: #2E1A47;
    margin-bottom: 24px;
}
.factory-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 900px) {
    .factory-steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .factory-steps { grid-template-columns: 1fr; }
    .factory-hero h1 { font-size: 32px; }
    .factory-tagline { font-size: 18px; }
}
.factory-step {
    background: #FFFFFF;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: center;
}
.step-num {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    background: #1A237E;
    color: #7CFC00;
    font-family: 'Oswald', sans-serif;
    font-size: 22px;
    border-radius: 50%;
    margin-bottom: 12px;
}
.factory-step h3 {
    font-size: 18px;
    color: #2E1A47;
    margin: 8px 0 8px;
}
.factory-step p {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin: 0;
}
.factory-list {
    list-style: none;
    padding: 0;
    margin: 0 auto 24px;
    max-width: 500px;
    font-size: 16px;
    line-height: 2;
    color: #2E1A47;
}
.factory-list li { margin: 4px 0; }
.factory-partners,
.factory-contest,
.factory-biz,
.factory-faq,
.factory-cta-final {
    text-align: center;
}
.factory-partners p,
.factory-contest p,
.factory-biz p {
    font-size: 16px;
    color: #555;
    max-width: 600px;
    margin: 0 auto 20px;
}
.factory-faq details {
    max-width: 600px;
    margin: 8px auto;
    padding: 12px 16px;
    background: #FFFFFF;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
}
.factory-faq summary {
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    color: #2E1A47;
    font-weight: 600;
}
.factory-faq details p {
    margin: 8px 0 0;
    color: #555;
    font-size: 15px;
}
.factory-cta-final {
    padding: 48px 24px;
    background: linear-gradient(135deg, #F0F8E8 0%, #E8F0FE 100%);
    border-radius: 16px;
}
.factory-cta-final h2 {
    font-size: 32px;
    margin-bottom: 24px;
}




/* === ФИНАЛ: лого вровень с заголовками === */

/* Контейнер: 5 колонок, лого в первой */
.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr;
    gap: 32px;
    align-items: start;
}

/* Лого: слева, без отступа сверху — вровень с заголовками столбцов */
.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 8px;
    margin-top: 0;
    padding-top: 0;
}

/* Лого — размер тут */
.footer-logo-big {
    height: 80px;
    width: auto;
    border-radius: 10px;
    display: block;
}

/* Название под лого — слева */
.footer-logo-text {
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    line-height: 1.3;
    color: #FFFFFF;
    font-weight: 600;
    text-align: left;
}

/* Столбцы — без отступа сверху, чтобы быть вровень с лого */
.footer-col {
    text-align: left;
    padding-top: 0;
}

/* Заголовки столбцов — по левому краю */
.footer-col h4 {
    font-family: 'Oswald', sans-serif;
    color: #7CFC00;
    font-size: 16px;
    margin: 0 0 14px 0;
    text-align: left;
}

/* Ссылки — слева */
.footer-col a {
    display: block;
    color: #DDDDDD;
    text-decoration: none;
    font-size: 14px;
    padding: 5px 0;
    transition: 0.2s ease;
    text-align: left;
}

.footer-col a:hover {
    color: #7CFC00;
}

/* === ЛОГО ПО ЦЕНТРУ === */
.footer-brand {
    align-items: center !important;
    text-align: center !important;
}
.footer-logo-text {
    text-align: center !important;
}
.footer-logo-big {
    display: block !important;
    margin: 0 auto !important;
}

/* Лого шире, остальные равные */
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.footer-logo {
  width: 80px;
  height: auto;
  border-radius: 50%;
}

.footer-title {
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 600;
}

.footer-heading {
  color: #7CFC00; /* Салатовый из палитры */
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.footer-col a {
  display: block;
  color: #ccc;
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #8B4513;
}

.footer-legal {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #333;
  font-size: 13px;
  color: #888;
  line-height: 1.5;
}

.footer-bottom {
  text-align: center;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #333;
  font-size: 12px;
  color: #555;
}

/* Адаптив для мобилок */
@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: span 2;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 500px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .footer-brand {
    grid-column: span 1;
  }
}

/* Голубой из палитры */
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.footer-dynamic-block p {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 15px;
  color: #aaa;
}

.footer-cta-btn {
  display: inline-block;
  background-color: #1A237E; /* Темно-синий из палитры */
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: background-color 0.2s, transform 0.1s;
}

.footer-cta-btn:hover {
  background-color: #8B4513; /* Коричневый из палитры */
  transform: translateY(-1px);
}



/* --- FOOTER GRID (FORCED) --- */
.site-footer {
  background-color: #111 !important;
  color: #ccc !important;
  padding: 40px 20px 20px !important;
  margin-top: 40px !important;
  font-family: 'Open Sans', sans-serif !important;
  font-size: 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.footer-inner {
  display: grid !important;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr !important; /* Лого шире, остальные равные */
  gap: 30px !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  align-items: start !important;
  text-align: left !important;
}

.footer-brand {
  display: flex !important;
  flex-direction: column !important;
  gap: 15px !important;
  text-align: left !important;
}

.footer-logo {
  width: 80px !important;
  height: auto !important;
  border-radius: 50% !important;
}

.footer-title {
  color: #fff !important;
  font-family: 'Oswald', sans-serif !important;
  font-size: 18px !important;
  line-height: 1.2 !important;
  font-weight: 600 !important;
}

.footer-heading {
  color: #7CFC00 !important; /* Салатовый */
  font-family: 'Oswald', sans-serif !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  margin-bottom: 15px !important;
  text-transform: uppercase !important;
}

.footer-col a {
  display: block !important;
  color: #ccc !important;
  text-decoration: none !important;
  margin-bottom: 10px !important;
  transition: color 0.2s !important;
}

.footer-col a:hover {
  color: #8B4513 !important;
}

/* Динамический блок в подвале */
.footer-dynamic-block {
  margin-top: 20px !important;
  padding-top: 15px !important;
  border-top: 1px solid #333 !important;
  color: #ccc !important;
}

.footer-dynamic-block h4 {
  color: #0693e3 !important; /* Голубой */
  font-family: 'Oswald', sans-serif !important;
  font-size: 15px !important;
  margin-bottom: 8px !important;
  text-transform: uppercase !important;
}

.footer-dynamic-block p {
  font-size: 13px !important;
  line-height: 1.5 !important;
  margin-bottom: 15px !important;
  color: #aaa !important;
}

.footer-cta-btn {
  display: inline-block !important;
  background-color: #1A237E !important; /* Темно-синий */
  color: #fff !important;
  padding: 8px 16px !important;
  border-radius: 4px !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  transition: background-color 0.2s, transform 0.1s !important;
  border: none !important;
}

.footer-cta-btn:hover {
  background-color: #8B4513 !important;
  transform: translateY(-1px) !important;
}

.footer-legal {
  text-align: center !important;
  margin-top: 40px !important;
  padding-top: 20px !important;
  border-top: 1px solid #333 !important;
  font-size: 13px !important;
  color: #888 !important;
  line-height: 1.5 !important;
}

.footer-bottom {
  text-align: center !important;
  margin-top: 20px !important;
  padding-top: 15px !important;
  border-top: 1px solid #333 !important;
  font-size: 12px !important;
  color: #555 !important;
}

/* Адаптив для планшетов */
@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr !important;
  }
  .footer-brand {
    grid-column: span 2 !important;
    align-items: center !important;
    text-align: center !important;
  }
}

/* Адаптив для мобилок */
@media (max-width: 500px) {
  .footer-inner {
    grid-template-columns: 1fr !important;
  }
  .footer-brand {
    grid-column: span 1 !important;
  }
}



/* Строго в строку */
  flex-wrap: wrap !important;    /* Разрешаем перенос на мобильных */
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: 20px !important;
  width: 100% !important;
}

.top-block-brand {
  flex: 0 0 250px !important; /* Фиксированная ширина для логотипа */
  max-width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.top-block-logo {
  width: 80px !important;
  height: auto !important;
  border-radius: 50% !important;
}

.top-block-title {
  color: #fff !important;
  font-family: 'Oswald', sans-serif !important;
  font-size: 18px !important;
  line-height: 1.2 !important;
  font-weight: 600 !important;
}

.top-block-col {
  flex: 1 1 150px !important; /* Колонки растягиваются */
  min-width: 120px !important;
}

.top-block-heading {
  color: #7CFC00 !important;
  font-family: 'Oswald', sans-serif !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  margin-bottom: 15px !important;
  text-transform: uppercase !important;
  border-bottom: 1px solid #333 !important;
  padding-bottom: 5px !important;
}

.top-block-col a {
  display: block !important;
  color: #ccc !important;
  text-decoration: none !important;
  margin-bottom: 8px !important;
  transition: color 0.2s !important;
}

.top-block-col a:hover {
  color: #8B4513 !important;
}

.top-block-dynamic {
  margin-top: 10px !important;
  padding-top: 15px !important;
  border-top: 1px solid #333 !important;
}

.top-block-dynamic h4 {
  color: #0693e3 !important;
  font-family: 'Oswald', sans-serif !important;
  font-size: 15px !important;
  margin-bottom: 8px !important;
  text-transform: uppercase !important;
}

.top-block-dynamic p {
  font-size: 13px !important;
  line-height: 1.5 !important;
  margin-bottom: 15px !important;
  color: #aaa !important;
}

.top-block-cta-btn {
  display: inline-block !important;
  background-color: #1A237E !important;
  color: #fff !important;
  padding: 8px 16px !important;
  border-radius: 4px !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  transition: background-color 0.2s !important;
  border: none !important;
  text-align: center !important;
}

.top-block-cta-btn:hover {
  background-color: #8B4513 !important;
}

.top-block-legal {
  text-align: center !important;
  margin-top: 30px !important;
  padding-top: 20px !important;
  border-top: 1px solid #333 !important;
  font-size: 13px !important;
  color: #888 !important;
  line-height: 1.5 !important;
  width: 100% !important;
}

/* На мобилках колонки уходят вниз */
@media (max-width: 768px) {
  .top-block-inner {
    flex-direction: column !important;
    align-items: center !important;
  }
  .top-block-brand {
    flex: 1 1 auto !important;
    width: 100% !important;
    align-items: center !important;
    text-align: center !important;
  }
  .top-block-col {
    flex: 1 1 auto !important;
    width: 100% !important;
    text-align: center !important;
  }
}



/* ??????????? ??????? ?? ?????? */
  gap: 30px !important;
  width: 100% !important;
}

/* ????? ????? ? ????????? */
.top-block-brand {
  flex: 0 0 260px !important;
  display: flex !important;
  flex-direction: column !important;
}

.top-block-logo {
  width: 80px !important;
  height: 80px !important; /* ????????? ?????? */
  object-fit: contain !important;
  margin-bottom: 15px !important;
}

.top-block-title {
  color: #fff !important;
  font-family: 'Oswald', sans-serif !important;
  font-size: 18px !important;
  line-height: 1.2 !important;
  font-weight: 600 !important;
  margin-bottom: 20px !important;
}

/* ???????????? ???? */
.top-block-dynamic {
  margin-top: auto !important; /* ????????? ? ????, ???? ????? */
  padding-top: 15px !important;
  border-top: 1px solid #333 !important;
}

.top-block-dynamic h4 {
  color: #0693e3 !important;
  font-family: 'Oswald', sans-serif !important;
  font-size: 15px !important;
  margin-bottom: 8px !important;
  text-transform: uppercase !important;
  line-height: 1.3 !important;
}

.top-block-dynamic p {
  font-size: 13px !important;
  line-height: 1.4 !important;
  margin-bottom: 15px !important;
  color: #aaa !important;
}

.top-block-cta-btn {
  display: inline-block !important;
  background-color: #1A237E !important;
  color: #fff !important;
  padding: 8px 16px !important;
  border-radius: 4px !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  text-align: center !important;
  border: none !important;
}

.top-block-cta-btn:hover {
  background-color: #8B4513 !important;
}

/* 4 ??????? ???? */
.top-block-col {
  flex: 1 1 0% !important; /* ?????????? ???????????? ????? */
  display: flex !important;
  flex-direction: column !important;
}

.top-block-heading {
  color: #7CFC00 !important;
  font-family: 'Oswald', sans-serif !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  margin-bottom: 15px !important;
  text-transform: uppercase !important;
  border-bottom: 1px solid #333 !important;
  padding-bottom: 8px !important;
}

.top-block-col a {
  display: block !important;
  color: #ccc !important;
  text-decoration: none !important;
  margin-bottom: 10px !important;
  font-size: 14px !important;
}

.top-block-col a:hover {
  color: #8B4513 !important;
}

/* ??????? */
@media (max-width: 900px) {
  .top-block-inner {
    flex-wrap: wrap !important; /* ????????? ??????? */
  }
  .top-block-brand {
    flex: 0 0 100% !important; /* ???? ?? ??? ?????? */
    margin-bottom: 20px !important;
  }
  .top-block-col {
    flex: 1 1 45% !important; /* ?? 2 ??????? ? ??? */
  }
}

@media (max-width: 500px) {
  .top-block-col {
    flex: 1 1 100% !important; /* ?? 1 ??????? */
  }
}



/* --- TOP HORIZONTAL BLOCK (FINAL) --- */
.top-horizontal-block { background-color: #111 !important; color: #ccc !important; padding: 30px 20px !important; margin: 30px auto !important; max-width: 1200px !important; width: 100% !important; font-family: 'Open Sans', sans-serif !important; font-size: 14px !important; box-sizing: border-box !important; border-radius: 8px !important; }
.top-block-inner { display: flex !important; flex-direction: row !important; justify-content: space-between !important; align-items: stretch !important; gap: 30px !important; width: 100% !important; }
.top-block-brand { flex: 0 0 260px !important; display: flex !important; flex-direction: column !important; }
.top-block-logo { width: 80px !important; height: 80px !important; object-fit: contain !important; margin-bottom: 15px !important; }
.top-block-title { color: #fff !important; font-family: 'Oswald', sans-serif !important; font-size: 18px !important; line-height: 1.2 !important; font-weight: 600 !important; margin-bottom: 20px !important; }
.top-block-dynamic { margin-top: auto !important; padding-top: 15px !important; border-top: 1px solid #333 !important; }
.top-block-dynamic h4 { color: #0693e3 !important; font-family: 'Oswald', sans-serif !important; font-size: 15px !important; margin-bottom: 8px !important; text-transform: uppercase !important; line-height: 1.3 !important; }
.top-block-dynamic p { font-size: 13px !important; line-height: 1.4 !important; margin-bottom: 15px !important; color: #aaa !important; }
.top-block-cta-btn { display: inline-block !important; background-color: #1A237E !important; color: #fff !important; padding: 8px 16px !important; border-radius: 4px !important; text-decoration: none !important; font-weight: 600 !important; font-size: 13px !important; text-align: center !important; border: none !important; }
.top-block-cta-btn:hover { background-color: #8B4513 !important; }
.top-block-col { flex: 1 1 0% !important; display: flex !important; flex-direction: column !important; }
.top-block-heading { color: #7CFC00 !important; font-family: 'Oswald', sans-serif !important; font-size: 16px !important; font-weight: 600 !important; margin-bottom: 15px !important; text-transform: uppercase !important; border-bottom: 1px solid #333 !important; padding-bottom: 8px !important; }
.top-block-col a { display: block !important; color: #ccc !important; text-decoration: none !important; margin-bottom: 10px !important; font-size: 14px !important; }
.top-block-col a:hover { color: #8B4513 !important; }
@media (max-width: 900px) { .top-block-inner { flex-wrap: wrap !important; } .top-block-brand { flex: 0 0 100% !important; margin-bottom: 20px !important; } .top-block-col { flex: 1 1 45% !important; } }
@media (max-width: 500px) { .top-block-col { flex: 1 1 100% !important; } }



/* Уменьшаем расстояние между колонками */
}

.top-block-brand {
  flex: 0 0 220px !important; /* Делаем блок с лого чуть уже, чтобы дать место колонкам */
}

.top-block-col {
  flex: 1 1 0% !important; /* Колонки делят оставшееся место ровно поровну */
  min-width: 0 !important; /* Важно: разрешает колонкам сжиматься, если текст длинный */
  word-wrap: break-word !important; /* Перенос длинных слов (например, "Регистрация") */
}

.top-block-heading {
  white-space: nowrap !important; /* Заголовки колонок не будут переноситься на новую строку */
}



/* Центрируем лого и название */
  text-align: center !important;  /* Текст по центру */
}

.top-block-logo {
  margin-bottom: 10px !important;
}

.top-block-title {
  margin-bottom: 15px !important;
}

/* Делаем динамический блок (реплику + описание) в строку */
.top-block-dynamic {
  width: 100% !important;
  border-top: 1px solid #333 !important;
  padding-top: 15px !important;
  margin-top: auto !important;
}

.top-block-dynamic h4 {
  font-size: 14px !important; /* Чуть уменьшим, чтобы влезло в строку */
  margin-bottom: 5px !important;
}

.top-block-dynamic p {
  font-size: 12px !important;
  line-height: 1.3 !important;
  margin-bottom: 10px !important;
}

.top-block-cta-btn {
  width: 100% !important; /* Кнопка на всю ширину колонки */
  box-sizing: border-box !important;
}

/* Фикс для колонок, чтобы не вылезали */
.top-block-inner {
  gap: 15px !important;
}
.top-block-col {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  word-wrap: break-word !important;
}
.top-block-heading {
  white-space: nowrap !important;
}



/* --- NEW TOP BLOCK LAYOUT --- */
.top-horizontal-block { background-color: #111 !important; color: #ccc !important; padding: 30px 20px !important; margin: 30px auto !important; max-width: 1200px !important; width: 100% !important; font-family: 'Open Sans', sans-serif !important; font-size: 14px !important; box-sizing: border-box !important; border-radius: 8px !important; }
.top-block-inner { display: flex !important; flex-direction: row !important; justify-content: space-between !important; align-items: stretch !important; gap: 30px !important; width: 100% !important; }

/* Левая колонка */
.top-block-brand { flex: 0 0 220px !important; display: flex !important; flex-direction: column !important; align-items: center !important; text-align: center !important; }
.top-block-logo { width: 80px !important; height: 80px !important; object-fit: contain !important; margin-bottom: 10px !important; }
.top-block-title { color: #fff !important; font-family: 'Oswald', sans-serif !important; font-size: 18px !important; line-height: 1.2 !important; font-weight: 600 !important; margin-bottom: 15px !important; }

/* Правая часть с колонками и описанием */
.top-block-right { display: flex !important; flex-direction: column !important; flex: 1 1 auto !important; justify-content: space-between !important; }
.top-block-cols { display: flex !important; flex-direction: row !important; justify-content: space-between !important; gap: 15px !important; width: 100% !important; }
.top-block-col { flex: 1 1 0% !important; display: flex !important; flex-direction: column !important; }
.top-block-heading { color: #7CFC00 !important; font-family: 'Oswald', sans-serif !important; font-size: 15px !important; font-weight: 600 !important; margin-bottom: 15px !important; text-transform: uppercase !important; border-bottom: 1px solid #333 !important; padding-bottom: 8px !important; white-space: nowrap !important; }
.top-block-col a { display: block !important; color: #ccc !important; text-decoration: none !important; margin-bottom: 10px !important; font-size: 14px !important; }
.top-block-col a:hover { color: #8B4513 !important; }

/* Описание под колонками */
.top-block-desc { margin-top: 20px !important; padding-top: 15px !important; border-top: 1px solid #333 !important; }
.top-block-desc p { font-size: 15px !important; line-height: 1.5 !important; color: #aaa !important; margin: 0 !important; }

/* Кнопка в левой колонке */
.top-block-cta-btn { display: block !important; background-color: #1A237E !important; color: #fff !important; padding: 10px 15px !important; border-radius: 4px !important; text-decoration: none !important; font-weight: 600 !important; font-size: 14px !important; text-align: center !important; border: none !important; width: 100% !important; box-sizing: border-box !important; margin-top: auto !important; }
.top-block-cta-btn:hover { background-color: #8B4513 !important; }

/* Заголовок реплики в левой колонке (используется top-block-heading) */
.top-block-brand .top-block-heading { border: none !important; color: #0693e3 !important; text-transform: uppercase !important; margin-bottom: 10px !important; font-size: 15px !important; }

@media (max-width: 900px) {
  .top-block-inner { flex-direction: column !important; }
  .top-block-brand { flex: 1 1 auto !important; width: 100% !important; margin-bottom: 20px !important; }
  .top-block-cols { flex-wrap: wrap !important; }
  .top-block-col { flex: 1 1 45% !important; margin-bottom: 15px !important; }
}

/* --- QUIZ NAVIGATION BUTTONS --- */
.quiz-navigation .btn {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-navigation .btn-secondary {
    background: #eee;
    color: #333;
    border: 1px solid #ccc;
}

.quiz-navigation .btn-secondary:hover {
    background: #ddd;
}

.quiz-navigation .btn:not(.btn-secondary) {
    background: #1A237E; /* Синий из палитры */
    color: #fff;
    border: none;
}

.quiz-navigation .btn:not(.btn-secondary):hover {
    background: #8B4513; /* Коричневый */
}

.quiz-navigation .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Адаптив для мобилок */
@media (max-width: 600px) {
    .quiz-navigation > div {
        flex-direction: column;
        gap: 10px;
    }
    .quiz-navigation .btn {
        width: 100%;
        text-align: center;
    }
}

/* ========== MOBILE FIX 23.10.2026 ========== */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; width: 100%; }
  img, video, iframe { max-width: 100%; height: auto; }
  .container, .wrap, main { padding-left: 12px; padding-right: 12px; box-sizing: border-box; }
  .grid, .products-grid, .cards-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .card, .product-card { width: 100% !important; margin: 0 0 12px 0; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  h1 { font-size: 1.4rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
  .btn, button, .button { width: 100%; box-sizing: border-box; padding: 12px; font-size: 1rem; }
  .nav, .menu, header nav { flex-wrap: wrap; }
  .sidebar { display: none; }
  pre, code { white-space: pre-wrap; word-break: break-word; }
}

/* ===== MOBILE GRID FIX 23.10.2026 ===== */
@media (max-width: 768px) {
  .feed-grid, .syntx-grid, .factory-steps,
  .products-grid, .cards-grid, .grid {
    grid-template-columns: 1fr !important;
  }
  div.layout, /* old layout removed */
  .container, .wrap { width: 100% !important; max-width: 100% !important; }
  nav, header, .header, .topbar, .navbar {
    flex-wrap: wrap !important;
    gap: 8px;
  }
  nav a, .menu a { font-size: 0.9rem; padding: 8px 6px; }
  .logo, .brand { font-size: 1.1rem; }
}

/* ===== MOBILE INLINE FLEX/MODAL FIX 23.10.2026 ===== */
@media (max-width: 768px) {
  [style*="min-width: 280px"],
  [style*="min-width: 250px"],
  [style*="min-width: 200px"],
  [style*="min-width: 150px"] {
    min-width: 0 !important;
    flex: 1 1 100% !important;
    width: 100% !important;
  }
  [style*="max-width: 1200px"],
  [style*="max-width: 1100px"],
  [style*="max-width: 1000px"],
  [style*="max-width: 900px"],
  [style*="max-width: 800px"],
  [style*="max-width: 700px"],
  [style*="max-width: 600px"] {
    max-width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box;
  }
  .modal-content { width: 95% !important; max-width: 95% !important; }
  #psychotype-banner { left: 10px !important; right: 10px !important; bottom: 10px !important; max-width: none !important; width: auto !important; }
  form[style*="flex-direction: column"] input,
  form[style*="flex-direction: column"] textarea { width: 100% !important; box-sizing: border-box; }
}

/* ПОЛНЫЙ ФИКС САЙДБАРА */
div.layout > aside.sidebar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
}
@media (max-width: 600px) {
    div.layout > aside.sidebar {
        display: none !important;
    }
}


/* --- CLEAN LAYOUT FIX --- */
div/* old layout removed */

div.layout > main.layout-main {
    min-width: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

div.layout > aside.sidebar {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
    position: static !important;
}

@media (max-width: 900px) {
    div/* old layout removed */
    div.layout > aside.sidebar {
        display: none !important;
    }
}

/* Мобильная адаптация сайдбара — не скрываем, а переносим вниз */
@media (max-width: 900px) {
    div/* old layout removed */
    div.layout > aside.sidebar {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        position: relative !important;
        margin-top: 20px !important;
    }
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ ДЛЯ /fun ===== */
@media (max-width: 768px) {
    /* Контейнер страницы */
    .fun-page-container {
        padding: 10px !important;
    }
    
    /* Формы создания (анекдот и шутка) в одну колонку */
    .fun-forms-wrap {
        flex-direction: column !important;
        gap: 16px !important;
    }
    .fun-forms-wrap > div {
        min-width: 100% !important;
        padding: 16px !important;
    }
    
    /* Карточки постов: картинка вниз, текст на всю ширину */
    .post-card {
        flex-direction: column !important;
    }
    .post-card > div {
        width: 100% !important;
        max-width: 100% !important;
    }
    .post-body-image {
        width: 100% !important;
        margin-bottom: 12px !important;
    }
    
    /* Реклама 970×250 — делаем резиновой */
    .ad-slot[data-slot="yandex-rsya-middle"] {
        height: 150px !important;
        font-size: 13px !important;
        padding: 10px !important;
    }
    
    /* Чёрная плашка с меню */
    .footer-dark {
        padding: 16px !important;
        margin: 16px 0 !important;
    }
    .footer-dark > div {
        flex-direction: column !important;
        gap: 16px !important;
    }
    .footer-dark > div > div {
        min-width: 100% !important;
        text-align: center !important;
    }
    .footer-dark a {
        display: inline-block !important;
        margin: 4px 6px !important;
    }
    
    /* Модалка */
    #jokeModal > div {
        padding: 16px !important;
        width: 95% !important;
    }
    #jokeModal h2 {
        font-size: 18px !important;
    }
    #modalJokeText {
        font-size: 14px !important;
    }
    
    /* Лента */
    #feed {
        gap: 12px !important;
    }
    
    /* Кнопки в постах — на всю ширину */
    .post-card button, .post-card a {
        flex: 1 1 auto !important;
        text-align: center !important;
        font-size: 12px !important;
        padding: 8px 10px !important;
    }
}

@media (max-width: 480px) {
    /* Совсем узкие экраны */
    .footer-dark h3, .footer-dark div[style*="color:#28a745"] {
        font-size: 12px !important;
    }
    .ad-slot[data-slot="yandex-rsya-middle"] {
        height: 100px !important;
    }
    .post-card {
        padding: 12px !important;
    }
    .post-card > div[style*="font-size:16px"] {
        font-size: 14px !important;
    }
}

/* ===== ГЛОБАЛЬНАЯ МОБИЛЬНАЯ ВЕРСИЯ (весь сайт) ===== */
@media (max-width: 900px) {
    /* 1. Убираем горизонтальную прокрутку */
    html, body {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
    
    /* 2. Все крупные контейнеры — на всю ширину */
    .layout, .container, .content, .main, main {
        max-width: 100% !important;
        width: 100% !important;
        padding: 10px !important;
        margin: 0 !important;
    }
    
    /* 3. Сетки в одну колонку */
    div/* old layout removed */
    div.layout > main.layout-main,
    div.layout > aside.sidebar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    div.layout > aside.sidebar {
        margin-top: 20px !important;
        position: relative !important;
    }
    
    /* 4. Все flex-контейнеры — в столбик */
    .row, .grid, .flex-row, .cards, .columns, [style*="display:flex"][style*="flex-wrap"] {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    /* 5. Карточки постов, формы — на всю ширину */
    .post-card, .card, .form-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* 6. Изображения не вылезают */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* 7. Чёрные плашки (меню) */
    .footer-dark {
        padding: 16px !important;
        margin: 16px 0 !important;
    }
    .footer-dark > div {
        flex-direction: column !important;
    }
    
    /* 8. Таблицы — скролл, но не ломают верстку */
    table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 600px) {
    /* Еще сильнее для маленьких телефонов */
    body {
        font-size: 14px !important;
    }
    h1 { font-size: 22px !important; }
    h2 { font-size: 18px !important; }
    h3 { font-size: 16px !important; }
    
    .post-card, .card, .form-card {
        padding: 12px !important;
    }
    
    input, textarea, select, button {
        font-size: 16px !important; /* против зума на iOS */
    }
    
    /* Прячем лишние отступы */
    [style*="margin: 40px"], [style*="margin:40px"] {
        margin: 16px 0 !important;
    }
}

/* ===== ГЛОБАЛЬНАЯ АДАПТИВНОСТЬ ===== */
/* old container removed */

/* Сайдбар по умолчанию (десктоп) */
div.layout > aside.sidebar {
    width: 300px;
    min-width: 300px;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    /* old container removed */
    div/* old layout removed */
    div.layout > aside.sidebar {
        width: 100% !important;
        min-width: 0 !important;
        margin-top: 20px !important;
    }
}

/* ========== ЯДЕРНЫЙ ФИКС ДЛЯ МОБИЛЬНЫХ (ВСЁ В ОДНУ КОЛОНКУ) ========== */
@media (max-width: 900px) {
    /* 1. Убираем любые жесткие ширины у всех блоков */
    body, html, div, section, main, aside, header, footer, article, .layout, .container, .content, .post-card, .fun-page-container {
        max-width: 100vw !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* 2. Все flex-контейнеры (формы, посты, лента) в колонку */
    div[style*="display: flex"], div[style*="display:flex"], .row, .flex-row {
        flex-direction: column !important;
        gap: 16px !important;
    }

    /* 3. Все блоки, которые были в ряд, становятся на всю ширину */
    div[style*="display: flex"] > div, div[style*="display:flex"] > div, .post-card > div {
        min-width: 100% !important;
        width: 100% !important;
    }

    /* 4. Картинки и видео не вылезают */
    img, video, iframe {
        max-width: 100% !important;
        height: auto !important;
    }

    /* 5. Сайдбар и главный контент — друг под другом */
    /* old layout removed */
    .layout-main, .sidebar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 0 20px 0 !important;
    }

    /* 6. Реклама Яндекс 970x250 не должна ломать экран */
    .ad-slot, [data-slot="yandex-rsya-middle"] {
        height: auto !important;
        min-height: 150px !important;
        width: 100% !important;
    }

    /* 7. Чёрная плашка с меню — в столбик */
    .footer-dark > div {
        flex-direction: column !important;
        text-align: center !important;
    }
    .footer-dark a {
        display: block !important;
        margin-bottom: 8px !important;
    }
}

/* ===== ЖЕСТКИЙ ФИКС САЙДБАРА НА МОБИЛЬНЫХ ===== */
@media (max-width: 900px) {
    div.layout > aside.sidebar {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        float: none !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 20px 0 0 0 !important;
        padding: 0 !important;
        z-index: 1 !important;
        clear: both !important;
        order: 2 !important; /* чтобы он был после main */
    }
    div.layout > main.layout-main {
        order: 1 !important; /* контент всегда первый */
        width: 100% !important;
        max-width: 100% !important;
    }
    div/* old layout removed */
}

/* ===== БАЗОВАЯ СЕТКА (десктоп) ===== */
div/* old layout removed */

/* ===== МОБИЛЬНАЯ СЕТКА (одна колонка) ===== */
@media (max-width: 900px) {
    div/* old layout removed */
    div.layout > main.layout-main {
        width: 100% !important;
        max-width: 100% !important;
        order: 1 !important;
    }
    div.layout > aside.sidebar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        position: relative !important;
        order: 2 !important;
        margin-top: 10px !important;
        display: flex !important;
        flex-direction: column !important;
    }
}



/* БРОНЕЖИЛЕТ ДЛЯ SALEADS */
.saleads-box {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 150px !important;
    overflow: hidden !important;
    display: block !important;
    position: relative !important;
    z-index: 1 !important;
    margin: 15px 0 !important;
    box-sizing: border-box !important;
}

.saleads-box * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* 1. Возвращаем плавающий баннер на место */
.float-banner, .sticky-banner, div[style*="position: fixed"] {
    position: fixed !important;
    left: 0 !important;
    top: 20% !important;
    z-index: 1000 !important;
}

/* 2. Жестко задаем размеры для Saleads, чтобы скрипт их увидел */



/* Плавающий сайдбар */
aside.sidebar {
    position: static !important;
    top: 20px !important;
    height: fit-content !important;
    
    overflow: visible !important;
}

/* Ограничиваем все элементы внутри наших бронежилетов */
div[style*="overflow:hidden; position:relative;"] * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Сайдбар */
aside.sidebar {
    margin-bottom: 40px !important;
}

/* Жесткая фиксация правого сайдбара */
aside.sidebar {
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
    flex: 0 0 300px !important;
    margin-left: 20px !important;
    margin-right: 0 !important;
    float: right !important;
    display: block !important;
    background: transparent !important;
}

/* Контейнер, в котором они лежат */
/* old layout removed */

.layout-main {
    flex: 1 !important;
    min-width: 0 !important;
}

/* Убираем пустые белые полосы от Saleads */
#saleads-offers-1 {
    min-height: 0 !important;
    height: auto !important;
}
#saleads-offers-1:empty {
    display: none !important;
}

/* Баннеры в сайдбаре */
.sidebar-ad, .sidebar-banner {
    margin-bottom: 15px !important;
    width: 100% !important;
}
.sidebar-ad img {
    max-width: 100% !important;
    height: auto !important;
}

/* Красивый сайдбар */
aside.sidebar {
    width: 300px !important;
    flex: 0 0 300px !important;
    background: transparent !important;
    padding: 0 !important;
    margin-left: 20px !important;
    display: block !important;
}

/* Возвращаем белые блоки с тенями */
aside.sidebar .sidebar-block {
    background: #fff !important;
    border-radius: 12px !important;
    padding: 16px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Убираем пустые полосы, если остались */
aside.sidebar .sidebar-block:empty {
    display: none !important;
}

/* Сетка контента */
/* old layout removed */

/* Жесткая сетка */
/* old layout removed */
.layout-main {
    flex: 1 !important;
    min-width: 0 !important;
}
aside.sidebar {
    width: 300px !important;
    min-width: 300px !important;
    flex: 0 0 300px !important;
    display: block !important;
}
/* Блоки внутри сайдбара */
aside.sidebar .sidebar-block {
    background: #fff !important;
    border-radius: 12px !important;
    padding: 16px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* --- ПРИЖИМАЕМ К КРАЯМ --- */
body, html {
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
}
/* old container removed */
/* old layout removed */

/* --- АБСОЛЮТНАЯ СЕТКА (ФИНАЛ) --- */
body, html {
    margin: 0 !important; padding: 0 !important; width: 100vw !important; max-width: 100vw !important; overflow-x: hidden !important;
}
.site-container {
    max-width: 100vw !important; width: 100vw !important; padding: 0 !important; margin: 0 !important; display: block !important;
}
.layout {
    display: grid !important; grid-template-columns: 300px minmax(0, 1fr) 300px !important; gap: 20px !important;
    width: 100vw !important; max-width: 100vw !important; padding: 20px !important; margin: 0 !important;
    box-sizing: border-box !important; align-items: start !important;
}
.sidebar {
    width: 300px !important; flex: none !important; margin: 0 !important;
}
.layout-main {
    min-width: 0 !important; width: 100% !important; flex: none !important; margin: 0 !important;
}
.ad-container {
    width: 100vw !important; position: relative !important; left: 50% !important; right: 50% !important;
    margin-left: -50vw !important; margin-right: -50vw !important; max-width: 100vw !important;
    box-sizing: border-box !important; padding: 0 !important;
}
