/* ==========================================================================
   DESIGN GLOBAL DU PLUGIN - CENTRAGE TOTAL
   ========================================================================== */

.diag-2vie-wrapper {
    max-width: 600px;
    margin: 40px auto;
    background: #ffffff !important;
    padding: 40px !important;
    border-radius: 20px !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1) !important;
    border-top: 6px solid #295379 !important;
    box-sizing: border-box !important;
    text-align: center !important;
    position: relative !important;
}

/* Gestion des étapes */
.step { 
    display: none; 
}

.step.active { 
    display: block !important; 
}

/* Titre de l'étape - Très Grand et Centré */
.step-title, .step h3 {
    display: block !important;
    text-align: center !important;
    width: 100% !important;
    font-size: 2rem !important;
    color: #295379 !important;
    margin-bottom: 35px !important;
    font-weight: 800 !important;
}

/* ==========================================================================
   ÉTAPE 1 : LES BOUTONS DE DOMAINE
   ========================================================================== */

.options-grid {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 20px !important;
    width: 100% !important;
}

.options-grid label {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    
    width: 100% !important;
    max-width: 450px !important;
    min-height: 80px !important;
    
    padding: 15px 25px !important;
    background: #f8f9fa !important;
    border: 2px solid #eaeff3 !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    
    font-size: 1.6rem !important;
    font-weight: 600 !important;
    color: #333 !important;
    transition: all 0.2s ease-in-out !important;
}

.options-grid label:hover {
    background: #295379 !important;
    color: #ffffff !important;
    border-color: #295379 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(41, 83, 121, 0.3) !important;
}

/* Style quand le bouton radio est sélectionné */
.options-grid input[type="radio"]:checked + label,
.options-grid label:has(input[type="radio"]:checked) {
    background: #295379 !important;
    color: #ffffff !important;
    border-color: #295379 !important;
    box-shadow: 0 5px 15px rgba(41, 83, 121, 0.3) !important;
}

/* Cache le rond du bouton radio pour un look "bouton" pur */
.options-grid input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ==========================================================================
   ÉTAPES 2 & 3 : CHAMPS ET NAVIGATION
   ========================================================================== */

.field-group {
    text-align: center !important;
    margin-bottom: 25px !important;
}

.field-group label {
    display: block !important;
    margin-bottom: 10px !important;
    font-weight: 600 !important;
    color: #295379 !important;
}

select, input[type="text"], input[type="email"], input[type="tel"] {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 15px !important;
    margin-bottom: 20px !important;
    border: 2px solid #eaeff3 !important;
    border-radius: 10px !important;
    font-size: 1.1rem !important;
    text-align: center !important;
    text-align-last: center !important;
    box-sizing: border-box !important;
    transition: border-color 0.3s ease !important;
}

select:focus, input:focus {
    outline: none !important;
    border-color: #295379 !important;
}

/* Champs conditionnels "Autre" */
#panne-autre-input, #composant-autre-input {
    border-color: #ffc107 !important;
    background-color: #fffef5 !important;
    font-style: italic !important;
}

#panne-autre-input:focus, #composant-autre-input:focus {
    border-color: #ff9800 !important;
    background-color: #fff !important;
}

/* Boîte de temps estimé */
.time-box {
    background: #e3f2fd !important;
    padding: 15px !important;
    color: #1976d2 !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    margin: 20px 0 !important;
    font-size: 1.2rem !important;
    text-align: center !important;
    border-left: 4px solid #1976d2 !important;
}

/* Boîte de prix */
.price-box {
    background: #fff3e0 !important;
    padding: 20px !important;
    color: #d35400 !important;
    font-weight: 800 !important;
    border-radius: 10px !important;
    margin: 20px 0 !important;
    font-size: 1.5rem !important;
    text-align: center !important;
    border-left: 4px solid #d35400 !important;
    animation: slideIn 0.3s ease !important;
}

/* Boîte de déplacement */
.deplacement-box {
    background: #e8f5e9 !important;
    padding: 20px !important;
    color: #2e7d32 !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    margin: 20px 0 !important;
    font-size: 1.3rem !important;
    text-align: center !important;
    border-left: 4px solid #4caf50 !important;
    display: none !important;
}

.deplacement-box.visible {
    display: block !important;
    animation: slideIn 0.3s ease !important;
}

.deplacement-box small {
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    color: #1b5e20 !important;
    display: block !important;
    margin-top: 8px !important;
}

/* Avertissement ville */
.warning-box {
    background: #fff3cd !important;
    padding: 15px !important;
    color: #856404 !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    margin: 20px 0 !important;
    font-size: 1rem !important;
    text-align: center !important;
    border-left: 4px solid #ffc107 !important;
}

/* Boutons de navigation */
.nav-buttons {
    display: flex !important;
    justify-content: center !important;
    gap: 15px !important;
    margin-top: 30px !important;
}

button {
    padding: 18px 35px !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-align: center !important;
}

.next-btn, #submit-diag {
    background: #295379 !important;
    color: white !important;
}

.next-btn:hover, #submit-diag:hover {
    background: #1e3f5a !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(41, 83, 121, 0.4) !important;
}

.prev-btn {
    background: #6c757d !important;
    color: white !important;
}

.prev-btn:hover {
    background: #545b62 !important;
}

.reset-btn {
    background: #28a745 !important;
    color: white !important;
    margin-top: 20px !important;
}

.reset-btn:hover {
    background: #218838 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4) !important;
}

/* ==========================================================================
   ÉTAPE 4 : CONFIRMATION
   ========================================================================== */

.success-title {
    color: #28a745 !important;
    font-size: 2.5rem !important;
    margin-bottom: 30px !important;
}

.success-message {
    background: #d4edda !important;
    padding: 30px !important;
    border-radius: 15px !important;
    border-left: 6px solid #28a745 !important;
    margin-bottom: 30px !important;
}

.success-message p {
    font-size: 1.2rem !important;
    color: #155724 !important;
    margin: 10px 0 !important;
}

/* ==========================================================================
   OVERLAY DE CHARGEMENT
   ========================================================================== */

#loading-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 9999 !important;
    display: none !important; /* Caché par défaut */
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}

#loading-overlay.active {
    display: flex !important; /* Affiche quand actif */
}

#loading-overlay p {
    color: white !important;
    font-size: 1.3rem !important;
    margin-top: 20px !important;
}

.spinner {
    border: 5px solid #f3f3f3 !important;
    border-top: 5px solid #295379 !important;
    border-radius: 50% !important;
    width: 60px !important;
    height: 60px !important;
    animation: spin 1s linear infinite !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   RESPONSIVE - MOBILE
   ========================================================================== */

@media (max-width: 600px) {
    .diag-2vie-wrapper {
        padding: 25px !important;
        margin: 20px !important;
    }
    
    .options-grid label {
        font-size: 1.3rem !important;
        max-width: 100% !important;
        min-height: 70px !important;
    }
    
    .step-title, .step h3 {
        font-size: 1.5rem !important;
    }
    
    button {
        padding: 15px 25px !important;
        font-size: 1rem !important;
    }
    
    .nav-buttons {
        flex-direction: column !important;
    }
    
    .nav-buttons button {
        width: 100% !important;
    }
    
    .price-box {
        font-size: 1.3rem !important;
    }
}

/* ==========================================================================
   COMPATIBILITÉ AVEC DIFFÉRENTS THÈMES
   ========================================================================== */

.diag-2vie-wrapper * {
    box-sizing: border-box !important;
}

/* Réinitialisation des marges des inputs pour éviter les conflits */
.diag-2vie-wrapper input,
.diag-2vie-wrapper select {
    margin-top: 0 !important;
}
