:root {
    --faq-bg: #0f1117;
    --faq-card: #171b24;
    --faq-card-border: #2a3140;
    --faq-card-open: #1d2431;
    --faq-text: #edf2ff;
    --faq-muted: #9aa6bf;
    --faq-accent: #49a4ff;
    --faq-accent-soft: rgba(73, 164, 255, 0.16);
    --faq-accent-line: rgba(73, 164, 255, 0.45);
}

body {
    background: #0f1117 !important;
}

.faq-frontend-container {
    min-height: 100vh;
    background:
        radial-gradient(900px 500px at 100% -10%, rgba(73, 164, 255, 0.12), transparent 60%),
        radial-gradient(700px 400px at -5% 15%, rgba(0, 214, 201, 0.08), transparent 55%),
        var(--faq-bg);
    padding: 0 0 74px;
}

.faq-section-header {
    text-align: center;
    padding: 68px 20px 42px;
}

.faq-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--faq-accent-line);
    background: var(--faq-accent-soft);
    color: var(--faq-accent);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 18px;
}

.faq-title {
    margin: 0 0 10px;
    color: var(--faq-text);
    font-size: 42px;
    line-height: 1.15;
    font-weight: 800;
}

.faq-title span {
    color: var(--faq-accent);
}

.faq-subtitle {
    margin: 0 auto 28px;
    max-width: 760px;
    color: var(--faq-muted);
    font-size: 17px;
    line-height: 1.6;
}

.faq-search-container {
    margin-bottom: 18px;
}

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

.faq-search-box::before {
    content: '\f002';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8ca6;
    font-size: 13px;
}

.faq-search-input {
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid #2f384a;
    background: #161b25;
    color: var(--faq-text);
    font-size: 15px;
    padding: 13px 14px 13px 44px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.faq-search-input::placeholder {
    color: #7f8ca6;
}

.faq-search-input:focus {
    border-color: var(--faq-accent);
    box-shadow: 0 0 0 3px rgba(73, 164, 255, 0.18);
}

.faq-chips {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.faq-chip {
    border: 1px solid #33405a;
    background: #171d29;
    color: #b4bfd6;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
    cursor: pointer;
    transition: all .15s ease;
}

.faq-chip:hover {
    border-color: #4a7fc8;
    color: #d3e5ff;
}

.faq-chip.active {
    border-color: var(--faq-accent);
    background: var(--faq-accent-soft);
    color: #eaf4ff;
}

.faq-main-background {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 18px;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.faq-item {
    border: 1px solid var(--faq-card-border);
    border-radius: 14px;
    background: var(--faq-card);
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.faq-item:hover {
    border-color: #3f5d8a;
}

.faq-item.active {
    border-color: #5eaef8;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    cursor: pointer;
    background: transparent !important;
    border: none !important;
}

.faq-question h3 {
    margin: 0;
    color: var(--faq-text);
    font-size: 16px;
    line-height: 1.45;
    font-weight: 700;
}

.faq-toggle-icon {
    min-width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #3a465e;
    color: #9fb2d1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    line-height: 1;
    transition: all .2s ease;
}

.faq-item.active .faq-toggle-icon {
    background: var(--faq-accent);
    border-color: var(--faq-accent);
    color: #fff;
    transform: rotate(45deg);
}

.faq-answer {
    display: none;
    border-top: 1px solid #2a3346;
    background: var(--faq-card-open);
    padding: 0 20px;
}

/* Override legacy /frontend/css/fax.css rules */
.faq-frontend-container .faq-item {
    background: var(--faq-card) !important;
}

.faq-frontend-container .faq-question {
    background: transparent !important;
    color: var(--faq-text) !important;
}

.faq-frontend-container .faq-answer {
    background: var(--faq-card-open) !important;
}

.faq-answer.active {
    display: block;
    padding: 16px 20px 20px;
}

.faq-answer-content {
    color: #c3cee3;
    line-height: 1.75;
    font-size: 15px;
}

.faq-answer-content p {
    margin: 0 0 10px;
}

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

.faq-answer-content a {
    color: #8ecbff;
}

.faq-empty-state,
.faq-no-results {
    border: 1px solid #2d3648;
    border-radius: 14px;
    background: #171c26;
    text-align: center;
    padding: 48px 20px;
    color: var(--faq-muted);
}

.faq-empty-icon {
    font-size: 58px;
    margin-bottom: 14px;
    opacity: .45;
}

.faq-empty-title {
    margin: 0 0 8px;
    font-size: 24px;
    color: var(--faq-text);
}

.faq-empty-text {
    margin: 0 0 22px;
    font-size: 15px;
}

.faq-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #2d9bff;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.faq-back-btn:hover {
    text-decoration: none;
    color: #fff;
    background: #2486df;
}

.faq-item.faq-fade-in {
    animation: faqFadeIn .35s ease both;
}

@keyframes faqFadeIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 960px) {
    .faq-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .faq-section-header {
        padding: 44px 14px 30px;
    }
    .faq-title {
        font-size: 30px;
    }
    .faq-subtitle {
        font-size: 15px;
    }
    .faq-main-background {
        padding: 0 12px;
    }
    .faq-question {
        padding: 15px 16px;
    }
    .faq-answer.active {
        padding: 14px 16px 16px;
    }
    .faq-answer-content {
        font-size: 14px;
    }
}
