/*
 * Раздел «Справка».
 * Общие стили страниц /help/*: шапка, боковой каталог, типографика документов,
 * карточки «О проекте», аккордеон FAQ и страница контактов.
 */

:root {
    color-scheme: dark;
    --help-bg: #0e0714;
    --help-bg-soft: #170c22;
    --help-surface: rgba(38, 19, 51, 0.74);
    --help-surface-strong: rgba(45, 22, 60, 0.94);
    --help-border: rgba(255, 255, 255, 0.12);
    --help-border-strong: rgba(198, 154, 255, 0.34);
    --help-text: #f5effb;
    --help-muted: #c2b2d4;
    --help-accent: #c69aff;
    --help-accent-soft: rgba(198, 154, 255, 0.14);
    --help-radius: 20px;
    --help-shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-width: 320px;
    margin: 0;
    color: var(--help-text);
    background:
        radial-gradient(circle at 12% -4%, rgba(150, 78, 200, 0.3), transparent 38rem),
        radial-gradient(circle at 88% 4%, rgba(88, 62, 190, 0.24), transparent 30rem),
        linear-gradient(165deg, #180b22 0%, var(--help-bg) 52%, #09060f 100%);
    background-attachment: fixed;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.68;
}

a {
    color: var(--help-accent);
    text-decoration: none;
}

a:hover,
a:focus-visible {
    color: #fff;
    text-decoration: underline;
}

:focus-visible {
    outline: 2px solid var(--help-accent);
    outline-offset: 3px;
    border-radius: 6px;
}

img {
    max-width: 100%;
}

/* ---------- Шапка ---------- */

.help-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px max(18px, calc((100vw - 1180px) / 2));
    border-bottom: 1px solid var(--help-border);
    background: rgba(14, 7, 20, 0.86);
    backdrop-filter: blur(16px);
}

.help-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.help-brand:hover,
.help-brand:focus-visible {
    color: #fff;
    text-decoration: none;
}

.help-brand img {
    display: block;
    border-radius: 11px;
}

.help-header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.help-header-link {
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--help-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.help-header-link:hover,
.help-header-link:focus-visible {
    border-color: var(--help-border);
    color: #fff;
    text-decoration: none;
}

.help-header-link.is-primary {
    border-color: var(--help-border-strong);
    color: var(--help-accent);
}

/* ---------- Каркас ---------- */

.help-layout {
    display: grid;
    grid-template-columns: 262px minmax(0, 1fr);
    gap: 34px;
    width: min(100% - 36px, 1180px);
    margin: 32px auto 76px;
    align-items: start;
}

.help-sidebar {
    position: sticky;
    top: 86px;
    padding: 20px 18px;
    border: 1px solid var(--help-border);
    border-radius: var(--help-radius);
    background: var(--help-surface);
    backdrop-filter: blur(8px);
}

.help-sidebar-title {
    margin: 0 0 14px;
    color: var(--help-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.help-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.help-nav-group {
    margin: 16px 0 7px;
    padding: 0 10px;
    color: var(--help-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Отделяет оглавление документа от общего каталога справки. */
.help-nav-group.is-separated {
    margin-top: 20px;
    padding-top: 17px;
    border-top: 1px solid var(--help-border);
}

.help-sidebar-link {
    display: block;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--help-text);
    font-size: 0.94rem;
    line-height: 1.4;
}

.help-sidebar-link:hover,
.help-sidebar-link:focus-visible {
    border-color: var(--help-border);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    text-decoration: none;
}

.help-sidebar-link.is-active {
    border-color: var(--help-border-strong);
    background: var(--help-accent-soft);
    color: #fff;
    font-weight: 600;
}

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

/* ---------- Документ ---------- */

.help-document {
    padding: clamp(24px, 4.4vw, 52px);
    border: 1px solid var(--help-border);
    border-radius: var(--help-radius);
    background: var(--help-surface-strong);
    box-shadow: var(--help-shadow);
}

.help-kicker {
    margin: 0 0 10px;
    color: var(--help-accent);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.help-title {
    margin: 0;
    font-size: clamp(1.9rem, 5vw, 3rem);
    line-height: 1.12;
    letter-spacing: -0.01em;
}

.help-lead {
    margin: 20px 0 0;
    color: #e4d9f0;
    font-size: 1.06rem;
}

.help-document > section {
    margin-top: 30px;
    padding-top: 28px;
    border-top: 1px solid var(--help-border);
}

/* Ссылки из оглавления не должны уходить под липкую шапку. */
.help-document > section[id] {
    scroll-margin-top: 92px;
}

.help-document h2 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 1.28rem;
    line-height: 1.35;
}

.help-document h3 {
    margin: 22px 0 8px;
    color: #fff;
    font-size: 1.06rem;
}

.help-document p,
.help-document ul,
.help-document ol {
    margin: 0 0 14px;
}

.help-document ul,
.help-document ol {
    padding-left: 22px;
}

.help-document li + li {
    margin-top: 7px;
}

.help-document strong {
    color: #fff;
}

.help-document hr {
    height: 1px;
    margin: 26px 0;
    border: 0;
    background: var(--help-border);
}

.help-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
    color: var(--help-muted);
    font-size: 0.9rem;
}

.help-meta li {
    margin: 0;
}

/* Подсветка блоков «важно» */

.help-note {
    margin: 20px 0;
    padding: 15px 18px;
    border: 1px solid var(--help-border-strong);
    border-radius: 14px;
    background: var(--help-accent-soft);
    font-size: 0.96rem;
}

.help-note p:last-child {
    margin-bottom: 0;
}

.help-note-title {
    display: block;
    margin-bottom: 5px;
    color: #fff;
    font-weight: 700;
}

/* ---------- «О проекте» ---------- */

.about-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(28px, 5vw, 58px);
    border: 1px solid var(--help-border);
    border-radius: var(--help-radius);
    background:
        radial-gradient(circle at 84% 12%, rgba(198, 154, 255, 0.28), transparent 26rem),
        linear-gradient(150deg, rgba(66, 30, 92, 0.95) 0%, rgba(30, 15, 42, 0.96) 62%);
    box-shadow: var(--help-shadow);
}

.about-hero .help-lead {
    max-width: 62ch;
}

.about-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.help-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 20px;
    border: 1px solid var(--help-border-strong);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.help-button:hover,
.help-button:focus-visible {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    text-decoration: none;
}

.help-button.is-accent {
    border-color: transparent;
    background: linear-gradient(135deg, #b083ff 0%, #7c4ce0 100%);
    color: #fff;
}

.help-button.is-accent:hover,
.help-button.is-accent:focus-visible {
    filter: brightness(1.08);
    color: #fff;
}

.help-section {
    margin-top: 30px;
    padding: clamp(22px, 4vw, 44px);
    border: 1px solid var(--help-border);
    border-radius: var(--help-radius);
    background: var(--help-surface-strong);
    box-shadow: var(--help-shadow);
}

.help-section-head {
    max-width: 74ch;
}

.help-section-head h2 {
    margin: 0 0 10px;
    font-size: clamp(1.4rem, 3.4vw, 2rem);
    line-height: 1.2;
}

.help-section-head p {
    margin: 0;
    color: var(--help-muted);
}

.eyebrow {
    display: block;
    margin-bottom: 10px;
    color: var(--help-accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.value-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(266px, 1fr));
    gap: 16px;
    margin-top: 26px;
}

.value-card {
    display: flex;
    flex-direction: column;
    padding: 22px;
    border: 1px solid var(--help-border);
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
    transition: border-color 0.18s ease, transform 0.18s ease;
}

.value-card:hover {
    border-color: var(--help-border-strong);
    transform: translateY(-2px);
}

.value-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    border: 1px solid var(--help-border-strong);
    border-radius: 13px;
    background: var(--help-accent-soft);
    font-size: 1.3rem;
}

.value-card h3 {
    margin: 0 0 8px;
    font-size: 1.08rem;
}

.value-card p {
    margin: 0 0 12px;
    color: var(--help-muted);
    font-size: 0.95rem;
}

.value-card p:last-child {
    margin-bottom: 0;
}

.value-rule {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--help-border);
    color: #e7dcf5;
    font-size: 0.88rem;
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
    gap: 14px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    margin: 0;
    padding: 16px 18px 16px 44px;
    position: relative;
    border: 1px solid var(--help-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.95rem;
}

.feature-list li::before {
    content: "✓";
    position: absolute;
    left: 17px;
    top: 16px;
    color: var(--help-accent);
    font-weight: 700;
}

.step-list {
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: help-step;
}

.step-list li {
    position: relative;
    margin: 0;
    padding: 0 0 22px 58px;
    counter-increment: help-step;
}

.step-list li:last-child {
    padding-bottom: 0;
}

.step-list li::before {
    content: counter(help-step);
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--help-border-strong);
    border-radius: 12px;
    background: var(--help-accent-soft);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
}

.step-list li::after {
    content: "";
    position: absolute;
    left: 19px;
    top: 44px;
    bottom: 4px;
    width: 1px;
    background: var(--help-border);
}

.step-list li:last-child::after {
    display: none;
}

.step-list strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1.02rem;
}

.step-list p {
    margin: 0;
    color: var(--help-muted);
    font-size: 0.95rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 26px;
}

.stat-card {
    padding: 20px;
    border: 1px solid var(--help-border);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.035);
    text-align: center;
}

.stat-card strong {
    display: block;
    margin-bottom: 6px;
    color: #fff;
    font-size: 1.9rem;
    line-height: 1.1;
}

.stat-card span {
    color: var(--help-muted);
    font-size: 0.9rem;
}

.audience-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
}

.audience-list li {
    margin: 0;
    padding: 18px;
    border: 1px solid var(--help-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}

.audience-list strong {
    display: block;
    margin-bottom: 6px;
    color: #fff;
}

.audience-list span {
    color: var(--help-muted);
    font-size: 0.93rem;
}

/* ---------- FAQ ---------- */

.faq-toolbar {
    margin-top: 26px;
}

.faq-search-label {
    display: block;
    margin-bottom: 8px;
    color: var(--help-muted);
    font-size: 0.86rem;
    font-weight: 600;
}

.faq-search {
    display: block;
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--help-border);
    border-radius: 13px;
    background: rgba(12, 6, 18, 0.6);
    color: var(--help-text);
    font: inherit;
}

.faq-search::placeholder {
    color: rgba(194, 178, 212, 0.7);
}

.faq-search:focus {
    border-color: var(--help-border-strong);
    outline: none;
}

.faq-groups {
    margin-top: 30px;
}

.faq-group + .faq-group {
    margin-top: 30px;
    padding-top: 26px;
    border-top: 1px solid var(--help-border);
}

.faq-group > h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 6px;
    font-size: 1.24rem;
}

.faq-group > p {
    margin: 0 0 16px;
    color: var(--help-muted);
    font-size: 0.94rem;
}

.faq-item {
    border: 1px solid var(--help-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.faq-item + .faq-item {
    margin-top: 10px;
}

.faq-item[open] {
    border-color: var(--help-border-strong);
    background: rgba(255, 255, 255, 0.055);
}

.faq-question {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.45;
    cursor: pointer;
    list-style: none;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question:hover {
    color: var(--help-accent);
}

.faq-question::after {
    content: "+";
    flex: 0 0 auto;
    color: var(--help-accent);
    font-size: 1.4rem;
    line-height: 1;
    transition: transform 0.18s ease;
}

.faq-item[open] .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 18px 18px;
    color: var(--help-muted);
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ol,
.faq-answer ul {
    padding-left: 20px;
}

.faq-empty {
    margin-top: 26px;
    padding: 18px;
    border: 1px dashed var(--help-border);
    border-radius: 14px;
    color: var(--help-muted);
    text-align: center;
}

/* ---------- Контакты ---------- */

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
    gap: 16px;
    margin-top: 26px;
}

.contact-card {
    padding: 22px;
    border: 1px solid var(--help-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
}

.contact-card h3 {
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.contact-card p {
    margin: 0 0 8px;
    color: var(--help-muted);
    font-size: 0.94rem;
}

.contact-card p:last-child {
    margin-bottom: 0;
}

.contact-card .contact-value {
    color: var(--help-text);
    font-weight: 600;
}

.requisites {
    width: 100%;
    margin: 24px 0 0;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.requisites th,
.requisites td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--help-border);
    text-align: left;
    vertical-align: top;
}

.requisites th {
    width: 42%;
    color: var(--help-muted);
    font-weight: 600;
}

.requisites tr:last-child th,
.requisites tr:last-child td {
    border-bottom: 0;
}

/* ---------- Сноска ---------- */

.help-footer {
    width: min(100% - 36px, 1180px);
    margin: 0 auto 44px;
    padding-top: 22px;
    border-top: 1px solid var(--help-border);
    color: var(--help-muted);
    font-size: 0.88rem;
}

.help-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-bottom: 12px;
}

/* ---------- Адаптивность ---------- */

@media (max-width: 900px) {
    .help-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
        margin-top: 20px;
    }

    .help-sidebar {
        position: static;
    }

    .help-sidebar-nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    }

    .help-nav-group {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .help-header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 16px;
    }

    .help-header-nav {
        width: 100%;
        margin-left: 0;
    }

    .help-header-link {
        flex: 1 1 auto;
        padding: 8px 10px;
        text-align: center;
    }

    .help-layout,
    .help-footer {
        width: min(100% - 22px, 1180px);
    }

    .help-document,
    .about-hero,
    .help-section {
        border-radius: 16px;
    }

    .requisites th,
    .requisites td {
        display: block;
        width: 100%;
        padding: 9px 0;
    }

    .requisites th {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .requisites td {
        padding-top: 2px;
    }

    .step-list li {
        padding-left: 50px;
    }
}
