/* =========================================
   1. LAYOUT GLOBAL & CONTENEUR
   ========================================= */
#digi-survey-wrapper {
    box-shadow: 0 10px 30px rgba(0,0,0,0.08) !important;
    border-radius: 10px;
}
#digi-survey-wrapper .digi-survey-container {
    max-width: 1140px !important;
    padding: 40px;
    background: #ffffff;
    border-radius: 16px;
    font-family: 'Montserrat', Helvetica, Arial, sans-serif;
    color: #333;
    text-align: left !important;
    box-sizing: border-box;
}
@media all and (max-width: 700px){
    #digi-survey-wrapper .digi-survey-container{ padding: 20px; }
}

.digi-survey-container * { text-align: left; }
.digi-survey-container .next-btn { margin-left: auto; text-align: center; }
.digi-btn:disabled { opacity: 0.7; cursor: not-allowed; background: #666; }

.digi-error-msg {
    background-color: #ffe6e6; color: #d63031; border: 1px solid #ff7675; padding: 10px 15px; border-radius: 6px; margin-bottom: 20px; font-size: 0.9rem; font-weight: 600;
}

/* =========================================
   2. FORMULAIRE UTILISATEUR
   ========================================= */
.digi-form { width: 100%; text-align: left; }
.form-row { margin-bottom: 25px; }
.form-row label { display: block; font-weight: 700; margin-bottom: 5px; color: #333; font-size: 0.9rem; }

.form-row input[type="text"], .form-row input[type="email"] {
    width: 100%; padding: 10px; border: 2px solid #eee; border-radius: 8px; font-size: 0.95rem; transition: border 0.3s; box-sizing: border-box;
}
#digi-survey-wrapper .digi-survey-container .form-row input:focus { border-color: #0073aa; outline: none; }
#digi-survey-wrapper .digi-survey-container .form-checks { display: flex !important; gap: 30px; margin-bottom: 20px; }
#digi-survey-wrapper .digi-survey-container .form-checks label { display: block; margin-bottom: 8px; font-size: 1rem; color: #555; cursor: pointer; }
#digi-survey-wrapper .digi-survey-container .form-checks input { width: 20px; height: 20px; margin-top: 4px; margin-right: 5px; }

/* =========================================
   3. INTRO
   ========================================= */
.intro-text p { font-size: 1rem; line-height: 1.5; margin-bottom: 20px; color: #444; }
.intro-scale-example {
    background: #f4f6f8; padding: 15px; border-radius: 8px; margin: 20px 0; font-size: 0.9rem; display: flex; justify-content: space-between; align-items: center;
}

/* =========================================
   4. CARTE QUESTION + HEADER (NEW)
   ========================================= */
/* Barre flexible : Compteur à gauche, Lien à droite */
.digi-progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.q-counter {
    font-size: 0.8rem; color: #999; text-transform: uppercase; letter-spacing: 1px;
}

.save-link {
    font-size: 0.85rem;
    color: #0073aa;
    text-decoration: underline;
    cursor: pointer;
}
.save-link:hover { color: #005177; }

.q-header-left { margin-bottom: 25px; }
.q-cat { font-size: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #0073aa; margin-bottom: 5px; }
.sub-cat, .q-sub { color: #666; font-weight: 400; font-size: 0.9rem; margin-bottom: 10px; }
.q-text { margin-top: 0; margin-bottom: 30px; font-size: 1.4rem; line-height: 1.3; color: #222; font-weight: 600; }

/* =========================================
   5. SYSTÈME DE VOTE
   ========================================= */
.digi-scale-squares { display: flex; justify-content: flex-start; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.square-item { cursor: pointer; position: relative; flex: 1; }
.square-item input { position: absolute; opacity: 0; width: 0; height: 0; }
.square-box {
    width: 100%; height: 80px; background: #f4f6f8; border: 2px solid #e0e0e0; border-radius: 10px; display: flex; justify-content: center; align-items: center; font-size: 1.5rem; font-weight: bold; color: #666; transition: all 0.2s ease;
}
.square-item:hover .square-box { border-color: #0073aa; color: #0073aa; transform: translateY(-2px); }
.square-item input:checked + .square-box { background-image: linear-gradient(135deg, #1E96FC 0%, #9E1EFC 100%); color: #ffffff; box-shadow: 0 4px 15px rgba(0, 115, 170, 0.3); transform: scale(1.05); }

/* =========================================
   6. COMMENTAIRE
   ========================================= */
#comment-wrapper { margin-top: 20px; text-align: left; }
#comment-wrapper label { display: block; font-weight: bold; margin-bottom: 8px; color: #333; font-size: 0.9rem; }
#comment-wrapper textarea { width: 100%; padding: 12px; border: 2px solid #ddd; border-radius: 8px; font-family: inherit; resize: vertical; box-sizing: border-box; font-size: 0.95rem; }
#comment-wrapper textarea:focus { border-color: #0073aa; outline: none; }

/* =========================================
   7. BOUTONS
   ========================================= */
#digi-survey-wrapper .digi-survey-container .digi-btn {
    background-image: linear-gradient(135deg, #1E96FC 0%, #9E1EFC 100%); color: white; border: none; padding: 15px 30px; border-radius: 10px; font-size: 1rem; font-weight: bold; cursor: pointer; transition: background 0.3s, transform 0.2s; display: inline-block; text-align: center !important; text-transform: uppercase; transition: .3s;
}
#digi-survey-wrapper .digi-survey-container .digi-btn:hover { background: linear-gradient(90deg, #0073aa 0%, #9E1EFC 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; font-weight: 800; display: inline-block; border: 1px solid #e0e0e0; }
.next-btn { margin-left: auto; display: block; width: fit-content; }
.digi-btn-ghost { background: transparent; border: 1px solid #ccc; color: #666; padding: 12px 20px; border-radius: 5px; cursor: pointer; margin-left: 10px; }
/* AJOUT BUTTON GHOST 
#digi-survey-wrapper .digi-survey-container .digi-btn-ghost {
    background: transparent !important;
    border: 2px solid #ccc !important;
    color: #666 !important;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: 0.3s;
    text-transform: uppercase;
}
#digi-survey-wrapper .digi-survey-container .digi-btn-ghost:hover {
    border-color: #0073aa !important;
    color: #0073aa !important;
}
*/

/* =========================================
   8. MODALE (Save later)
   ========================================= */
.digi-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
}
.digi-modal-content {
    background: white; padding: 30px; border-radius: 12px; max-width: 400px; width: 90%; text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.digi-modal-content h3 { margin-top: 0; color: #2c3e50; }
.digi-modal-actions { margin-top: 20px; display: flex; justify-content: center; }

/* =========================================
   9. RÉSULTATS
   ========================================= */
.average-card { background: white; color: white; padding: 20px; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border: 1px solid #1E96FC; }
.avg-label { font-size: 1.3rem; font-weight: 600; color: black; }
.avg-score { font-size: 2rem; font-weight: 800; }
#digi-survey-wrapper .avg-score small { font-size: 1rem; font-weight: 400; opacity: 0.8; color: black; }
.results-list { border-top: 1px solid #eee; }
.result-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #eee; }
.res-text { flex: 1; padding-right: 20px; }
.res-cat { font-size: 0.75rem; text-transform: uppercase; color: #888; letter-spacing: 0.5px; }
.res-text p { margin: 3px 0 0; font-weight: 600; font-size: 0.95rem; color: #333; }
.res-score { flex-shrink: 0; }
.score-badge { display: inline-flex; justify-content: center; align-items: center; width: 35px; height: 35px; border-radius: 8px; background: #f0f0f0; font-weight: bold; color: #444; }
.score-badge.s-5, .score-badge.s-4 { background: #dff9fb; color: #0073aa; }
.score-badge.s-1, .score-badge.s-2 { background: #ffe6e6; color: #d63031; }
.digi-text-gradient { background: linear-gradient(90deg, #0073aa 0%, #00c6ff 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; font-weight: 800; display: inline-block; }
.cats-grid { margin-top: 30px; text-align: left; }
.cat-card-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; margin-bottom: 10px; border-radius: 8px; border: 1px solid #eee; transition: transform 0.2s; }
.cat-card-item:hover { transform: translateX(5px); border-color: #ddd; }
.cat-name { font-weight: 700; color: #333; font-size: 0.95rem; text-transform: capitalize; }
.cat-score { font-weight: 800; font-size: 1.1rem; padding: 5px 10px; border-radius: 6px; background: #fff; color: #333; }
.cat-score.s-5, .cat-score.s-4 { color: #0073aa; border: 1px solid #dff9fb; background: #f0fbff; }
.cat-score.s-3 { color: #e67e22; border: 1px solid #fceabb; background: #fffbf2; }
.cat-score.s-2, .cat-score.s-1 { color: #d63031; border: 1px solid #fad390; background: #fff0f0; }