/* FAQ page styles tuned to match the storefront aesthetic with smoother
   animations and prettier accordion cards. */

#faq-page .faq-main {
    position: relative;
    z-index: 1;
    /* Reserve space for the fixed top navbar so the hero never tucks under it. */
    max-width: 920px;
    margin: 0 auto;
    padding: calc(var(--header-height, 70px) + 56px) 20px 80px;
}

#faq-page .faq-hero {
    text-align: center;
    margin-bottom: 36px;
}

#faq-page .faq-kicker {
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(123, 220, 255, 0.92);
    font-size: 0.74rem;
    font-weight: 700;
    margin-bottom: 14px;
}

#faq-page .faq-hero h1 {
    margin: 0;
    font-size: clamp(2.1rem, 4.4vw, 3.4rem);
    line-height: 1.1;
    background: linear-gradient(90deg, #d6f0ff 0%, #6cc6ff 55%, #34a4ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 18px 60px rgba(0, 167, 230, 0.18);
}

#faq-page .faq-hero p {
    margin: 16px auto 0;
    color: rgba(218, 235, 250, 0.8);
    max-width: 640px;
    font-size: 1rem;
    line-height: 1.55;
}

#faq-page .faq-shell {
    display: grid;
    gap: 14px;
}

/* Subtle fade-in on first paint so cards animate into place on load. */
#faq-page .faq-item {
    position: relative;
    border-radius: 16px;
    background:
        linear-gradient(165deg, rgba(20, 36, 54, 0.78), rgba(11, 22, 36, 0.92));
    border: 1px solid rgba(108, 196, 255, 0.18);
    box-shadow:
        0 12px 28px rgba(2, 12, 24, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
    transition:
        border-color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
    animation: faq-card-rise 0.45s ease both;
}

#faq-page .faq-item:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 167, 230, 0.55);
    box-shadow:
        0 16px 36px rgba(0, 86, 132, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#faq-page .faq-item.is-open {
    border-color: rgba(0, 167, 230, 0.7);
    background:
        linear-gradient(165deg, rgba(15, 50, 80, 0.85), rgba(10, 24, 40, 0.95));
    box-shadow:
        0 18px 44px rgba(0, 110, 170, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Accent bar that grows along the side when the question is open. */
#faq-page .faq-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, #56cfe1, #00a7e6);
    opacity: 0;
    transform: scaleY(0.4);
    transform-origin: top;
    transition: opacity 0.25s ease, transform 0.3s ease;
}

#faq-page .faq-item.is-open::before {
    opacity: 1;
    transform: scaleY(1);
}

#faq-page .faq-question {
    width: 100%;
    border: 0;
    background: transparent;
    color: #eaf6ff;
    padding: 18px 22px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    font-family: inherit;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

#faq-page .faq-question:hover {
    color: #ffffff;
    background-color: rgba(0, 167, 230, 0.08);
}

#faq-page .faq-question:focus-visible {
    outline: 2px solid rgba(86, 207, 225, 0.7);
    outline-offset: -2px;
}

#faq-page .faq-question-text {
    flex: 1;
    line-height: 1.4;
}

/* Animated chevron icon. */
#faq-page .faq-caret {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(0, 167, 230, 0.16);
    color: #7fdfff;
    display: grid;
    place-items: center;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
        background-color 0.25s ease;
}

#faq-page .faq-caret svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#faq-page .faq-item.is-open .faq-caret {
    background: rgba(0, 167, 230, 0.32);
}

#faq-page .faq-item.is-open .faq-caret svg {
    transform: rotate(180deg);
}

/* Smooth open/close height transition using the grid-rows trick so we
   don't need explicit pixel heights. */
#faq-page .faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
        opacity 0.22s ease;
    opacity: 0;
}

#faq-page .faq-item.is-open .faq-answer {
    grid-template-rows: 1fr;
    opacity: 1;
}

#faq-page .faq-answer-inner {
    overflow: hidden;
    padding: 0 22px;
    color: rgba(214, 232, 250, 0.88);
    line-height: 1.62;
    border-top: 1px solid transparent;
    transition: border-color 0.25s ease, padding 0.25s ease;
}

#faq-page .faq-item.is-open .faq-answer-inner {
    padding: 14px 22px 20px;
    border-top-color: rgba(0, 167, 230, 0.18);
}

#faq-page .faq-answer p {
    margin: 0;
}

@keyframes faq-card-rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive tuning for tablets and phones. */
@media (max-width: 768px) {
    #faq-page .faq-main {
        padding: calc(var(--header-height, 70px) + 36px) 16px 56px;
    }

    #faq-page .faq-hero {
        margin-bottom: 26px;
    }

    #faq-page .faq-question {
        padding: 16px 18px;
        font-size: 0.98rem;
    }

    #faq-page .faq-answer-inner {
        padding: 0 18px;
    }

    #faq-page .faq-item.is-open .faq-answer-inner {
        padding: 12px 18px 18px;
    }
}

@media (max-width: 480px) {
    #faq-page .faq-kicker {
        letter-spacing: 0.24em;
        font-size: 0.7rem;
    }

    #faq-page .faq-question {
        font-size: 0.95rem;
        gap: 12px;
    }

    #faq-page .faq-caret {
        width: 26px;
        height: 26px;
    }
}

/* Respect reduced-motion preference for accessibility. */
@media (prefers-reduced-motion: reduce) {
    #faq-page .faq-item,
    #faq-page .faq-question,
    #faq-page .faq-caret,
    #faq-page .faq-caret svg,
    #faq-page .faq-answer,
    #faq-page .faq-answer-inner {
        transition: none !important;
        animation: none !important;
    }
}
