/* ─── FAQ Hero ───────────────────────────────────────────────────── */

.faq-hero {
    padding: 120px 24px 64px;
    text-align: center;
    background: linear-gradient(160deg, rgba(0,85,255,0.04) 0%, transparent 60%);
    border-bottom: 1px solid var(--border);
}

.faq-hero h1 {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.faq-hero p {
    font-size: 1.05rem;
    color: var(--text-light);
    max-width: 540px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

/* ─── Search Bar ─────────────────────────────────────────────────── */

.faq-search-wrap {
    position: relative;
    max-width: 480px;
    margin: 0 auto;
}

.faq-search-wrap i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.9rem;
    pointer-events: none;
}

#faqSearch {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#faqSearch:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 85, 255, 0.1);
}

#faqSearch::placeholder { color: var(--text-light); }

/* ─── Layout ─────────────────────────────────────────────────────── */

.faq-body {
    display: flex;
    /* stretch (default): both columns same height — required for sticky sidebar */
    gap: 0;
    max-width: 1100px;
    margin: 0 auto;
    padding: 56px 24px 80px;
}

/* ─── Category Sidebar ───────────────────────────────────────────── */

.faq-cats {
    width: 200px;
    flex-shrink: 0;
}

.faq-cats-sticky {
    position: sticky;
    top: 96px;
    align-self: flex-start;
    background: var(--bg-color);
    padding-right: 20px;
}

.faq-cats-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    margin-bottom: 12px;
    padding-left: 12px;
}

.faq-cat-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-left: 2px solid transparent;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.18s ease;
    text-align: left;
    margin-bottom: 2px;
}

.faq-cat-btn i {
    font-size: 0.78rem;
    width: 14px;
    flex-shrink: 0;
}

.faq-cat-btn:hover {
    color: var(--text-dark);
    background: var(--accent);
}

.faq-cat-btn.active {
    color: var(--primary);
    background: rgba(0, 85, 255, 0.06);
    border-left-color: var(--primary);
    font-weight: 600;
    border-radius: 8px;
}

.faq-cat-count {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-light);
    background: var(--accent);
    padding: 2px 7px;
    border-radius: 99px;
}

.faq-cat-btn.active .faq-cat-count {
    background: rgba(0, 85, 255, 0.1);
    color: var(--primary);
}

/* ─── FAQ Content ────────────────────────────────────────────────── */

.faq-content {
    flex: 1;
    min-width: 0;
    padding-left: 48px;
    border-left: 1px solid var(--border);
}

/* ─── Category Group ─────────────────────────────────────────────── */

.faq-group {
    margin-bottom: 56px;
}

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

.faq-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.faq-group-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: rgba(0, 85, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 0.88rem;
    flex-shrink: 0;
}

.faq-group-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.faq-group-header span {
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 500;
}

/* ─── Accordion Item ─────────────────────────────────────────────── */

.faq-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.faq-item.hidden { display: none; }

.faq-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.05); }

.faq-item.open {
    border-color: rgba(0, 85, 255, 0.22);
    box-shadow: 0 4px 16px rgba(0, 85, 255, 0.07);
}

.faq-q {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    cursor: pointer;
    user-select: none;
    background: var(--surface);
    transition: background 0.15s ease;
}

.faq-q:hover { background: #fafbff; }
.faq-item.open .faq-q { background: #fafbff; }

.faq-q-text {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.5;
}

.faq-q-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.75rem;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.faq-item.open .faq-q-icon {
    background: rgba(0, 85, 255, 0.1);
    color: var(--primary);
    transform: rotate(45deg);
}

.faq-a {
    display: none;
    padding: 0 20px 20px 20px;
    background: var(--surface);
}

.faq-item.open .faq-a { display: block; }

.faq-a-inner {
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.8;
}

.faq-a-inner p { margin-bottom: 10px; }
.faq-a-inner p:last-child { margin-bottom: 0; }

.faq-a-inner strong { color: var(--text-dark); font-weight: 600; }

.faq-a-inner a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.faq-a-inner ol,
.faq-a-inner ul {
    padding-left: 20px;
    margin: 8px 0;
}

.faq-a-inner ol { list-style: decimal; }
.faq-a-inner ul { list-style: disc; }

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

.faq-a-inner code {
    font-family: 'Fira Code', monospace;
    font-size: 0.82em;
    background: var(--accent);
    padding: 2px 7px;
    border-radius: 5px;
    color: var(--text-dark);
}

/* ─── Tip box inside answer ──────────────────────────────────────── */

.faq-tip {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.86rem;
    line-height: 1.6;
    margin-top: 12px;
}

.faq-tip i { flex-shrink: 0; margin-top: 2px; font-size: 0.82rem; }

.faq-tip.info {
    background: rgba(0, 85, 255, 0.05);
    border: 1px solid rgba(0, 85, 255, 0.15);
    color: #1e3a8a;
}
.faq-tip.info i { color: var(--primary); }

.faq-tip.warn {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.22);
    color: #92400e;
}
.faq-tip.warn i { color: #f59e0b; }

/* ─── No results ─────────────────────────────────────────────────── */

.faq-empty {
    text-align: center;
    padding: 48px 0;
    display: none;
}

.faq-empty i {
    font-size: 2.5rem;
    color: var(--border);
    margin-bottom: 12px;
    display: block;
}

.faq-empty p {
    font-size: 0.95rem;
    color: var(--text-light);
}

/* ─── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 860px) {
    .faq-hero h1 { font-size: 2rem; }
    .faq-body { flex-direction: column; padding-top: 32px; }
    .faq-cats { width: 100%; }
    .faq-cats-sticky {
        position: static;
        padding-right: 0;
        padding-bottom: 16px;
        margin-bottom: 28px;
        border-bottom: 1px solid var(--border);
    }
    .faq-cat-btn {
        display: inline-flex;
        width: auto;
        border-left: none;
        border-bottom: 2px solid transparent;
        border-radius: 8px;
    }
    .faq-cat-btn.active {
        border-left: none;
        border-bottom-color: var(--primary);
    }
    .faq-cats-sticky > div:first-child { /* cats row */
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    .faq-content {
        padding-left: 0;
        border-left: none;
    }
}

@media (max-width: 560px) {
    .faq-hero { padding-top: 100px; }
    .faq-q-text { font-size: 0.88rem; }
}
