:root {
    /* Couleurs de marque */
    --main-green: #00C49A;
    --dark-blue: #0B2330;
    
    /* Fond de page : Gris souris moderne */
    --bg-color: #F2F4F6;

    /* Glass Effect (Plus opaque pour la lisibilité) */
 /*   --glass-bg: rgba(255, 255, 255, 0.9);
 /*   --glass-border: rgba(255, 255, 255, 0.5);
 /*   --shadow: 0 4px 20px rgba(0, 0, 0, 0.05); 

/* Fond très transparent (10% à 15% d'opacité) */
    --glass-bg: rgba(255, 255, 255, 0.15); 
    
    /* Bordure plus subtile pour délimiter sans alourdir */
    --glass-border: rgba(255, 255, 255, 0.2);
    
    /* Une ombre un peu plus douce pour donner de la profondeur */
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    
    /* Couleurs pour les dégradés dynamiques (INCHANGÉES) */
    --grad-red: #e53935;
    --grad-green: #43a047;
    --grad-yellow: #ffe082;
    
    --radius: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    /* Léger dégradé subtil gris sur gris pour la profondeur */
    background-image: linear-gradient(to bottom, #ffffff 0%, var(--bg-color) 400px);
    color: var(--dark-blue);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Empêche le scroll global sur Desktop */
}

/* Suppression des blobs pour épuré le style */
.background-blobs { display: none; }

/* --- CONTENEUR PRINCIPAL --- */
.glass-dashboard {
    width: 96vw;
    height: 92vh; /* Prend presque toute la hauteur */
    max-width: 1600px;
    
    display: grid;
    /* Grid intelligent : 
       - Gauche : Fixe 300px 
       - Centre : Flexible (prend le reste) 
       - Droite : Fixe 360px 
    */
    grid-template-columns: 300px 1fr 360px; 
    grid-template-rows: 100%; /* Prend toute la hauteur du container */
    gap: 24px;
}

/* --- PANNEAUX GÉNÉRIQUES --- */
.panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    padding: 30px;
    
    display: flex;
    flex-direction: column;
    
    /* GESTION DU SCROLL INTERNE */
    overflow-y: auto; 
    max-height: 100%;
}

/* Scrollbar invisible mais fonctionnelle (Style Mac) */
.panel::-webkit-scrollbar {
    width: 6px;
}
.panel::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}
.panel:hover::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
}

/* --- PANNEAU GAUCHE (Formulaire) --- */
.left-panel {
    gap: 24px;
}

.logo-area {
    margin-bottom: 10px;
}
.subtitle {
    font-size: 0.85rem;
    color: #8898aa;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-blue);
    margin-left: 4px;
}

/* Inputs */
input[type="text"], input[type="number"], select {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #e1e4e8;
    background: #ffffff;
    font-size: 0.95rem;
    color: var(--dark-blue);
    outline: none;
    transition: all 0.2s ease;
    width: 100%;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus {
    border-color: var(--main-green);
    box-shadow: 0 0 0 3px rgba(0, 196, 154, 0.15);
}

.upload-btn {
    background: #ffffff;
    color: var(--dark-blue);
    padding: 20px;
    border-radius: 14px;
    text-align: center;
    cursor: pointer;
    border: 2px dashed #dbe0e6;
    transition: 0.2s;
    font-weight: 600;
    font-size: 0.9rem;
}
.upload-btn:hover {
    border-color: var(--main-green);
    color: var(--main-green);
    background: rgba(0, 196, 154, 0.02);
}

.doc-btn {
    margin-top: auto;
    background: transparent;
    color: var(--main-green);
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid rgba(0, 196, 154, 0.3);
    transition: 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.doc-btn:hover {
    background: var(--main-green);
    color: white;
}

/* --- PANNEAU CENTRAL --- */
.center-panel {
    /* Le panneau central ne scroll pas entièrement, c'est la liste dedans qui scroll */
    overflow: hidden; 
}

.center-panel h3 {
    margin-bottom: 5px;
    font-size: 1.2rem;
    color: var(--dark-blue);
}
.instruction {
    font-size: 0.9rem;
    color: #8898aa;
    margin-bottom: 24px;
}

/* Liste qui scroll indépendamment */
.criteria-list {
    flex: 1; /* Prend l'espace restant */
    overflow-y: auto; /* Active le scroll ici */
    padding-right: 12px; /* Espace pour la scrollbar */
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.criteria-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    transition: transform 0.2s;
}
.criteria-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.04);
}

.criteria-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.emoji {
    font-size: 1.4rem;
    margin-right: 12px;
    background: #f4f5f7;
    padding: 8px;
    border-radius: 10px;
    line-height: 1;
}

.criteria-header h4 {
    flex-grow: 1;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark-blue);
}

.score-display {
    background: var(--dark-blue);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 10px; /* Plus carré arrondi style app */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

/* --- SLIDERS (INCHANGÉS DANS LE FONCTIONNEMENT) --- */
.slider-container {
    position: relative;
    padding: 10px 0;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin: 10px 0;
    display: block;
    position: relative;
    z-index: 2;
}

/* BARRES COLORÉES */
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 10px; /* Un peu plus fin */
    cursor: pointer;
    border-radius: 10px;
    border: none;
}
input[type=range].scale-normal::-webkit-slider-runnable-track {
    background: linear-gradient(90deg, var(--grad-red) 0%, var(--grad-yellow) 50%, var(--grad-green) 100%);
}
input[type=range].scale-invert::-webkit-slider-runnable-track {
    background: linear-gradient(90deg, var(--grad-green) 0%, var(--grad-yellow) 50%, var(--grad-red) 100%);
}

/* BOUTON (THUMB) */
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: white;
    border: 1px solid rgba(0,0,0,0.1); /* Bordure plus fine */
    box-shadow: 0 2px 6px rgba(0,0,0,0.15); /* Ombre portée douce */
    cursor: pointer;
    margin-top: -7px;
    transition: transform 0.1s;
    position: relative;
    z-index: 10;
}

input[type=range]:active::-webkit-slider-thumb {
    transform: scale(1.15);
    border-color: var(--dark-blue);
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    padding: 0 2px;
    margin-top: -8px;
    position: relative;
    z-index: 1;
}

.slider-ticks span {
    font-size: 0.7rem;
    color: #9aa5ab;
    font-weight: 500;
    width: 20px;
    text-align: center;
    padding-top: 6px;
}

.slider-ticks span::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 4px;
    background: #ccc;
}

.help-text {
    font-size: 0.8rem;
    color: #e67e22;
    margin-top: 12px;
    font-weight: 500;
    background: rgba(230, 126, 34, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
}

/* --- PANNEAU DROIT --- */
.right-panel {
    justify-content: flex-start;
    gap: 24px;
}

.image-preview-container {
    width: 100%;
    height: 220px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    background: #fff;
    border: 1px solid rgba(0,0,0,0.05);
    flex-shrink: 0; /* Empêche le rétrécissement */
}

#previewImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.address-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(11, 35, 48, 0.85); /* Plus sombre/opaque */
    backdrop-filter: blur(4px);
    color: white;
    padding: 12px 16px;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    flex-grow: 1; /* Prend l'espace disponible */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.03);
    min-height: 250px; /* Hauteur minimale garantie */
/* S'assure que le panneau ne tente pas de compresser son contenu */
    flex-shrink: 0; 
    /* Force le scroll vertical si le contenu (Image + Score) dépasse la hauteur */
    overflow-y: auto; 
    /* Flex-start est important pour que le scroll commence bien en haut */
    justify-content: flex-start; 
}

.score-number {
    font-size: 4rem;
    font-weight: 800;
    color: var(--dark-blue);
    line-height: 1;
}
.score-total {
    font-size: 1.2rem;
    color: #9aa5ab;
    font-weight: 500;
}
.score-badge {
    background: var(--main-green);
    color: white;
    padding: 7px 18px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.78rem;
    margin-top: 10px;
}

.scale-bar {
    display: flex;
    width: 100%;
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
}

/* Couleurs des classes (INCHANGÉES) */
.scale-step { flex: 1; display: flex; align-items: center; justify-content: center; color: white; font-size: 0.85rem; font-weight: bold; opacity: 0.2; transition: 0.3s; }
.scale-step.A { background: #2e7d32; }
.scale-step.B { background: #66bb6a; }
.scale-step.C { background: #ffee58; color: #444; }
.scale-step.D { background: #ef6c00; }
.scale-step.E { background: #c62828; }

.export-btn {
    background: var(--dark-blue);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    margin-top: auto;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    font-size: 1rem;
    transition: 0.2s;
    box-shadow: 0 4px 12px rgba(11, 35, 48, 0.2);
}
.export-btn:hover {
    background: #153e52;
    transform: translateY(-2px);
}

/* --- AUTOCOMPLETE (API Gouv + Type de bien) --- */
.autocomplete-list {
    position: absolute;
    top: calc(100% + 6px); 
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 12px;
    list-style: none;
    z-index: 1000;
    max-height: 260px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 6px 0;
}

.autocomplete-list li {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
    color: var(--dark-blue);
}

.autocomplete-list li:last-child {
    border-bottom: none;
}

.autocomplete-list li:hover,
.autocomplete-list li[aria-selected="true"] {
    background-color: #f8f9fa;
    color: var(--main-green);
}

/* Menu déroulant "Type de bien" */
#typeList { 
    max-height: 200px;
}

#typeInput {
    caret-color: transparent; /* Cache le curseur de texte */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%230B2330' d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 42px;
}


/* =========================================
   RESPONSIVE DESIGN (Adaptation taille & scroll)
   ========================================= */

/* Tablette : Les colonnes rétrécissent ou passent sous les autres */
@media (max-width: 1200px) {
    .glass-dashboard {
        width: 98vw;
        /* On passe de 300px à 25% pour être plus fluide */
        grid-template-columns: 280px 1fr 300px;
        gap: 15px;
    }
    
    .panel {
        padding: 20px;
    }
}

/* Mobile & Petites Tablettes : Stack Vertical */
@media (max-width: 950px) {
    body {
        height: auto;
        overflow-y: auto; /* Réactive le scroll sur le body */
        padding: 20px 0;
        display: block; /* Enlève le flex center */
    }

    .glass-dashboard {
        display: flex; /* Passe en Flex vertical */
        flex-direction: column;
        height: auto; /* Hauteur automatique selon le contenu */
        max-height: none;
        width: 95%;
        margin: 0 auto;
        gap: 20px;
    }

    .panel {
        /* Sur mobile, on enlève le scroll interne des panneaux pour laisser la page scroller */
        overflow-y: visible; 
        max-height: none;
    }

    .criteria-list {
        overflow-y: visible;
    }
    
    .left-panel, .center-panel, .right-panel {
        width: 100%;
    }
    
    .image-preview-container {
        height: 300px;
    }
}

/* --- STYLE IMPRESSION (PDF / A4) - INCHANGÉ POUR LA FONCTIONNALITÉ --- */
.print-only { display: none; }

@media print {
    @page { margin: 10mm; size: A4; }
    .no-print, .background-blobs, .upload-btn, .export-btn, .doc-btn { display: none !important; }
    
    body { background: white; height: auto; overflow: visible; display: block; }
    .glass-dashboard { display: none; } /* Cache l'interface web */
    
    #printable-report { display: block; width: 100%; }

    /* Reste du CSS d'impression identique à ton fichier d'origine... */
    /* Je n'ai pas tout recopié ici pour gagner de la place, mais garde 
       toute la partie @media print de ton fichier original */
       
    .glass-card {
        border: 1px solid #ccc;
        box-shadow: none;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }
}









/* Amélioration du scroll pour le panneau droit */
.right-panel {
    /* S'assure que le panneau ne tente pas de compresser son contenu */
    flex-shrink: 0; 
    /* Force le scroll vertical si le contenu (Image + Score) dépasse la hauteur */
    overflow-y: auto; 
    /* Flex-start est important pour que le scroll commence bien en haut */
    justify-content: flex-start; 
}

/* AJOUT : Pour les écrans de taille moyenne (Tablettes / Petits PC) */
@media (max-width: 1200px) {
    .glass-dashboard {
        /* On garde la structure mais on s'assure que la hauteur n'est pas rigide */
        min-height: 600px; /* Empêche le dashboard d'être trop petit */
    }

    .right-panel {
        /* On s'assure que le contenu a de la place pour respirer */
        padding-bottom: 40px;
    }
}

.print-logo { height: 50px; }

/* =========================================
   MICRO-COMPONENTS (Startup proto / Jury)
   ========================================= */
.meta-pill {
    margin-top: 6px;
    font-size: 0.75rem;
    color: #6b7280;
    background: rgba(0, 196, 154, 0.08);
    border: 1px solid rgba(0, 196, 154, 0.18);
    padding: 6px 12px;
    border-radius: 999px;
    display: inline-block;
}

.methodology-card {
    width: 100%;
    margin: 14px 0 8px;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 14px;
    background: rgba(255,255,255,0.75);
    padding: 10px 12px;
    text-align: left;
}

.methodology-card summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--dark-blue);
    list-style: none;
}

.methodology-card summary::-webkit-details-marker { display: none; }

.methodology-body {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #4b5563;
    line-height: 1.45;
}

.methodology-body ul {
    margin: 8px 0 0 18px;
}

.methodology-body .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.78rem;
    background: rgba(11, 35, 48, 0.04);
    border: 1px solid rgba(11, 35, 48, 0.06);
    padding: 8px 10px;
    border-radius: 12px;
    margin: 8px 0;
}

.small-muted {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 8px;
}
