/* ==========================================================================
   ECOPHOT - SYSTÈME DE FORMULAIRES UNIFIÉ
   Fichier: 03-components/forms.css
   ========================================================================== */

/* ==========================================================================
   STYLES DE BASE POUR FORMULAIRES
   ========================================================================== */

/* Groupes de champs */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

/* Grille de formulaire */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* ==========================================================================
   ÉLÉMENTS D'ENTRÉE
   ========================================================================== */

/* Input avec bordure simple */
input,
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background-color: white;
}


.textarea-large {
    min-height: 120px;
    resize: vertical;
}

/* ==========================================================================
   FORMULAIRES SPÉCIALISÉS
   ========================================================================== */

/* Formulaire de devis */
.quote-form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin: 30px 0;
}

.quote-form h3 {
    color: var(--primary);
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

/* Formulaire de contact */
.contact-form {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.contact-form h2 {
    color: var(--primary);
    margin-bottom: 30px;
    font-size: 1.8rem;
    text-align: center;
}

/* Formulaire de commentaires */
.comment-form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.comment-form h3 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
}

/* ==========================================================================
   BOUTONS DE SOUMISSION
   ========================================================================== */
.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(26, 115, 232, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.submit-btn:active {
    transform: translateY(0);
}

/* Section de soumission */
.submit-section {
    text-align: center;
    margin-top: 30px;
}

/* ==========================================================================
   GROUPES DE CHECKBOXES ET RADIOS
   ========================================================================== */

/* Groupe de checkboxes */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin: 10px 0;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.checkbox-group h3 {
    grid-column: 1 / -1;
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.checkbox-group.error {
    border: 2px solid #e74c3c;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.checkbox-item:hover {
    background: #e8f4f8;
}

.checkbox-item input {
    width: auto;
    margin-right: 8px;
    transform: scale(1.2);
}


/* Groupe de radios */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.radio-item:hover {
    background: #f0f7ff;
}

.radio-item input[type="radio"] {
    width: auto;
    margin-right: 10px;
    transform: scale(1.2);
}

.radio-item label {
    margin: 0;
    cursor: pointer;
    flex: 1;
}

/* Type de question */
.question-type {
    background: #e8f4f8;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.question-type h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* ==========================================================================
   SYSTÈME DE NOTATION (ÉTOILES)
   ========================================================================== */

.rating-stars {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.star {
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none;
}

.star:hover,
.star.active {
    color: #ffd700;
}

/* ==========================================================================
   BOUTONS UTILES/PAS UTILES
   ========================================================================== */

.helpful-btn {
    background: none;
    border: 1px solid #e0e0e0;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.helpful-btn:hover {
    background: #f0f0f0;
    border-color: var(--primary);
}

.helpful-btn.voted {
    background: #e8f4fd;
    border-color: var(--primary);
    color: var(--primary);
}

.helpful-btn .count {
    font-weight: bold;
}

/* ==========================================================================
   CHAMPS CONDITIONNELS
   ========================================================================== */

.conditional-field {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    animation: formReveal 0.3s ease;
}

.conditional-field.show {
    display: block;
}

.conditional-field label {
    color: #856404;
    font-weight: 600;
}

.conditional-field input,
.conditional-field textarea {
    border-color: #ffeaa7;
    background-color: white;
}

/* Animation composée (transform + opacity uniquement) pour éviter CLS */
@keyframes formReveal {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   VALIDATION ET MESSAGES D'ERREUR
   ========================================================================== */

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 5px;
    display: none;
}

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

.required {
    color: #e74c3c;
}

/* ==========================================================================
   TEMPS DE RÉPONSE
   ========================================================================== */

.response-time {
    background: linear-gradient(135deg, #34a853, #2e7d32);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-top: 40px;
}

.response-time h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.response-time p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* ==========================================================================
   FORMULAIRES SPÉCIAUX - NEWSLETTER
   ========================================================================== */

.newsletter-box {
    background: linear-gradient(135deg, var(--primary) 0%, #34a853 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-top: 30px;
    text-align: center;
}

.newsletter-input {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    margin: 15px 0;
    box-sizing: border-box;
}

.newsletter-btn {
    background:var(--white);
    color: var(--primary);
    padding: 12px 20px;
    border: 2px solid var(--white);
    border-radius: 5px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.newsletter-btn:hover {
    background: #f8f9fa;
}

/* ==========================================================================
   FORMULAIRES DE RECHERCHE
   ========================================================================== */

.search-section {
    background: #f8f9fa;
    padding: 40px;
    border-radius: 15px;
    margin: 40px 0;
    text-align: center;
}

/* ==========================================================================
   BOUTONS SPÉCIALISÉS
   ========================================================================== */

.btn-contact:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

.btn-copy-css,
.btn-close-modal {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.btn-copy-css:hover,
.btn-close-modal:hover {
    background: #e8f4f8;
    border-color: var(--primary);
    color: var(--primary);
}

/* ==========================================================================
   FONCTIONNALITÉS INCLUSES
   ========================================================================== */

.features-included {
    background: #f8f9fa;
    padding: 30px 0;
}



.feature-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ==========================================================================
   CTA HIGHLIGHT
   ========================================================================== */

.cta-highlight {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    margin: 40px 0;
}

.warranty-section {
    background: #e7f3ff;
    padding: 30px;
    border-radius: 10px;
    margin: 30px 0;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 992px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .contact-form,
    .quote-form,
    .comment-form {
        padding: 25px;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .contact-form,
    .quote-form,
    .comment-form {
        padding: 20px;
    }
    
    .checkbox-item,
    .radio-item {
        padding: 8px;
    }
    
    .submit-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    .rating-stars .star {
        font-size: 20px;
    }
    
    .examples-section {
        padding: 20px;
    }
    
    .example-item {
        padding: 15px;
    }
}

/* ==========================================================================
   ACCESSIBILITÉ
   ========================================================================== */

/* Focus visible pour accessibilité */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Amélioration du contraste pour les labels requis */
.required::after {
    content: ' *';
    color: #dc3545;
    font-weight: bold;
}

/* Indication visuelle pour les champs requis */
.form-group.required input,
.form-group.required textarea,
.form-group.required select {
    border-left: 4px solid #ffc107;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .submit-btn,
    .btn-contact,
    .newsletter-btn {
        display: none !important;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        border: 1px solid #333 !important;
        background: white !important;
    }
    
    .contact-form,
    .quote-form,
    .comment-form {
        box-shadow: none !important;
        border: 1px solid #333 !important;
    }
}