/* ==========================================================================
   legal.css — оформление юридических страниц и галочек согласия
   Сайт: wallman.ru (NetCat, шаблон _wallman)
   Куда класть: /legal/legal.css  (в корне сайта, рядом с index.php)
   Подключается один раз — в шапке шаблона (Header.html).
   Все «страничные» правила ограничены областью .legal-page / .legal-shell,
   поэтому файл не конфликтует с вёрсткой сайта.
   ========================================================================== */

/* --- Каркас автономной юридической страницы ------------------------------ */

.legal-body {
    margin: 0;
    background: #fff;
}

.legal-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #262626;
}

.legal-shell__head {
    border-bottom: 1px solid #e6e6e6;
    background: #fff;
}

.legal-shell__foot {
    margin-top: auto;
    padding: 18px 24px;
    border-top: 1px solid #e6e6e6;
    font-size: 14px;
    color: #6b6b6b;
    background: #fafafa;
}

.legal-shell__head-inner,
.legal-shell__foot-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    align-items: center;
    padding: 14px 0;
}

.legal-shell__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    text-decoration: none;
    color: #1a1a1a;
}

.legal-shell__brand img {
    display: block;
    height: 28px;
    width: auto;
}

.legal-shell__nav {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    font-size: 14px;
}

.legal-shell__nav a {
    color: #6b6b6b;
    text-decoration: none;
}

.legal-shell__nav a:hover,
.legal-shell__nav a[aria-current="page"] {
    color: #8dad3e;
    text-decoration: underline;
}

.legal-shell__main {
    flex: 1 1 auto;
    width: 100%;
    max-width: 948px;
    margin: 0 auto;
    padding: 32px 24px 56px;
}

.legal-shell__foot-inner a {
    color: #6b6b6b;
}

/* --- Страница документа --------------------------------------------------- */

.legal-page {
    --legal-accent: #1a1a1a;
    --legal-text: #262626;
    --legal-muted: #6b6b6b;
    --legal-border: #e2e2e2;
    --legal-bg-soft: #f7f7f7;
    --legal-radius: 10px;

    box-sizing: border-box;
    max-width: 900px;
    margin: 0 auto;
    padding: 8px 0 48px;
    font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--legal-text);
    -webkit-text-size-adjust: 100%;
}

.legal-page *,
.legal-page *::before,
.legal-page *::after {
    box-sizing: border-box;
}

.legal-page h1,
.legal-page .legal-title {
    margin: 0 0 24px;
    font-size: 30px;
    line-height: 1.25;
    font-weight: 600;
    color: var(--legal-accent);
    letter-spacing: -0.01em;
}

.legal-page h2 {
    margin: 40px 0 16px;
    font-size: 21px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--legal-accent);
    scroll-margin-top: 90px;
}

.legal-page h3 {
    margin: 28px 0 12px;
    font-size: 17px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--legal-accent);
}

.legal-page p {
    margin: 0 0 14px;
}

.legal-page .legal-item {
    margin: 0 0 12px;
    padding-left: 2px;
}

.legal-page ul.legal-list,
.legal-page ol.legal-list {
    margin: 0 0 16px;
    padding-left: 24px;
}

.legal-page .legal-list li {
    margin: 0 0 8px;
}

.legal-page a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(0, 0, 0, .3);
    text-underline-offset: 2px;
}

.legal-page a:hover {
    text-decoration-color: currentColor;
}

.legal-page strong,
.legal-page b {
    font-weight: 600;
}

/* --- Содержание ---------------------------------------------------------- */

.legal-page .legal-toc {
    margin: 0 0 36px;
    padding: 18px 20px;
    border: 1px solid var(--legal-border);
    border-radius: var(--legal-radius);
    background: var(--legal-bg-soft);
}

.legal-page .legal-toc__title {
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--legal-muted);
}

.legal-page .legal-toc__list {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: toc;
}

.legal-page .legal-toc__list li {
    margin: 0;
    border-top: 1px solid var(--legal-border);
}

.legal-page .legal-toc__list li:first-child {
    border-top: 0;
}

.legal-page .legal-toc__list a {
    display: flex;
    gap: 10px;
    padding: 8px 2px;
    font-size: 15px;
    text-decoration: none;
}

.legal-page .legal-toc__list a:hover {
    text-decoration: underline;
}

.legal-page .legal-toc__num {
    flex: 0 0 auto;
    min-width: 26px;
    color: var(--legal-muted);
    font-variant-numeric: tabular-nums;
}

/* --- Таблицы ------------------------------------------------------------- */

.legal-page .legal-table-wrap {
    margin: 0 0 22px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--legal-border);
    border-radius: var(--legal-radius);
}

.legal-page .legal-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.5;
}

.legal-page .legal-table th,
.legal-page .legal-table td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    border: 1px solid var(--legal-border);
}

.legal-page .legal-table thead th {
    background: var(--legal-bg-soft);
    font-weight: 600;
    color: var(--legal-accent);
    white-space: nowrap;
}

.legal-page .legal-table tbody th[scope="row"] {
    font-weight: 600;
    background: #fbfbfb;
}

.legal-page .legal-table__group th {
    background: #efefef;
    font-weight: 600;
    text-align: left;
    color: var(--legal-accent);
}

/* --- Служебные блоки под документом -------------------------------------- */

.legal-page .legal-meta {
    margin: 32px 0 0;
    padding: 14px 16px;
    font-size: 14px;
    color: var(--legal-muted);
    border-left: 3px solid var(--legal-border);
}

.legal-page .legal-meta--top {
    margin: 0 0 28px;
}

.legal-page .legal-meta a {
    color: #4f6b16;
}

.legal-page .legal-docs {
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 14px;
}

.legal-page .legal-docs a {
    color: #4f6b16;
}

/* --- Галочка согласия в формах сайта ------------------------------------- */

.legal-consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 14px 0 18px;
    font-size: 13px;
    line-height: 1.5;
    color: #595959;
    text-align: left;
    cursor: pointer;
}

.legal-consent input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: #8dad3e;
    cursor: pointer;
}

.legal-consent a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-consent a:hover {
    color: #6f8a2b;
}

.legal-consent--error {
    color: #c02626;
}

.legal-consent--error input[type="checkbox"] {
    outline: 2px solid #c02626;
    outline-offset: 1px;
}

.legal-consent__warning,
.legal-consent__error {
    display: block;
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.45;
    color: #c02626;
}

.legal-consent__warning:empty {
    display: none;
}

/* В модальных окнах сайта галочка стоит перед блоком кнопок */
.modal-form .legal-consent,
.form-sale .legal-consent {
    margin: 10px 0 16px;
    font-size: 12px;
    line-height: 1.45;
}

/* --- Сообщение о результате отправки обычной формы заявки ---------------- */

.wm-form-notice {
    position: fixed;
    z-index: 2147482000;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
    max-width: min(92vw, 620px);
    padding: 14px 20px;
    border: 1px solid #cfe3a8;
    border-left: 4px solid #8dad3e;
    border-radius: 8px;
    background: #f5faea;
    color: #2f4410;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .14);
    font: 15px/1.5 "Source Sans Pro", -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, Arial, sans-serif;
}

.wm-form-notice--error {
    border-color: #f0c8c8;
    border-left-color: #c02626;
    background: #fdf1f1;
    color: #7c1d1d;
}

@media print {
    .wm-form-notice {
        display: none;
    }
}

/* --- Адаптив ------------------------------------------------------------- */

@media (max-width: 640px) {
    .legal-page {
        font-size: 15px;
    }

    .legal-page h1,
    .legal-page .legal-title {
        font-size: 24px;
    }

    .legal-page h2 {
        font-size: 18px;
        margin-top: 32px;
    }

    .legal-page .legal-toc {
        padding: 14px 14px;
    }

    .legal-shell__main {
        padding: 24px 16px 40px;
    }

    .legal-shell__nav {
        margin-left: 0;
        width: 100%;
    }
}

@media print {
    .legal-page {
        max-width: none;
        font-size: 11pt;
    }

    .legal-page .legal-toc {
        display: none;
    }

    .legal-page .legal-table {
        min-width: 0;
        font-size: 9pt;
    }

    .legal-shell__head,
    .legal-shell__foot {
        display: none;
    }
}
