/* ============================================
   FAQ SECTION - Refined
   ============================================ */

.faq {
    padding: var(--space-xl) 0;
    background-color: #1a2328; /* PERGUNTAS FREQUENTES - Dark Mode */
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .faq {
    background-color: #ffffff; /* PERGUNTAS FREQUENTES - Light Mode */
}

.faq::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -15%;
    width: 60%;
    height: 80%;
    background-image: url('../img/background.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: top right;
    opacity: 0.05; /* mais transparente, efeito marca d'água */
    pointer-events: none;
    z-index: 0;
}

[data-theme="light"] .faq::before {
    opacity: 0.10;
}

.faq__container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    position: relative;
    z-index: 1;
}

.faq__header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.faq__list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* FAQ Item */
.faq-item {
    background: var(--card-bg);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: visible;
    transition: all var(--transition-base);
}

.faq-item.fade-in {
    opacity: 1;
    transform: none;
}

.faq-item.fade-in.visible {
    opacity: 1;
    transform: none;
}

.faq-item:hover {
    border-color: rgba(65, 107, 153, 0.3);
}

.faq-item.active {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(65, 107, 153, 0.12);
}

/* Question Button */
.faq-item__question {
    width: 100%;
    padding: 2rem 2.5rem;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 1.375rem;
    font-weight: 400;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    transition: all var(--transition-fast);
    font-family: 'DM Serif Display', serif;
}

.faq-item__question:hover {
    color: var(--primary);
}

.faq-item.active .faq-item__question {
    color: var(--primary);
}

/* Icon Container */
.faq-item__icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: rgba(65, 107, 153, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: all var(--transition-base);
}

.faq-item:hover .faq-item__icon {
    background: rgba(65, 107, 153, 0.15);
}

.faq-item.active .faq-item__icon {
    background: var(--primary);
    color: var(--text-white);
    transform: rotate(180deg);
}

.faq-item__icon svg {
    width: 16px;
    height: 16px;
}

/* Answer Container */
.faq-item__answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                padding 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    padding: 0 2.5rem;
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.85;
    letter-spacing: 0.01em;
    opacity: 0;
}

.faq-item.active .faq-item__answer {
    max-height: 800px;
    padding-top: 1.5rem;
    padding-bottom: 2rem;
    border-top: 1px solid var(--border-light);
    margin-top: -0.5rem;
    opacity: 1;
}

.faq-item__answer p {
    margin: 0;
    color: var(--text-secondary);
}

.faq-item__answer strong {
    color: var(--text-primary);
    font-weight: 600;
}

.faq-item__answer ul,
.faq-item__answer ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.faq-item__answer li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

/* Legacy support for answer-content wrapper */
.faq-item__answer-content {
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    border: none;
    margin: 0;
}

.faq-item__answer-content p {
    margin-bottom: 1.25rem;
}

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

/* Number Badge (opcional) */
.faq-item__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(65, 107, 153, 0.1);
    color: var(--primary);
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 700;
    margin-right: 1rem;
    flex-shrink: 0;
}

.faq-item.active .faq-item__number {
    background: var(--primary);
    color: var(--text-white);
}

/* Dark Mode Adjustments */
[data-theme="dark"] .faq-item__answer-content {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 767px) {
    .faq-item__question {
        padding: 1.5rem 1.75rem;
        font-size: 1.0625rem;
        gap: 1rem;
    }
    
    .faq-item__answer {
        padding: 0 1.75rem;
        font-size: 1.0625rem;
        line-height: 1.8;
    }
    
    .faq-item.active .faq-item__answer {
        padding-top: 1.25rem;
        padding-bottom: 1.5rem;
    }
    
    .faq-item__icon {
        width: 28px;
        height: 28px;
        min-width: 28px;
    }
    
    .faq-item__icon svg {
        width: 14px;
        height: 14px;
    }
}
