/* Bilan énergétique */

.is-hidden {
    display: none !important;
}

.wizard-card {
    overflow: hidden;
}

.wizard-top {
    margin-bottom: 1.25rem;
}

.wizard-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-size: 0.92rem;
}

.wizard-progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e7edf1;
    overflow: hidden;
}

#wizardProgressFill {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #3faf8b, #2e8b6e);
    transition: width 0.25s ease;
}

.wizard-layout {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1.7fr 1fr;
    align-items: start;
}

.wizard-step h2 {
    font-size: 1.25rem;
    margin-bottom: 0.3rem;
}

.wizard-grid-2 {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wizard-grid-3 {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wizard-conditional {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
    background: #f7faf9;
    border: 1px solid #dcebe5;
}

.wizard-actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.wizard-side {
    background: #f9fbfc;
    border: 1px solid #e3eaef;
    border-radius: 12px;
    padding: 1rem;
    position: sticky;
    top: 94px;
}

.wizard-side-title {
    font-size: 1rem;
    margin-bottom: 0.6rem;
}

.wizard-progress-list {
    list-style: none;
    display: grid;
    gap: 0.35rem;
}

.wizard-progress-item {
    font-size: 0.87rem;
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
    color: #5b6772;
    border: 1px solid #eef2f5;
    cursor: pointer;
    user-select: none;
}

.wizard-progress-item:hover {
    border-color: #d5e4dd;
    background: #f4faf7;
}

.wizard-progress-item.is-current {
    border-color: #3faf8b;
    background: #eaf7f1;
    color: #1f6f57;
    font-weight: 600;
}

.wizard-progress-item.is-done {
    border-color: #d6e7df;
    background: #f6fbf8;
    color: #2f7d64;
}

.wizard-result {
    margin-top: 1.4rem;
    padding: 1.4rem;
    border-radius: 14px;
    border: 1px solid #dbe5ed;
    background: linear-gradient(90deg, #ffffff, #f7fbff);
    box-shadow: 0 12px 28px rgba(18, 38, 58, 0.08);
}

.wizard-result-grid {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wizard-kpi {
    padding: 0.8rem;
    border-radius: 10px;
    border: 1px solid #e6edf2;
    background: #ffffff;
}

.wizard-kpi span {
    display: block;
    font-size: 0.85rem;
    color: #667480;
    margin-bottom: 0.2rem;
}

.wizard-kpi strong {
    font-size: 1.08rem;
    color: #24333d;
}

.wizard-kpi.is-positive {
    border-color: #c8e7db;
    background: #f2fbf7;
}

.wizard-kpi.is-negative {
    border-color: #f2cece;
    background: #fff6f6;
}

.wizard-breakdown {
    margin-top: 1rem;
    border: 1px solid #e0e8f0;
    background: #f8fcff;
    border-radius: 10px;
    padding: 0.85rem;
}

.wizard-breakdown h4 {
    font-size: 0.98rem;
    margin-bottom: 0.35rem;
    color: #1a2f42;
}

.wizard-breakdown ul {
    margin-left: 1.1rem;
    color: #4f5d68;
    line-height: 1.5;
}

.wizard-breakdown li {
    margin-bottom: 0.25rem;
}

.wizard-breakdown li strong {
    color: #16344e;
}

.wizard-note {
    margin-top: 1rem;
    font-size: 0.87rem;
    color: #5f6d78;
}

/* ── Bilan résultat ────────────────────────────────────────────── */

.bilan-header {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2ecf4;
}

.bilan-main-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #162b3a;
    margin: 0 0 0.2rem;
}

.bilan-main-subtitle {
    font-size: 0.86rem;
    color: #7a8b96;
    margin: 0;
}

.bilan-battery-card {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f0f6fb;
    border: 1px solid #ccdce9;
    border-radius: 8px;
    padding: 0.4rem 0.85rem;
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.bilan-battery-label {
    color: #566878;
}

.bilan-battery-card strong {
    color: #163249;
}

/* KPI row */
.bilan-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.bilan-kpi {
    border-radius: 12px;
    padding: 1rem 1.1rem;
    border: 1px solid #dce8f0;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bilan-kpi--charge  { border-left: 4px solid #3ca96c; }
.bilan-kpi--discharge { border-left: 4px solid #e07b3a; }
.bilan-kpi--balance { border-left: 4px solid #4a90c4; }
.bilan-kpi--pos { background: #f3fcf7; border-color: #c0e6d5; border-left-color: #2aaa6a; }
.bilan-kpi--neg { background: #fff5f5; border-color: #f5cccc; border-left-color: #d94444; }

.bilan-kpi-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #7a8b96;
    font-weight: 600;
}

.bilan-kpi-value {
    font-size: 1.55rem;
    font-weight: 700;
    color: #162b3a;
    line-height: 1.1;
}

.bilan-kpi-sub {
    font-size: 0.78rem;
    color: #96a6b0;
    margin-top: 0.1rem;
}

/* Jauge couverture */
.bilan-gauge-section {
    margin-bottom: 1.25rem;
    padding: 0.9rem 1rem;
    background: #f5f9fc;
    border: 1px solid #dce6ef;
    border-radius: 10px;
}

.bilan-gauge-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.bilan-gauge-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e4d;
}

.bilan-gauge-pct {
    font-size: 1.15rem;
    font-weight: 700;
    color: #162b3a;
}

.bilan-gauge-track {
    position: relative;
    height: 0.85rem;
    border-radius: 999px;
    background: #dde8f0;
    overflow: hidden;
}

.bilan-gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, #3ca96c, #7dd4a6);
    border-radius: 999px;
    transition: width 0.5s ease;
}

.bilan-gauge-marker {
    position: absolute;
    top: -3px;
    left: 50%;
    width: 2px;
    height: calc(100% + 6px);
    background: #2c5d8a;
}

.bilan-gauge-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.74rem;
    color: #7a8b96;
    margin-top: 0.35rem;
}

/* Grille deux colonnes */
.bilan-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.bilan-breakdown-col {
    border: 1px solid #dce8f0;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    background: #fff;
}

.bilan-col-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eef3f7;
}

.bilan-col-title--charge { color: #1a6d50; border-bottom-color: #c0e6d5; }
.bilan-col-title--discharge { color: #7a3515; border-bottom-color: #f8d9c5; }

/* Rangée item */
.bilan-row {
    margin-bottom: 0.6rem;
}

.bilan-row-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.bilan-row-label {
    color: #3c4e5c;
    flex: 1;
}

.bilan-row-value {
    font-weight: 600;
    color: #162b3a;
    white-space: nowrap;
    font-size: 0.83rem;
}

.bilan-row-value small {
    font-weight: 400;
    color: #96a6b0;
}

.bilan-bar-track {
    height: 5px;
    border-radius: 999px;
    background: #edf2f7;
    overflow: hidden;
}

.bilan-breakdown-col:first-child .bilan-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3ca96c, #7dd4a6);
    border-radius: 999px;
}

.bilan-breakdown-col:last-child .bilan-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #e07b3a, #f5b08a);
    border-radius: 999px;
}

.bilan-col-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid #eaeff4;
    font-size: 0.87rem;
}

.bilan-col-total span { color: #566878; }
.bilan-col-total strong { color: #162b3a; font-size: 0.95rem; }

/* Bouton info solaire */
.bilan-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    border: 1px solid #8ab4cc;
    background: #e8f3fb;
    color: #2c6a92;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 0.3rem;
    padding: 0;
    line-height: 1;
}

.bilan-info-btn:hover {
    background: #d0e8f5;
}

/* Recommandation */
.bilan-reco {
    margin-bottom: 1.25rem;
    border-radius: 12px;
    border: 1px solid #cddfe9;
    background: linear-gradient(135deg, #f0f7fc 0%, #eaf6f1 100%);
    padding: 1rem 1.2rem;
}

.bilan-reco-text {
    font-size: 0.93rem;
    color: #1e3344;
    margin: 0 0 0.85rem;
    line-height: 1.55;
}

.bilan-reco-text .reco-title {
    display: block;
    font-size: 1rem;
    color: #163249;
    margin-bottom: 0.2rem;
}

.bilan-reco-text span {
    display: block;
}

.bilan-reco-text ul {
    margin: 0.45rem 0 0;
    padding-left: 1rem;
}

.bilan-reco-text li {
    margin-bottom: 0.2rem;
}

.bilan-reco-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 0.65rem;
}

.bilan-reco-stat {
    background: #fff;
    border: 1px solid #d0e4ef;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.bilan-reco-stat span {
    font-size: 0.76rem;
    color: #6a7e8c;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.bilan-reco-stat strong {
    font-size: 1.1rem;
    color: #162b3a;
}

.bilan-reco-stat--attention {
    border-color: #f3c79f;
    background: #fff8f1;
}

.bilan-reco-help {
    margin-top: 0.65rem;
    margin-bottom: 0;
    font-size: 0.82rem;
    color: #596d7c;
    line-height: 1.5;
}

.bilan-warning {
    margin-bottom: 1.1rem;
    border: 1px solid #f0c88f;
    background: #fff7eb;
    border-left: 4px solid #de8b2e;
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    color: #6b4a1c;
    font-size: 0.86rem;
    line-height: 1.5;
}

.bilan-warning strong {
    color: #5a3612;
}

/* Notes techniques */
.bilan-footnote {
    border: 1px solid #dce8f0;
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.84rem;
}

.bilan-footnote summary {
    padding: 0.65rem 1rem;
    cursor: pointer;
    font-weight: 600;
    color: #3c5060;
    background: #f2f7fb;
    list-style: none;
    user-select: none;
}

.bilan-footnote summary::-webkit-details-marker { display: none; }
.bilan-footnote summary::before {
    content: '▶ ';
    font-size: 0.7rem;
    color: #7a99ad;
}

.bilan-footnote[open] summary::before { content: '▼ '; }

.bilan-footnote-body {
    padding: 0.85rem 1rem;
    background: #fff;
    color: #4f6272;
    line-height: 1.55;
}

.bilan-footnote-body p { margin: 0 0 0.4rem; }

@media (max-width: 1024px) {
    .bilan-breakdown-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .bilan-kpi-row {
        grid-template-columns: 1fr;
    }

    .bilan-reco-stats {
        grid-template-columns: 1fr;
    }
}

.status-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge-positive { background: #d4f3e6; color: #1a6d50; }
.status-badge-neutral { background: #edf6fb; color: #19657f; }
.status-badge-warning { background: #fff4d3; color: #866e2b; }
.status-badge-deficit { background: #ffe1e0; color: #8b2b36; }

.calc-modal {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.calc-modal.is-hidden {
    display: none;
}

.calc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 25, 34, 0.55);
}

.calc-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: 88vh;
    overflow: auto;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #dce5ec;
    box-shadow: 0 24px 60px rgba(20, 35, 50, 0.22);
}

.calc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid #e8eff5;
}

.calc-modal-body {
    padding: 1rem 1.1rem;
}

.calc-modal-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    margin-bottom: 0.8rem;
}

.calc-modal-table th,
.calc-modal-table td {
    border: 1px solid #dce4eb;
    padding: 0.5rem 0.6rem;
    text-align: left;
    font-size: 0.92rem;
}

@media (max-width: 1024px) {
    .wizard-layout {
        grid-template-columns: 1fr;
    }

    .wizard-side {
        position: static;
    }
}

@media (max-width: 768px) {
    .wizard-grid-2,
    .wizard-grid-3,
    .wizard-result-grid {
        grid-template-columns: 1fr;
    }

    .wizard-actions {
        flex-direction: column;
    }

    .wizard-actions .btn {
        width: 100%;
        text-align: center;
    }
}
