/* ==========================================================================
   FAQ Section — scoped to #faq to avoid any collision with theme styles
   ========================================================================== */

#faq {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: #081b29;
}

/* --- Ambient AI-inspired background: mesh glow + faint grid --- */
#faq .faq-bg-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

#faq .faq-glow {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    border-radius: 9999px;
    filter: blur(110px);
}

#faq .faq-glow-1 {
    top: -120px;
    left: -80px;
    width: 420px;
    height: 420px;
    background: rgba(255, 0, 50, 0.10);
}

#faq .faq-glow-2 {
    bottom: -140px;
    right: -100px;
    width: 480px;
    height: 480px;
    background: rgba(13, 44, 64, 0.9);
}

#faq .faq-inner {
    position: relative;
    z-index: 1;
}

/* --- Heading --- */
#faq .faq-eyebrow {
    letter-spacing: 0.3em;
}

#faq .faq-fade {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

#faq .faq-fade.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Glass panel wrapper --- */
#faq .faq-panel {
    position: relative;
    border-radius: 28px;
    padding: 1.25rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

#faq .faq-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 0, 50, 0.35), rgba(255, 255, 255, 0.06) 40%, rgba(255, 0, 50, 0.15));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

#faq .faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* --- Individual FAQ item --- */
#faq .faq-item {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid transparent;
    transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
}

#faq .faq-item:hover {
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

#faq .faq-item.is-open {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 0, 50, 0.25);
    border-left-color: #FF0032;
    box-shadow: 0 18px 40px -18px rgba(255, 0, 50, 0.35), 0 0 0 1px rgba(255, 0, 50, 0.08) inset;
    transform: translateY(-2px);
}

#faq .faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 1.15rem 1.35rem;
    color: #e5e7eb;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.5;
    transition: color 0.3s ease;
}

@media (min-width: 768px) {
    #faq .faq-question {
        font-size: 1.0625rem;
        padding: 1.35rem 1.6rem;
    }
}

#faq .faq-item.is-open .faq-question,
#faq .faq-question:hover {
    color: #ffffff;
}

#faq .faq-question:focus-visible {
    outline: 2px solid #FF0032;
    outline-offset: 2px;
    border-radius: 14px;
}

/* Plus / minus icon */
#faq .faq-icon {
    position: relative;
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.35s ease, border-color 0.35s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

#faq .faq-icon::before,
#faq .faq-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: #FF0032;
    transition: transform 0.35s ease;
}

#faq .faq-icon::before {
    width: 10px;
    height: 2px;
    transform: translate(-50%, -50%);
}

#faq .faq-icon::after {
    width: 2px;
    height: 10px;
    transform: translate(-50%, -50%);
}

#faq .faq-item.is-open .faq-icon {
    background: rgba(255, 0, 50, 0.14);
    border-color: rgba(255, 0, 50, 0.4);
    transform: rotate(180deg);
}

#faq .faq-item.is-open .faq-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 0;
}

/* --- Answer panel: smooth height animation via CSS grid trick (no JS measuring) --- */
#faq .faq-answer-wrap {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

#faq .faq-item.is-open .faq-answer-wrap {
    grid-template-rows: 1fr;
}

#faq .faq-answer-inner {
    overflow: hidden;
}

#faq .faq-answer {
    padding: 0 1.35rem 1.35rem;
    color: #9ca3af;
    font-weight: 300;
    font-size: 0.9375rem;
    line-height: 1.7;
}

@media (min-width: 768px) {
    #faq .faq-answer {
        padding: 0 1.6rem 1.5rem;
        font-size: 0.975rem;
    }
}

/* --- Bottom CTA --- */
#faq .faq-cta {
    text-align: center;
}

#faq .faq-cta-btn {
    display: inline-flex;
    align-items: center;
}

/* --- Responsive spacing --- */
@media (max-width: 1024px) {
    #faq .faq-panel {
        padding: 1rem;
        border-radius: 24px;
    }
}

@media (max-width: 768px) {
    #faq .faq-panel {
        padding: 0.85rem;
        border-radius: 20px;
    }

    #faq .faq-item {
        border-radius: 16px;
    }
}

@media (max-width: 400px) {
    #faq .faq-question {
        padding: 1rem 1rem;
        font-size: 0.9375rem;
    }

    #faq .faq-answer {
        padding: 0 1rem 1.1rem;
    }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    #faq .faq-fade,
    #faq .faq-item,
    #faq .faq-icon,
    #faq .faq-icon::before,
    #faq .faq-icon::after,
    #faq .faq-answer-wrap {
        transition: none !important;
    }
}
