/* Стили страницы «documents». Вынесены из templates/main/base_documents.html без изменений:
   каскад тот же — <link> стоит там же, где стоял <style>. */
body {
        margin-top: 124px;
    }

    /* Ширина как на остальных страницах: main = 1200 и без собственных боковых
       полей — их на узких задаёт .container (20px). Раньше main брал 90% из
       main.css, а .container был content-box с padding 15px: слева получалось
       20+15=35px, а справа контент вылезал за main на 30px. */
    main {
        width: 100%;
        max-width: 1200px;
        padding-inline: 0;
        box-sizing: border-box;
    }

    .container {
        width: 100%;
        max-width: 1200px;
        box-sizing: border-box;
        margin: 0 auto;
        padding: 0;
    }
    @media (max-width: 1240px) { .container { padding-inline: 20px; } }
    
    /* Основной контейнер документов */
    .documents-main-container {
        display: flex;
        gap: 2rem;
        margin-bottom: 30px;
        padding-bottom: 20px;
    }
    
    /* Боковая панель навигации (как в вашем примере) */
    .main-sidebar {
        width: 270px;
        flex-shrink: 0;
        margin: 10px 0 30px 0;
        font-size: 14px;
    }
    
    /* Сайдбар раздела раскрытия — 1:1 из site2 (.disc-side button) */
    .main-nav-list {
        position: sticky;
        top: 120px;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .main-nav-item {
        text-align: left;
        padding: 13px 16px;
        border-radius: 8px;
        font-family: 'Montserrat', sans-serif;
        font-size: 14px;
        color: #474b58;
        border-left: 3px solid transparent;
        line-height: 1.35;
        cursor: pointer;
        transition: .16s;
        display: block;
        text-decoration: none;
    }

    .main-nav-item:hover {
        background: rgba(255,255,255,.55);
        -webkit-backdrop-filter: blur(16px) saturate(1.5);
        backdrop-filter: blur(16px) saturate(1.5);
        box-shadow: 0 2px 10px rgba(20,28,60,.05);
        border-left-color: #000f9f;
    }

    .main-nav-item.active {
        background: rgba(255,255,255,.55);
        -webkit-backdrop-filter: blur(16px) saturate(1.5);
        backdrop-filter: blur(16px) saturate(1.5);
        color: #000f9f;
        border-left-color: #000f9f;
        font-weight: 600;
        box-shadow: 0 2px 10px rgba(20,28,60,.05);
    }
    
    /* Контентная область */
    .main-content {
        flex-grow: 1;
    }
    
    /* Остальные стили */
    .breadcrumb {
        margin-bottom: 20px;
    }
    
    /* Адаптивность */
    @media (max-width: 1000px) {
        .documents-main-container {
            flex-direction: column;
        }
        
        .main-sidebar {
            width: 100%;
            margin: 10px 0 0 0;
        }
        
        .main-nav-item {
            white-space: nowrap;
        }
    }

    /* Хедер раздела раскрытия (PageHeader из site2) + баннер подписки */
    /* Крошки переносятся целыми пунктами: без wrap flex сжимал их и рвал по
       словам («Раскрытие / информации»). */
    .doc-crumbs { display: flex; flex-wrap: wrap; gap: 8px; row-gap: 4px; align-items: center; font-family: 'Montserrat', sans-serif; font-size: 13px; color: #83879a; margin-bottom: 22px; }
    .doc-crumbs a { color: #83879a; text-decoration: none; transition: color .2s; }
    .doc-crumbs a:hover { color: #000f9f; }
    .doc-crumbs .sep { opacity: .5; }
    @media (max-width: 560px) { .doc-crumbs { font-size: 12.5px; gap: 6px; } }
    .doc-hero { margin: 6px 0 26px; }
    .doc-eyebrow { font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #000b73; display: inline-flex; align-items: center; gap: 11px; }
    .doc-eyebrow::before { content: ""; width: 30px; height: 1.5px; background: #000f9f; display: inline-block; }
    .doc-title { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: clamp(30px, 4vw, 38px); line-height: 1.06; letter-spacing: -.02em; color: #14161d; margin: 14px 0 0; }
    .doc-sub { font-family: 'Montserrat', sans-serif; font-size: 16px; line-height: 1.55; color: #474b58; margin: 14px 0 0; max-width: 64ch; }
    .doc-subscribe { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 22px 26px; margin: 0 0 32px; background: rgba(255,255,255,.55); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6); border: 1px solid rgba(255,255,255,.7); border-radius: 16px; box-shadow: 0 2px 10px rgba(20,28,60,.05); }
    .doc-subscribe .ds-text b { display: block; font-family: 'Montserrat', sans-serif; font-size: 17px; font-weight: 700; color: #14161d; }
    .doc-subscribe .ds-text span { display: block; margin-top: 5px; font-family: 'Montserrat', sans-serif; font-size: 14px; color: #474b58; }
    .doc-subscribe .ds-btn { flex: none; display: inline-flex; align-items: center; gap: 10px; font-family: 'Montserrat', sans-serif; font-size: 15px; font-weight: 600; color: #fff; background: #000f9f; border: 0; border-radius: 999px; padding: 14px 26px; cursor: pointer; transition: background .2s, transform .2s; }
    .doc-subscribe .ds-btn:hover { background: #000b73; transform: translateY(-1px); }
    .doc-subscribe .ds-btn svg { width: 17px; height: 17px; }
    @media (max-width: 700px) { .doc-subscribe .ds-btn { width: 100%; justify-content: center; } }

    /* Модалка подписки на раскрытие (клиентская форма, как форма консультации site2) */
    .dsub-overlay { position: fixed; inset: 0; background: rgba(10,14,40,.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
    .dsub-overlay.open { display: flex; }
    .dsub-modal { background: #fff; border-radius: 18px; width: 100%; max-width: 480px; padding: 30px; box-shadow: 0 26px 64px rgba(9,13,48,.28); position: relative; font-family: 'Montserrat', sans-serif; max-height: 90vh; overflow-y: auto; }
    .dsub-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border: 0; background: #eef1f7; border-radius: 50%; cursor: pointer; color: #474b58; font-size: 20px; line-height: 1; display: grid; place-items: center; transition: background .2s; }
    .dsub-close:hover { background: #e0e5f0; }
    .dsub-modal h3 { margin: 0 0 6px; font-size: 20px; font-weight: 700; color: #14161d; }
    .dsub-modal .sub { margin: 0 0 20px; font-size: 14px; color: #474b58; line-height: 1.5; }
    .dsub-field { margin-bottom: 14px; }
    .dsub-field label { display: block; font-size: 13px; font-weight: 600; color: #474b58; margin-bottom: 6px; }
    .dsub-field input { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid #dfe3ec; border-radius: 10px; font-family: inherit; font-size: 14px; outline: none; transition: border-color .2s; }
    .dsub-field input:focus { border-color: #000f9f; }
    .dsub-selrow { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 12px; }
    .dsub-count { font-size: 13px; color: #83879a; }
    .dsub-all { background: none; border: 0; padding: 0; font-family: inherit; font-size: 13px; font-weight: 600; color: #000f9f; cursor: pointer; }
    .dsub-all:hover { text-decoration: underline; }
    .dsub-opts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
    .dsub-opt { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid #e2e6ef; border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
    .dsub-opt:hover { border-color: #c3cce6; }
    .dsub-opt:has(input:checked) { border-color: #000f9f; background: rgba(0,15,159,.04); }
    .dsub-opt input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
    .dsub-opt .cbx { flex: none; width: 18px; height: 18px; border: 1.5px solid #c3cce6; border-radius: 5px; display: grid; place-items: center; transition: background .15s, border-color .15s; }
    .dsub-opt .cbx::after { content: ""; width: 8px; height: 4.5px; border-left: 1.8px solid #fff; border-bottom: 1.8px solid #fff; transform: rotate(-45deg) translateY(-1px); opacity: 0; }
    .dsub-opt:has(input:checked) .cbx { background: #000f9f; border-color: #000f9f; }
    .dsub-opt:has(input:checked) .cbx::after { opacity: 1; }
    .dsub-opt .txt { font-size: 14px; color: #14161d; line-height: 1.35; }
    /* Чекбокс согласия — тот же кастомный вид, что у чекбоксов фондов */
    .dsub-consent { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; margin: 0 0 16px; font-size: 13px; color: #474b58; line-height: 1.4; }
    .dsub-consent input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
    .dsub-consent .cbx { flex: none; width: 18px; height: 18px; margin-top: 1px; border: 1.5px solid #c3cce6; border-radius: 5px; display: grid; place-items: center; transition: background .15s, border-color .15s; }
    .dsub-consent .cbx::after { content: ""; width: 8px; height: 4.5px; border-left: 1.8px solid #fff; border-bottom: 1.8px solid #fff; transform: rotate(-45deg) translateY(-1px); opacity: 0; }
    .dsub-consent:has(input:checked) .cbx { background: #000f9f; border-color: #000f9f; }
    .dsub-consent:has(input:checked) .cbx::after { opacity: 1; }
    /* Обязательная галочка: подсветка при попытке отправить без согласия */
    .dsub-consent.err { color: #d64545; }
    .dsub-consent.err .cbx { border-color: #d64545; }
    .dsub-email { margin-bottom: 16px; }
    .dsub-email.err input { border-color: #d64545; }
    .dsub-note { font-size: 12px; color: #83879a; text-align: center; line-height: 1.5; margin: 14px 0 0; }
    .dsub-submit { width: 100%; padding: 14px; background: #000f9f; color: #fff; border: 0; border-radius: 999px; font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .2s, transform .2s; }
    .dsub-submit:hover { background: #000b73; transform: translateY(-1px); }
    .dsub-ok { text-align: center; padding: 6px 0; }
    .dsub-ok .ic { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: rgba(47,109,37,.12); color: #2f6d25; display: grid; place-items: center; }
    .dsub-ok .ic svg { width: 28px; height: 28px; }
