/* ==========================================
   FAQ PAGE - BALANCED & READABLE
   Scaled to match homepage compact style
   Legacy Protection Services
========================================== */

.faq-section {
    padding: clamp(48px, 6vw, 80px) 0;
    background: #F0F2F5;  /* Matched to homepage grey sections */
}

/* Tabs */
.faq-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    background: var(--color-white);
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-size: 0.75rem;  /* Reduced from 0.8rem */
    font-weight: 500;
    color: var(--color-text-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.tab-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-black);
}

/* Search */
.faq-search {
    position: relative;
    max-width: 350px;
    margin: 0 auto 2rem;
}

.faq-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-light);
    font-size: 0.75rem;
}

.faq-search input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.2rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 2rem;
    font-size: 0.8rem;
    background: var(--color-white);
    transition: all 0.2s ease;
}

.faq-search input:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Accordion */
.faq-accordion {
    max-width: 800px;
    margin: 0 auto;
}

.faq-group {
    margin-bottom: 1rem;
}

.faq-item {
    background: var(--color-white);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 0.75rem;  /* Reduced from 0.5rem */
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.faq-item:hover {
    border-color: rgba(214, 154, 59, 0.2);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    font-size: 0.85rem;  /* Reduced from 0.9rem */
    font-weight: 600;
    color: var(--color-black);
    background: var(--color-white);
    transition: background 0.2s ease;
}

.faq-question:hover {
    background: rgba(214, 154, 59, 0.04);
}

.faq-question i {
    color: var(--color-primary);
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    padding: 0 1.25rem;
    font-size: 0.8rem;  /* Reduced from 0.85rem */
    color: var(--color-text-light);
    line-height: 1.6;
}

.faq-answer p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

.faq-item.active .faq-answer {
    max-height: 300px;
    padding: 0 1.25rem 1rem 1.25rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 2rem;
    background: var(--color-white);
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    max-width: 400px;
    margin: 1.5rem auto;
}

.no-results i {
    font-size: 1.8rem;  /* Reduced from 2rem */
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
}

.no-results p {
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
}

.reset-link {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.reset-link:hover {
    text-decoration: underline;
}

/* Help Box */
.help-box {
    text-align: center;
    padding: 1rem 1.25rem;
    background: var(--color-white);
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.help-box i {
    font-size: 1.2rem;
    color: var(--color-primary);
    margin-right: 0.5rem;
}

.help-box p {
    display: inline;
    font-size: 0.8rem;
    color: var(--color-text-light);
}

.help-box a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.help-box a:hover {
    text-decoration: underline;
}

/* Reveal Animations */
.reveal-item {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.2, 0.9, 0.4, 1.1), transform 0.7s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.reveal-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ========== ENHANCED RESPONSIVE BREAKPOINTS ========== */

/* Tablet landscape */
@media (max-width: 991px) {
    .faq-tabs {
        gap: 0.5rem;
    }
    
    .tab-btn {
        padding: 0.35rem 0.875rem;
        font-size: 0.7rem;
    }
}

/* Tablet portrait */
@media (max-width: 768px) {
    .faq-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding-bottom: 0.5rem;
        gap: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        white-space: nowrap;
        font-size: 0.7rem;
        padding: 0.3rem 0.875rem;
    }
    
    .faq-search {
        max-width: 300px;
        margin: 0 auto 1.5rem;
    }
    
    .faq-search input {
        font-size: 0.75rem;
        padding: 0.45rem 1rem 0.45rem 2rem;
    }
    
    .faq-search i {
        font-size: 0.7rem;
        left: 0.875rem;
    }
    
    .faq-question {
        padding: 0.7rem 1rem;
        font-size: 0.8rem;
    }
    
    .faq-question i {
        font-size: 0.65rem;
    }
    
    .faq-answer {
        font-size: 0.75rem;
        line-height: 1.55;
    }
    
    .faq-answer p {
        font-size: 0.75rem;
        line-height: 1.55;
    }
    
    .faq-item.active .faq-answer {
        padding: 0 1rem 0.875rem 1rem;
    }
    
    .help-box {
        padding: 0.875rem 1rem;
        margin-top: 1.5rem;
    }
    
    .help-box i {
        font-size: 1rem;
    }
    
    .help-box p {
        font-size: 0.75rem;
    }
}

/* Mobile portrait */
@media (max-width: 640px) {
    .faq-section {
        padding: 40px 0;
    }
    
    .faq-tabs {
        margin-bottom: 1.25rem;
    }
    
    .tab-btn {
        font-size: 0.65rem;
        padding: 0.25rem 0.75rem;
    }
    
    .faq-search {
        max-width: 100%;
        margin-bottom: 1.25rem;
    }
    
    .faq-question {
        padding: 0.6rem 0.875rem;
        font-size: 0.75rem;
    }
    
    .faq-question span {
        padding-right: 0.5rem;
    }
    
    .faq-answer {
        font-size: 0.7rem;
    }
    
    .faq-answer p {
        font-size: 0.7rem;
        line-height: 1.5;
    }
    
    .faq-item.active .faq-answer {
        padding: 0 0.875rem 0.75rem 0.875rem;
        max-height: 350px;
    }
    
    .no-results {
        padding: 1.5rem;
        margin: 1rem auto;
    }
    
    .no-results i {
        font-size: 1.5rem;
    }
    
    .no-results p {
        font-size: 0.75rem;
    }
    
    .reset-link {
        font-size: 0.65rem;
    }
    
    .help-box {
        margin-top: 1.25rem;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .faq-question {
        padding: 0.5rem 0.75rem;
        font-size: 0.7rem;
    }
    
    .faq-question i {
        font-size: 0.6rem;
    }
    
    .faq-answer {
        font-size: 0.65rem;
    }
    
    .faq-answer p {
        font-size: 0.65rem;
    }
    
    .faq-item.active .faq-answer {
        padding: 0 0.75rem 0.6rem 0.75rem;
    }
    
    .tab-btn {
        font-size: 0.6rem;
        padding: 0.2rem 0.65rem;
    }
    
    .help-box p {
        display: block;
        margin-top: 0.5rem;
    }
}

/* Large screens */
@media (min-width: 1400px) {
    .faq-accordion {
        max-width: 900px;
    }
}

/* Touch device optimization */
@media (hover: none) {
    .tab-btn:hover {
        border-color: rgba(0, 0, 0, 0.12);
        color: var(--color-text-light);
    }
    
    .faq-question:hover {
        background: var(--color-white);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .faq-item,
    .faq-question,
    .faq-question i,
    .reveal-item {
        transition: none;
    }
    
    .reveal-item {
        opacity: 1;
        transform: none;
    }
}