/* Help / FAQ — design tokens (scoped so layout works even if body helpers miss a class) */

.help-page,
.help-page-container {
    --help-accent: #3ea6ff;
    --help-surface: #181818;
    --help-border: #2a2a2a;
    --help-text: #f1f1f1;
    --help-muted: #aaa;
}

.help-page-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px 48px;
    color: var(--help-text);
}

.help-hero {
    text-align: center;
    padding: 44px 28px;
    margin-bottom: 40px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(145deg, #15152a 0%, #1a1a24 45%, #121212 100%);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.help-hero-content h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    margin: 0 0 10px;
    color: #fff;
}

.hero-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.68);
    margin: 0 0 28px;
    line-height: 1.45;
}

.search-bar-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    z-index: 5;
}

.search-bar-container input {
    width: 100%;
    padding: 14px 18px 14px 46px;
    background: rgba(28, 28, 28, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar-container input:focus {
    outline: none;
    border-color: var(--help-accent);
    box-shadow: 0 0 0 3px rgba(62, 166, 255, 0.2);
}

.search-icon-img {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    filter: invert(1);
    opacity: 0.65;
    pointer-events: none;
}

.search-suggestions {
    --faq-suggestion-row: 46px;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #282828;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
    z-index: 20;
    border: 1px solid #3d3d3d;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: min(calc(var(--faq-suggestion-row) * 8), 50vh, 360px);
    text-align: left;
}

.search-suggestions[hidden] {
    display: none !important;
}

.search-suggestions.is-open {
    animation: helpSlide 0.18s ease-out;
}

@keyframes helpSlide {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.suggestion-item {
    padding: 12px 18px;
    cursor: pointer;
    color: #e6e6e6;
    font-size: 14px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #282828;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: var(--help-accent);
    color: #0f0f0f;
}

.suggestion-item:hover .suggestion-mark {
    color: #0f0f0f;
    background: transparent;
}

.suggestion-mark {
    color: var(--help-accent);
    background: transparent;
    font-weight: 600;
}

.suggestion-icon-small {
    width: 14px;
    height: 14px;
    filter: invert(1);
    opacity: 0.75;
    flex-shrink: 0;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.quick-link-card {
    background: var(--help-surface);
    padding: 18px;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid var(--help-border);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color 0.2s, transform 0.2s;
}

.quick-link-card:hover {
    border-color: #444;
    transform: translateY(-2px);
}

.quick-link-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
    filter: invert(53%) sepia(66%) saturate(2466%) hue-rotate(190deg) brightness(101%) contrast(101%);
}

.icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(62, 166, 255, 0.12);
}

.link-text h3 {
    margin: 0 0 4px;
    font-size: 16px;
    color: #fff;
}

.link-text p {
    margin: 0;
    font-size: 13px;
    color: var(--help-muted);
}

.faq-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 8px;
    color: #fff;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-title {
    font-size: 13px;
    font-weight: 700;
    color: #888;
    margin: 28px 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.faq-category:first-child .category-title {
    margin-top: 0;
}

.faq-item {
    background: var(--help-surface);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--help-border);
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

.faq-item.highlighted {
    border-color: var(--help-accent);
    box-shadow: 0 0 0 1px rgba(62, 166, 255, 0.35);
}

.faq-question {
    width: 100%;
    margin: 0;
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    color: #e4e4e4;
    text-align: left;
    background: var(--help-surface);
    border: none;
    box-sizing: border-box;
}

.faq-question:hover {
    color: #fff;
    background: #1f1f1f;
}

.icon-plus {
    width: 12px;
    height: 12px;
    position: relative;
    flex-shrink: 0;
}

.icon-plus::before,
.icon-plus::after {
    content: '';
    position: absolute;
    background: #999;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s, transform 0.2s;
}

.icon-plus::before {
    width: 12px;
    height: 2px;
}

.icon-plus::after {
    width: 2px;
    height: 12px;
}

.faq-item.active .faq-question {
    color: var(--help-accent);
    background: #1f1f1f;
}

.faq-item.active .icon-plus::after {
    opacity: 0;
}

.faq-item.active .icon-plus::before {
    background: var(--help-accent);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease;
    background: #141414;
}

.answer-inner {
    padding: 18px 20px 20px;
    color: #c8c8c8;
    font-size: 14px;
    line-height: 1.6;
    border-top: 1px solid var(--help-border);
}

.answer-inner p {
    margin: 0;
}

.answer-inner ol {
    margin: 0;
    padding-left: 20px;
}

.answer-inner li {
    margin-bottom: 6px;
}

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

.answer-inner a:hover {
    text-decoration: underline;
}

.help-footer-banner {
    margin-top: 48px;
    text-align: center;
    padding: 36px 24px;
    background: var(--help-surface);
    border-radius: 12px;
    border: 1px dashed #333;
}

.help-footer-banner h3 {
    font-size: 20px;
    margin: 0 0 10px;
}

.help-footer-text {
    color: var(--help-muted);
    margin: 0 0 24px;
    font-size: 15px;
    line-height: 1.5;
}

.help-footer-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.help-footer-actions .help-btn {
    display: inline-block;
    padding: 11px 28px;
    font-weight: 600;
    border-radius: 999px;
    text-decoration: none;
    transition: filter 0.2s, background-color 0.2s, color 0.2s;
    border: 1px solid transparent;
    /* fallback если на body нет .help-page и переменные не заданы */
    background-color: var(--help-accent, #3ea6ff);
    color: #0a0a0a;
}

.help-footer-actions .help-btn:hover {
    filter: brightness(1.08);
    color: #0a0a0a;
}

.help-footer-actions .help-btn.secondary {
    background-color: transparent;
    color: var(--help-accent, #3ea6ff);
    border-color: var(--help-accent, #3ea6ff);
}

.help-footer-actions .help-btn.secondary:hover {
    background-color: rgba(62, 166, 255, 0.12);
    color: #fff;
}

@media (max-width: 900px) {
    .help-page-container {
        padding: 16px 12px 32px;
        max-width: 100%;
    }

    .help-hero {
        padding: 28px 16px;
        margin-bottom: 24px;
    }

    .hero-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .search-bar-container {
        max-width: 100%;
    }

    .search-suggestions {
        max-height: min(calc(var(--faq-suggestion-row) * 8), 42vh, 320px);
    }

    .quick-links-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 28px;
    }

    .faq-question {
        padding: 14px 16px;
        font-size: 14px;
    }

    .answer-inner {
        padding: 14px 16px 16px;
        font-size: 13px;
    }

    .help-footer-banner {
        padding: 28px 16px;
        margin-top: 32px;
    }

    .help-footer-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .help-footer-actions .help-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .help-hero-content h1 {
        font-size: 1.35rem;
    }

    .search-bar-container input {
        font-size: 16px;
        padding: 12px 14px 12px 42px;
    }

    .suggestion-item {
        padding: 11px 14px;
        font-size: 13px;
    }

    .search-suggestions {
        --faq-suggestion-row: 44px;
    }
}
