/* FAQ live search — search field, ranked suggestion dropdown, match
   highlighting and in-place filtering of the FAQ list. */

.faq-search {
    position: relative;
    z-index: 6;
}

.faq-search__field {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.5rem 0.45rem 1.15rem;
    background: #fff;
    border: 1px solid rgba(11, 10, 136, 0.14);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(11, 10, 136, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.faq-search__field:focus-within {
    border-color: rgba(85, 209, 203, 0.9);
    box-shadow: 0 14px 38px rgba(11, 10, 136, 0.14), 0 0 0 4px rgba(85, 209, 203, 0.22);
    transform: translateY(-1px);
}

.faq-search__icon {
    flex: 0 0 auto;
    font-size: 1.15rem;
    line-height: 1;
    color: #0b0a88;
    opacity: 0.72;
}

.faq-search__input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.55rem 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: #0f172a;
}

.faq-search__input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.faq-search__input::-webkit-search-cancel-button,
.faq-search__input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.faq-search__clear {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 50%;
    color: #0b0a88;
    background: rgba(11, 10, 136, 0.08);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.faq-search__clear:hover {
    color: #fff;
    background: #0b0a88;
    transform: rotate(90deg);
}

.faq-search__clear[hidden] {
    display: none;
}

.faq-search__status {
    margin: 0.6rem 0 0;
    padding-inline: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    color: #64748b;
    min-height: 0;
}

.faq-search__status:empty {
    margin: 0;
}

.faq-search__kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    margin-inline: 0.15rem;
    padding-inline: 0.3rem;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    color: #0b0a88;
    background: rgba(11, 10, 136, 0.08);
    border-radius: 6px;
}

/* ---------- Google-style suggestion panel ---------- */

.faq-search__results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 20;
    max-height: min(58vh, 26rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.4rem;
    background: #fff;
    border: 1px solid rgba(11, 10, 136, 0.12);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(11, 10, 136, 0.2);
    transform-origin: top center;
    animation: faqResultsIn 0.18s ease-out;
}

.faq-search__results[hidden] {
    display: none;
}

@keyframes faqResultsIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.faq-search__result {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #0b0a88;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.16s ease;
}

.faq-search__result.is-active,
.faq-search__result:hover {
    background: rgba(85, 209, 203, 0.18);
}

.faq-search__result-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #0b0a88;
    background: rgba(85, 209, 203, 0.24);
}

.faq-search__result-body {
    flex: 1 1 auto;
    min-width: 0;
}

.faq-search__result-title {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.45;
    color: #0f172a;
}

.faq-search__result-meta {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #64748b;
}

.faq-search__result-arrow {
    flex: 0 0 auto;
    align-self: center;
    font-size: 0.9rem;
    color: #0b0a88;
    opacity: 0.45;
    transition: transform 0.16s ease, opacity 0.16s ease;
}

.faq-search__result.is-active .faq-search__result-arrow {
    opacity: 1;
    transform: translateX(3px);
}

/* ---------- Match highlighting ---------- */

.faq-hl {
    padding: 0 0.1em;
    border-radius: 0.25em;
    color: inherit;
    background: linear-gradient(180deg, rgba(85, 209, 203, 0.35), rgba(85, 209, 203, 0.62));
    box-shadow: inset 0 -1px 0 rgba(11, 10, 136, 0.12);
}

.faq-hit {
    margin: 0 1.15rem 0.9rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #475569;
    background: rgba(85, 209, 203, 0.1);
    border-left: 3px solid rgba(85, 209, 203, 0.75);
    border-radius: 0 10px 10px 0;
    animation: faqHitIn 0.26s ease-out;
}

@keyframes faqHitIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* The snippet duplicates the answer, so hide it once the panel is open. */
.accordion-item:has(.accordion-title.active) .faq-hit {
    display: none;
}

.faq-sections .accordion-item.is-hidden,
.faq-sections .faq-section-card.is-hidden {
    display: none;
}

.faq-sections .accordion-item.is-flash {
    animation: faqFlash 1.8s ease-out;
}

@keyframes faqFlash {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(85, 209, 203, 0);
    }
    18% {
        box-shadow: 0 0 0 4px rgba(85, 209, 203, 0.55);
    }
    55% {
        box-shadow: 0 0 0 4px rgba(85, 209, 203, 0.2);
    }
}

/* ---------- Empty state ---------- */

.faq-empty {
    padding: clamp(1.5rem, 4vw, 2rem);
    text-align: center;
    background: #fff;
    border: 1px dashed rgba(11, 10, 136, 0.2);
    border-radius: 20px;
    animation: faqHitIn 0.3s ease-out;
}

.faq-empty[hidden] {
    display: none;
}

.faq-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.75rem;
    font-size: 1.35rem;
    color: #0b0a88;
    background: rgba(85, 209, 203, 0.22);
    border-radius: 14px;
}

.faq-empty__title {
    margin: 0 0 0.4rem;
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0b0a88;
}

.faq-empty__text {
    margin: 0 auto 1.1rem;
    max-width: 30rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #475569;
}

.faq-empty__text strong {
    color: #0b0a88;
}

.faq-empty__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.faq-empty__actions .btn--outline {
    color: #0b0a88;
    background: transparent;
    border-color: rgba(11, 10, 136, 0.3);
    box-shadow: none;
}

.faq-empty__actions .btn--outline:hover {
    color: #fff;
    background: #0b0a88;
    border-color: #0b0a88;
}

@media (max-width: 575px) {
    .faq-search__field {
        padding-left: 0.9rem;
        gap: 0.6rem;
    }

    .faq-search__input {
        font-size: 0.9375rem;
    }

    .faq-hit {
        margin-inline: 0.9rem;
        font-size: 0.875rem;
    }

    .faq-search__results {
        max-height: 62vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .faq-search__results,
    .faq-hit,
    .faq-empty,
    .faq-sections .accordion-item.is-flash {
        animation: none;
    }

    .faq-search__field,
    .faq-search__clear,
    .faq-search__result-arrow {
        transition: none;
    }
}
