/* ===================================================================
//  MON COURTIER PERSO - SIMULATEUR ACHAT DANS LE NEUF
//  v9.0 - CSS Final, Complet et Unifié
// =================================================================== */
:root {
    --primary-orange: #f7941d; --dark-orange: #e67e22; --text-color: #333;
    --light-gray: #f4f4f4; --border-color: #ddd; --slider-track-bg: #e0e0e0;
    --active-section-bg: #fef5e8;
    --color-green: #2ecc71; --color-orange: #f39c12; --color-red: #e74c3c;
    --primary-blue-green: #43868D; 
    --primary-blue-green-dark: #3a757a;
}
.mcp-simulator-pro-body { font-family: 'Poppins', sans-serif; }
.mcp-simulator-title { font-family: 'Montserrat', sans-serif; text-align: center; margin-bottom: 0.25rem; font-weight: 700; color: #555; }
.mcp-simulator-brand { text-align: center; margin-top: 0; margin-bottom: 1rem; font-size: 0.8em; color: #777; font-weight: bold; }
.mcp-simulator-subtitle { text-align: center; margin-top: -0.5rem; margin-bottom: 2rem; font-style: italic; color: #777; }

/* --- MISE EN PAGE PRINCIPALE (GRID) --- */
.simulator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
.result-panel-container {
    position: sticky;
    top: 20px;
}
@media (max-width: 768px) {
    .simulator-container {
        grid-template-columns: 1fr;
    }
    .result-panel-container {
        position: static;
    }
}
/* --- SYSTÈME D'ACCORDÉON SANS ANIMATION (ROBUSTE) --- */
.mcp-simulator-pro-body .accordion-item {
    border: 1px solid var(--border-color, #e0e0e0);
    margin-bottom: 1rem;
    border-radius: 8px;
}
.mcp-simulator-pro-body .accordion-header {
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    user-select: none;
    font-weight: 700;
}
.mcp-simulator-pro-body .accordion-header::before {
    content: '▶';
    font-size: 0.7em;
    margin-right: 1rem;
    transition: transform 0.3s ease;
}
.mcp-simulator-pro-body .accordion-item.active > .accordion-header::before {
    transform: rotate(90deg);
}
.mcp-simulator-pro-body .accordion-body {
    display: none;
    padding: 1rem 1.2rem 1.5rem 1.2rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
}
.mcp-simulator-pro-body .accordion-item.active .accordion-body {
    display: block;
}

/* --- MODIFICATEURS DE COULEUR/STYLE ACCORDÉONS --- */
.input-panel .accordion-header { background-color: var(--primary-orange, #f7941d); color: white; border: 3px solid white; }
.input-panel .accordion-header:hover { background-color: var(--dark-orange, #e67e22); }
.input-panel .accordion-header::before { color: white; }
.input-panel .accordion-item.active .accordion-body { background-color: var(--active-section-bg, #fef5e8); }
.result-panel .accordion-header { background-color: var(--primary-blue-green, #43868D); color: white; border: 3px solid var(--light-gray, #f4f4f4); }
.result-panel .accordion-header:hover { background-color: var(--primary-blue-green-dark, #3a757a); }
.result-panel .accordion-header::before { color: white; }
.result-panel .accordion-item.active .accordion-body { background-color: #fdfdfd; }

/* --- MISE EN PAGE DU CONTENU DES RÉSULTATS (GRID) --- */
.result-panel .result-details-list .result-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: 15px;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.result-panel .result-details-list .result-item:last-child { border-bottom: none; }
.result-panel .result-details-list .result-label { text-align: left; padding-right: 10px; }
.result-panel .result-details-list .result-value { text-align: right; font-weight: 600; word-break: break-word; }
.result-panel .result-details-list .result-value em { display: block; font-size: 0.8em; font-style: italic; font-weight: 400; color: #777; }
.ptz-final-amount .result-label, .ptz-final-amount .result-value { font-weight: 700; font-size: 1.1rem; color: var(--primary-blue-green); }

/* --- AUTRES STYLES (CONSERVÉS) --- */
.input-group { margin-bottom: 0.8rem; position: relative; }
.input-line { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.input-line label { position: relative; flex-grow: 1; font-weight: 600; font-size: 0.85rem; }
.suggested-rate { font-weight: 400; font-style: italic; color: #888; font-size: 0.8em; margin-left: 5px; }
.info-bulle { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background-color: #aaa; color: white; text-align: center; font-size: 12px; line-height: 16px; cursor: help; margin-left: 8px; position: relative; }
.info-bulle .tooltip-text { visibility: hidden; width: max-content; max-width: 250px; background-color: #555; color: #fff; text-align: left; border-radius: 6px; padding: 8px 12px; position: absolute; z-index: 10; bottom: 125%; left: 50%; transform: translateX(-50%); opacity: 0; transition: opacity 0.3s; font-style: normal; font-weight: 400; white-space: normal; }
@media (max-width: 768px) { .info-bulle .tooltip-text { bottom: auto; top: 125%; } }
.info-bulle:hover .tooltip-text { visibility: visible; opacity: 1; }
.input-with-unit { position: relative; display: flex; align-items: center; border: 1px solid var(--border-color); border-radius: 6px; background-color: white; max-width: 140px; flex-shrink: 0; }
.input-with-unit .value-display { padding: 6px 8px; font-size: 0.9rem; font-weight: 600; text-align: right; width: 100%; border: none; background: transparent; color: var(--text-color); }
.input-with-unit .value-display::placeholder { color: #cccccc; opacity: 1; }
.input-with-unit .unit { color: #777; font-size: 0.85rem; padding-right: 10px; }
.value-display.full-width { max-width: none; width: 100%; border: 1px solid var(--border-color); border-radius: 6px; background-color: white; margin-top: 5px; text-align: left; padding: 10px; }
.value-display.select-style { max-width: none; width: 100%; border: 1px solid var(--border-color); border-radius: 6px; background-color: white; -webkit-appearance: none; appearance: none; background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23AAAAAA%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'); background-repeat: no-repeat; background-position: right .9em top 50%; background-size: .65em auto; padding-right: 2.5em; }
#zone-ptz-resultat-wrapper { text-align: right; font-size: 0.9em; color: var(--dark-orange); margin-top: 8px; display: none; }
#zone-ptz-resultat { font-weight: bold; }
.borrower-separator { border: none; border-top: 1px dashed var(--border-color); margin: 1.8rem 0; }
#emprunteur-2-inputs, #revenus-locatifs-group { margin-top: 1.2rem; }
input[type="range"] { -webkit-appearance: none; width: 100%; height: 6px; background: var(--slider-track-bg); border-radius: 3px; outline: none; cursor: pointer; margin-top: 0.4rem; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; background: var(--primary-orange); border-radius: 50%; border: 2px solid white; box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); cursor: grab; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; background: var(--primary-orange); border-radius: 50%; border: 2px solid white; box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); cursor: grab; }
.main-result { text-align: center; margin-bottom: 1rem; }
.main-result .result-label { font-size: 1.4rem; color: #555; font-weight: bold; min-height: 48px; transition: all 0.2s ease; }
.main-result .result-value { font-size: 2.5rem; font-weight: 700; color: var(--primary-orange); line-height: 1.2; display: block; }
.secondary-result { text-align: center; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-color); }
.result-accordion { margin-top: 1.5rem; border-top: 1px solid var(--border-color); padding-top: 1.5rem; }
#rav-indicator { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-left: 5px; }
.cta-button { display: inline-block; background-color: var(--primary-orange); color: white; padding: 12px 25px; border-radius: 8px; text-decoration: none; font-weight: 600; transition: background-color 0.3s; }
.cta-button:hover { background-color: var(--dark-orange); }
.disclaimer { font-size: 0.8rem; color: #777; margin-top: 1.5rem; text-align: center; }
#autocomplete-results { position: absolute; top: 100%; left: 0; right: 0; background-color: white; border: 1px solid var(--border-color); border-top: none; border-radius: 0 0 6px 6px; z-index: 1000; max-height: 200px; overflow-y: auto; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.autocomplete-item { padding: 10px 15px; cursor: pointer; font-size: 0.9em; }
.autocomplete-item:hover { background-color: var(--active-section-bg); }
#mensualite-details-container { margin-top: 1.5rem; margin-bottom: 1.5rem; padding: 1rem; background-color: rgba(0,0,0,0.05); border-radius: 8px; display: none; }
.highlighted-result { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background-color: rgba(247, 148, 29, 0.08); padding: 0.8rem 1rem; border-radius: 8px; margin: 1rem 0; border-top: 1px solid rgba(247, 148, 29, 0.2); border-bottom: 1px solid rgba(247, 148, 29, 0.2); }
.result-item-indented { padding-left: 1.5rem; font-size: 0.9em; color: #555; }
.result-item-indented .result-label::before { content: '↳'; margin-right: 0.5rem; font-weight: bold; }
.result-item-offset { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border-color); }
.result-sub-header { font-weight: 600; color: #555; margin-top: 0.8rem; margin-bottom: 0.2rem; font-size: 0.9em; padding-left: 0.2rem; border-bottom: 1px solid var(--border-color); }
#result-endettement { font-weight: 700; }
.ptz-plafond-label { font-size: 0.8em; font-style: italic; color: #888; margin-left: 0.5rem; font-weight: 400; }
/* Règle générale pour que TOUTES les lignes de financement soient bien alignées */
.result-item {
    display: flex;
    justify-content: space-between;
}

/* Par défaut, les deux éléments PTZ sont cachés */
#ptz-summary-line,
#ptz-details-accordion {
    display: none;
}

/* Quand JS ajoute la classe .visible, on affiche chaque élément correctement */
#ptz-summary-line.visible {
    display: flex; /* 'flex' pour l'alignement droite/gauche parfait */
}
#ptz-details-accordion.visible {
    display: block; /* 'block' pour l'affichage normal de l'accordéon */
}/* ===================================================================
//  STYLE POUR LE TABLEAU DES PALIERS
// =================================================================== */
.paliers-container {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 1.5rem;
    font-size: 0.9em;
    overflow: hidden;
}
.paliers-header, .palier-row, .paliers-footer {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    text-align: center;
    align-items: center;
    gap: 0.5rem;
}
.paliers-header {
    background-color: #e9ecef;
    padding: 0.75rem 0.5rem;
    font-weight: 700;
    color: #495057;
}
.palier-titre { display: block; font-size: 0.95em; }
.palier-duree { display: block; font-size: 0.8em; font-weight: 400; color: #6c757d; }
.palier-row, .paliers-footer { padding: 0.6rem 0.5rem; border-top: 1px solid #dee2e6; }
.palier-label { font-weight: 600; text-align: left; padding-left: 1rem; }
.palier-cell.total { font-weight: 700; }
.paliers-footer.grand-total {
    background-color: var(--primary-blue-green-dark);
    color: white;
    font-size: 1.05em;
    font-weight: 700;
}
.palier-label .info-bulle {
    background-color: #ced4da;
    width: 14px;
    height: 14px;
    font-size: 10px;
    line-height: 14px;
}
/* Style final pour l'accordéon du graphique :
   Affichage instantané, SANS animation, avec une hauteur fixe. */
#chart-accordion .accordion-body {
    display: none; /* Caché par défaut */
    padding: 1rem;
    transition: none !important; /* Force la suppression de l'animation */
}

#chart-accordion.active .accordion-body {
    display: block; /* Affiché quand il est actif */
    height: 250px;  /* Hauteur fixe pour que le graphique soit visible */
}/* Corrige la mise en page verticale pour la Durée et le Taux */
.secondary-result .input-group.highlighted-result {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem; /* Ajoute un petit espace entre la ligne du haut et la réglette */
}/* Style pour la case de la mensualité cible */
#result-mensualite-cible.value-display {
    font-weight: bold;
    color: var(--primary-orange);
    font-size: 1.2rem; /* On agrandit un peu pour la lisibilité */
}/* Réduire la hauteur des blocs Durée/Taux/Mensualité */
.secondary-result .highlighted-result {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    margin-top: 0.6rem;
    margin-bottom: 0.6rem;
}/* Style pour le message d'alerte d'endettement */
#endettement-alerte {
    color: #c0392b; /* Rouge */
    font-weight: bold;
    text-align: center;
    padding: 0.75rem;
    margin-top: 1rem;
    border: 1px solid #c0392b;
    border-radius: 8px;
    background-color: rgba(192, 57, 43, 0.05);
}/* Règle pour masquer la colonne Période 3 */
.paliers-container.hide-p3 .palier-col:nth-child(4),
.paliers-container.hide-p3 .palier-cell:nth-child(4) {
    display: none;
}

/* On ajuste la grille pour qu'elle ne prenne que 3 colonnes quand la P3 est masquée */
.paliers-container.hide-p3 .paliers-header,
.paliers-container.hide-p3 .palier-row,
.paliers-container.hide-p3 .paliers-footer {
    grid-template-columns: 2fr 1fr 1fr;
}