/* ==========================================================================
   FAQ STYLES - VERSION FINALE SIMPLIFIÉE
   Compatible avec typography.css et base.css d'Ecophot
   ========================================================================== */

/* ===== HERO SECTION FAQ ===== */
.faq-page .hero {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--astro-blue) 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.faq-page .hero h1 {
    color: white;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.faq-page .hero p {
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
    font-weight: 500;
    max-width: 800px;
    margin: 0 auto 2rem auto;
    line-height: 1.6;
}

#searchInput {
    width: 100%;
    max-width: 500px;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    outline: none;
    transition: all 0.3s ease;
    color: #333;
    font-weight: 500;
}

#searchInput:focus {
    border-color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

#searchInput::placeholder {
    color: #666;
    font-weight: 400;
}

/* ===== SECTIONS ===== */
.faq-page .section {
    padding: 4rem 0;
}

.faq-page .section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.faq-page .section-header h2 {
    color: var(--dark);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.faq-page .section-header p {
    color: #666;
    font-size: 1.1rem;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.faq-page .section-header small {
    color: #777;
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
    margin-top: 0.5rem;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

/* ===== CARTES SOMMAIRE ===== */
.summary-card {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: block;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    text-decoration: none;
    color: inherit;
}

.summary-card .card-content {
    text-align: center;
}

.summary-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.summary-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    color: var(--dark);
    font-weight: 700;
}

.summary-card p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
    font-weight: 500;
}

/* ===== QUESTIONS/RÉPONSES ===== */
.faq-category {
    max-width: 800px;
    margin: 0 auto;
}

.questions-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.faq-item {
    border-bottom: 1px solid #e2e8f0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    padding: 1.5rem 2rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    transition: all 0.3s ease;
    font-family: inherit;
}

.faq-question:hover {
    background: #f8f9fa;
    color: var(--primary);
}

.faq-question:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    background: #f8f9fa;
}

.question-text {
    flex: 1;
    text-align: left;
}

.toggle-icon {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    margin-left: 1rem;
    transition: transform 0.3s ease;
}

.faq-item.active .toggle-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f8f9fa;
}

.answer-content {
    padding: 1.5rem 2rem 2rem 2rem;
    color: #555;
    line-height: 1.7;
    font-weight: 400;
    font-size: 1rem;
}

/* ===== TEXTES EN GRAS DANS LES RÉPONSES ===== */
.answer-content strong,
.answer-content b {
    color: var(--primary);
    font-weight: 700;
    background: rgba(26, 115, 232, 0.1);
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

.answer-content ul,
.answer-content ol {
    color: #555;
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.answer-content ul li,
.answer-content ol li {
    color: #555;
    font-weight: 400;
    margin-bottom: 0.25rem;
}

.answer-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.answer-content a:hover {
    text-decoration: underline;
}

/* Surlignage de recherche */
mark {
    background: #ffd700;
    padding: 0.1em 0.2em;
    border-radius: 3px;
    color: #333;
    font-weight: 700;
}

/* ===== FORMULAIRE MODERNE ===== */
.contact-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.modern-form {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    border: 2px solid #e0e0e0;
    position: relative;
    overflow: hidden;
}

.modern-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
}

.form-header-icon {
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, #0d5bbc 100%);
    border-radius: 50%;
    color: white;
    box-shadow: 0 8px 25px rgba(26, 115, 232, 0.3);
}

.form-header-icon h3 {
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.form-header-icon p {
    color: #666;
    margin: 0;
    font-weight: 500;
    font-size: 1rem;
}

/* .form-row base → 03-components/forms.css
   Override local pour le formulaire FAQ uniquement */
.modern-form .form-row {
    gap: 2rem;
    margin-bottom: 2rem;
}

.form-group.focused label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:not(:placeholder-shown) + label,
.form-group select:not([value=""]) + label {
    top: -0.5rem;
    left: 0.75rem;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 700;
}

/* ===== CHAMPS DE SAISIE ===== */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
    position: relative;
    z-index: 1;
    color: var(--dark);
    font-weight: 500;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1);
    transform: translateY(-2px);
}

/* Style des placeholders */
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: transparent;
    font-weight: 400;
}

/* Select styling */
.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23333' d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
    padding-right: 3rem;
}

.form-group select option {
    padding: 0.5rem;
    background: white;
    color: var(--dark);
    font-weight: 500;
}

/* Textarea */
.form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    line-height: 1.5;
}

/* États de validation */
.form-group.valid input,
.form-group.valid select,
.form-group.valid textarea {
    border-color: #28a745;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #dc3545;
}

/* Footer du formulaire */
.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

.form-info {
    flex: 1;
    margin-right: 2rem;
}

.form-info small {
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
    font-weight: 500;
    font-size: 0.9rem;
}

.info-icon {
    color: #28a745;
    font-size: 1rem;
}

/* ===== BOUTONS ===== */
.btn-submit {
    position: relative;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, #0d5bbc 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    min-width: 200px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(26, 115, 232, 0.4);
}

.btn-submit:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.3);
}

.btn-icon {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.btn-submit:hover .btn-icon {
    transform: scale(1.1);
}

.btn-text {
    font-weight: 700;
    color: white;
}

/* ===== CARTES DE CONTACT (scoped FAQ) ===== */
/* Scopé .faq-page pour ne pas écraser contact.css */
.faq-page .contact-card {
    text-align: center;
    transition: all 0.3s ease;
}

.faq-page .contact-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.faq-page .contact-card .contact-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.faq-page .contact-card h3 {
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-weight: 700;
    font-size: 1.2rem;
}

.faq-page .contact-card p {
    color: #666;
    margin: 0;
    font-weight: 500;
    font-size: 1rem;
}

/* ===== BOUTON RETOUR EN HAUT ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, #0d5bbc 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(26, 115, 232, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.4);
}

.back-to-top:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .modern-form {
        padding: 2rem;
        border-radius: 15px;
        margin: 0 1rem;
    }
    
    /* .form-row responsive → 09-responsive/mobile.css */

    .form-footer {
        flex-direction: column;
        gap: 1.5rem;
        align-items: stretch;
    }
    
    .form-info {
        margin-right: 0;
        text-align: center;
    }
    
    .btn-submit {
        width: 100%;
        justify-content: center;
    }
    
    .faq-question {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .answer-content {
        padding: 1rem 1.5rem 1.5rem 1.5rem;
    }
    
    .faq-page .hero h1 {
        font-size: 2.2rem;
    }
    
    .faq-page .hero p {
        font-size: 1rem;
    }
    
    .faq-page .section-header h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .modern-form {
        padding: 1.5rem;
    }
    
    .form-header-icon h3 {
        font-size: 1.3rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.875rem;
    }
    
    .form-group label {
        top: 0.875rem;
        left: 0.875rem;
    }
    
    .faq-question {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        text-align: left;
    }
    
    .toggle-icon {
        align-self: flex-end;
        margin-left: 0;
    }
    
    .faq-page .hero h1 {
        font-size: 1.8rem;
    }
    
    .faq-page .section-header h2 {
        font-size: 1.8rem;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-category {
    animation: fadeInUp 0.6s ease-out;
}

.faq-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.faq-item:nth-child(1) { animation-delay: 0.1s; }
.faq-item:nth-child(2) { animation-delay: 0.2s; }
.faq-item:nth-child(3) { animation-delay: 0.3s; }
.faq-item:nth-child(4) { animation-delay: 0.4s; }
.faq-item:nth-child(5) { animation-delay: 0.5s; }

/* ===== ACCESSIBILITÉ ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
        transition-duration: 0.01ms;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .hero,
    .search-box,
    .contact-form,
    .cta-section,
    .back-to-top {
        display: none;
    }
    
    .faq-answer {
        max-height: none;
    }
    
    .toggle-icon {
        display: none;
    }
}

/* ===== BARRE DE RECHERCHE AMÉLIORÉE ===== */
.search-box {
    margin-top: 2rem;
    text-align: center;
    position: relative;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.search-container {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 500px;
}

#searchInput {
    width: 100%;
    padding: 15px 60px 15px 20px; /* Espace pour le bouton à droite */
    font-size: 1.1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    outline: none;
    transition: all 0.3s ease;
    color: #333;
    font-weight: 500;
    box-sizing: border-box;
}

#searchInput:focus {
    border-color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

#searchInput::placeholder {
    color: #666;
    font-weight: 400;
}

/* Bouton de recherche */
.search-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, #0d5bbc 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.search-button:hover {
    background: linear-gradient(135deg, #0d5bbc 0%, var(--primary) 100%);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(26, 115, 232, 0.4);
}

.search-button:focus {
    outline: 2px solid rgba(255,255,255,0.8);
    outline-offset: 2px;
}

.search-button:active {
    transform: translateY(-50%) scale(0.95);
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .search-box {
        margin-top: 1.5rem;
        padding: 0 1rem;
    }
    
    #searchInput {
        font-size: 1rem;
        padding: 12px 50px 12px 18px;
    }
    
    .search-button {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        right: 6px;
    }
}