/* ============================================================
   CALCULATEUR SAELEN — redesign + modal économies
   Surcouche par-dessus style.css (grille, header biseauté,
   broyeurs, switch, arrows restent fournis par style.css).
   Palette Saelen : jaune #ffd200 · bleu #057eb3 · gris #56585a
   ============================================================ */

:root {
    --s-yellow: #ffd200;
    --s-blue: #057eb3;
    --s-blue-light: #009FE3;
    --s-grey: #56585a;
    --s-grey-soft: #f4f5f6;
    --s-red: #ef4444;
    --s-border: #e5e7eb;
}

/* ---------- Réglages généraux de la page ---------- */
body {
    background-color: #fff;
}

/* Hero / sous-titre header un peu plus moderne */
.subheader h2 img {
    vertical-align: middle;
    margin-left: 10px;
}

/* ---------- Section autonomie : cartes résultats ---------- */
#broyeur {
    padding: 0 2%;
}

#modele {
    text-align: center;
}

#modele #logoBro {
    max-height: 9vh;
    width: auto;
    margin: 10px auto;
}

#modele #bro-img {
    max-width: 70%;
    height: auto;
    border-radius: 12px;
    background: url(../img/cross_pattern.svg) repeat;
    background-size: 15px;
    padding: 16px;
}

/* Les 3 statistiques (jours / m³ / charge) en cartes blanches */
.result {
    text-align: center;
    padding: 22px 14px !important;
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--s-border);
    border-bottom: 4px solid var(--s-yellow);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
    transition: transform .2s ease, box-shadow .2s ease;
}

.result:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .1);
}

.result-mid {
    margin: 0 1%;
}

.result img {
    height: 7vh;
    width: auto;
    margin-bottom: 8px;
}

.result b {
    font-size: 2.4rem;
    color: var(--s-blue);
    display: block;
    line-height: 1.1;
}

.result .yellow {
    display: block;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 2px;
}

@media only screen and (max-width: 1024px) {
    .result {
        margin-bottom: 14px;
    }
}

/* ---------- Bouton « Voir les économies réalisées » ---------- */
/* Override du style.css global button (400x50, double box-shadow) */
#roi {
    text-align: center;
    margin: 6vh 0 2vh;
}

button.roi-btn {
    width: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 42px;
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--s-grey);
    background: var(--s-yellow);
    border: none;
    box-shadow: 12px 8px 0 var(--s-blue);
    transition: 250ms ease-in-out;
    font-family: "SaelenFont", sans-serif;
}

button.roi-btn:hover {
    background: #ffdb33;
    box-shadow: 6px 4px 0 var(--s-blue);
    transform: translate(3px, 2px);
}

button.roi-btn svg {
    flex-shrink: 0;
}

@media only screen and (max-width: 768px) {
    button.roi-btn {
        width: auto;
        height: auto;
        padding: 16px 28px;
        font-size: 1.05rem;
    }
}

/* ============================================================
   MODAL ÉCONOMIES
   ============================================================ */
#economyModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, .55);
    overflow-y: auto;
    padding: 24px 16px;
}

#economyModal.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.eco-box {
    background: var(--s-grey-soft);
    width: 100%;
    max-width: 1180px;
    margin: auto;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
    animation: ecoUp .3s ease-out;
}

@keyframes ecoUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Reset des boutons internes (style.css impose 400x50) */
#economyModal button {
    width: auto;
    height: auto;
    box-shadow: none;
    border: none;
    background: none;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    font-family: "SaelenFont", sans-serif;
}

/* En-tête du modal */
.eco-head {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--s-grey);
    border-bottom: 3px solid var(--s-yellow);
    padding: 20px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.eco-head-l {
    display: flex;
    align-items: center;
    gap: 14px;
}

.eco-head h2 {
    color: #fff;
    font-size: 1.3rem;
    margin: 0;
    padding: 0;
}

.eco-head .eco-sub {
    color: rgba(255, 255, 255, .55);
    font-size: .8rem;
    margin-top: 2px;
}

button.eco-close {
    flex-shrink: 0;
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, .1) !important;
    color: #fff !important;
    font-size: 22px !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

button.eco-close:hover {
    background: rgba(255, 255, 255, .22) !important;
}

.eco-body {
    padding: 26px 28px 34px;
}

/* Bandeau info prix */
.info-banner {
    background: var(--s-grey);
    border-left: 4px solid var(--s-yellow);
    border-radius: 12px;
    padding: 16px 22px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.ib-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: var(--s-yellow);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ib-title {
    color: var(--s-yellow);
    font-weight: bold;
    font-size: .85rem;
    margin-bottom: 6px;
}

.info-prices {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.ip-item {
    font-size: .78rem;
    color: rgba(255, 255, 255, .6);
}

.ip-item.gnr .val {
    color: #fca5a5;
    font-weight: bold;
}

.ip-item.elec .val {
    color: var(--s-yellow);
    font-weight: bold;
}

button.ib-btn {
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, .25) !important;
    color: rgba(255, 255, 255, .7) !important;
    padding: 7px 15px !important;
    border-radius: 8px;
    font-size: .78rem !important;
    font-weight: bold !important;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
}

button.ib-btn:hover {
    border-color: var(--s-yellow) !important;
    color: var(--s-yellow) !important;
}

/* Grilles d'agencement */
.config-grid,
.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}

.deepdive-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

/* Carte générique */
.ecard {
    background: #fff;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}

.ecard-hd {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid #eef0f2;
}

.ecard-hd h3 {
    font-size: .95rem;
    color: var(--s-grey);
    margin: 0;
    padding: 0;
}

.ecard-ico {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 8px;
    background: #fff6cc;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Boutons modèle */
.model-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

button.mbtn {
    background: #f9fafb !important;
    border: 2px solid var(--s-border) !important;
    border-radius: 10px !important;
    padding: 13px 16px !important;
    cursor: pointer;
    text-align: left;
    transition: all .2s;
    color: var(--s-grey) !important;
    width: 100% !important;
}

button.mbtn:hover {
    border-color: var(--s-yellow) !important;
    transform: translateY(-1px);
}

button.mbtn.active {
    background: var(--s-blue) !important;
    border-color: var(--s-blue) !important;
    color: #fff !important;
}

.mbtn .mn {
    font-weight: bold;
    font-size: .92rem;
    margin-bottom: 3px;
}

.mbtn .ms {
    font-size: .72rem;
    opacity: .8;
    display: flex;
    gap: 12px;
}

/* Boutons heures */
.hours-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

button.hbtn {
    background: #f9fafb !important;
    border: 2px solid var(--s-border) !important;
    border-radius: 8px !important;
    padding: 10px 4px !important;
    cursor: pointer;
    font-size: .82rem !important;
    font-weight: bold !important;
    text-align: center;
    color: var(--s-grey) !important;
    transition: all .2s;
}

button.hbtn:hover {
    border-color: var(--s-yellow) !important;
}

button.hbtn.active {
    background: var(--s-blue) !important;
    border-color: var(--s-blue) !important;
    color: #fff !important;
}

.hours-display {
    text-align: center;
    background: #fff6cc;
    color: #8a7200;
    border-radius: 8px;
    padding: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 10px;
}

/* Sliders */
.param-item {
    margin-bottom: 20px;
}

.param-item:last-child {
    margin-bottom: 0;
}

.param-lbl {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.param-lbl label {
    font-size: .82rem;
    font-weight: bold;
    color: var(--s-grey);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pval {
    padding: 4px 11px;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: bold;
}

.pval.gnr {
    background: var(--s-grey);
    color: #fca5a5;
}

.pval.elec {
    background: #fff6cc;
    color: #8a7200;
}

.eco-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: var(--s-border);
}

.eco-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: var(--s-yellow);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
    transition: transform .15s;
}

.eco-range::-webkit-slider-thumb:hover {
    transform: scale(1.18);
}

.eco-range::-moz-range-thumb {
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: var(--s-yellow);
    cursor: pointer;
    border: none;
}

.range-lbl {
    display: flex;
    justify-content: space-between;
    font-size: .66rem;
    color: #9ca3af;
    margin-top: 4px;
}

/* Carte économies énergie */
.energy-num {
    font-size: 2.4rem;
    font-weight: bold;
    color: var(--s-blue);
    line-height: 1;
    margin: 4px 0;
}

.energy-pct {
    font-size: .82rem;
    color: var(--s-blue);
    font-weight: bold;
    margin-bottom: 14px;
}

.mini-comp {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mc-box {
    background: #f9fafb;
    border-radius: 10px;
    padding: 12px;
}

.mc-box.r {
    border: 1px solid #fecaca;
}

.mc-box.y {
    border: 1px solid #ffe89a;
}

.mc-lbl {
    font-size: .68rem;
    color: #9ca3af;
    margin-bottom: 4px;
}

.mc-val {
    font-size: 1.15rem;
    font-weight: bold;
}

.mc-val.red {
    color: var(--s-red);
}

.mc-val.blue {
    color: var(--s-blue);
}

.mc-det {
    font-size: .66rem;
    color: #9ca3af;
    margin-top: 2px;
}

/* Carte maintenance */
.maint-note {
    background: #f9fafb;
    border-left: 3px solid var(--s-yellow);
    border-radius: 0 8px 8px 0;
    padding: 10px 13px;
    margin-bottom: 13px;
    font-size: .76rem;
    color: var(--s-grey);
}

.maint-note strong {
    color: #8a7200;
    display: block;
    margin-bottom: 3px;
}

.maint-comp {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 13px;
}

.mbox {
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}

.mbox.d {
    background: #fff5f5;
    border: 2px solid #fecaca;
}

.mbox.e {
    background: #fff6cc;
    border: 2px solid #ffe89a;
}

.mbox-lbl {
    font-size: .72rem;
    color: #6b7280;
    font-weight: bold;
    margin-bottom: 5px;
}

.mbox-val {
    font-size: 1.3rem;
    font-weight: bold;
}

.mbox-val.red {
    color: var(--s-red);
}

.mbox-val.blue {
    color: var(--s-blue);
}

.mbox-rate {
    font-size: .66rem;
    color: #9ca3af;
    margin-top: 2px;
}

.maint-save {
    background: #fff6cc;
    border-left: 4px solid var(--s-yellow);
    border-radius: 0 8px 8px 0;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.maint-save .lbl {
    font-size: .8rem;
    font-weight: bold;
    color: #8a7200;
}

.maint-save .val {
    font-size: 1.3rem;
    font-weight: bold;
    color: #8a7200;
}

/* Carte total (mise en avant) */
.total-card {
    background: var(--s-grey);
    border-radius: 14px;
    padding: 26px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .2);
}

.tc-lbl {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, .9);
    margin-bottom: 10px;
}

.tc-amount {
    font-size: 3.1rem;
    font-weight: bold;
    color: var(--s-yellow);
    line-height: 1;
    margin-bottom: 6px;
}

.tc-sub {
    font-size: .72rem;
    color: rgba(255, 255, 255, .8);
    margin-bottom: 22px;
}

.tc-breakdown {
    display: flex;
    justify-content: center;
    gap: 26px;
}

.tcb-val {
    font-size: 1.05rem;
    font-weight: bold;
    color: var(--s-yellow);
}

.tcb-lbl {
    font-size: .66rem;
    color: rgba(255, 255, 255, .8);
    margin-top: 2px;
}

.tcb-item + .tcb-item {
    border-left: 1px solid rgba(255, 255, 255, .12);
    padding-left: 26px;
}

/* ROI */
.roi-hint {
    font-size: .72rem;
    color: #9ca3af;
    font-weight: bold;
    margin-bottom: 9px;
}

.roi-prices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 13px;
}

.rpm {
    text-align: center;
    padding: 10px 4px;
    background: #f9fafb;
    border-radius: 8px;
    border: 2px solid var(--s-border);
}

.rpm-lbl {
    font-size: .66rem;
    color: #9ca3af;
    margin-bottom: 2px;
}

.rpm-val {
    font-size: .9rem;
    font-weight: bold;
    color: var(--s-blue);
}

.roi-kpis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
}

.roi-kpi {
    background: #fff6cc;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.roi-kpi-lbl {
    font-size: .66rem;
    color: #8a7200;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.roi-kpi-val {
    font-size: 1.7rem;
    font-weight: bold;
    color: var(--s-blue);
}

.roi-kpi-sub {
    font-size: .66rem;
    color: #8a7200;
    margin-top: 2px;
}

/* Projection */
.proj-row {
    display: grid;
    grid-template-columns: 60px 1fr 1fr 1fr;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 9px;
    margin-bottom: 8px;
    background: #f9fafb;
    border: 1px solid var(--s-border);
}

.proj-row.active {
    background: #fff6cc;
    border-color: var(--s-yellow);
}

.proj-h {
    font-size: .95rem;
    font-weight: bold;
    color: var(--s-blue);
}

.proj-l {
    font-size: .66rem;
    color: #9ca3af;
    margin-bottom: 2px;
}

.proj-v {
    font-size: .82rem;
    font-weight: bold;
}

.proj-detail {
    margin-top: 16px;
    padding: 13px;
    background: #f9fafb;
    border-radius: 9px;
    font-size: .72rem;
    color: #6b7280;
    line-height: 1.6;
}

/* Cartes ROI & projection : les rangées du bas (KPI / indicateurs) alignées
   tout en bas, au même niveau */
.roi-card,
.proj-card {
    display: flex;
    flex-direction: column;
}

.roi-card .roi-kpis,
.proj-card .proj-maint {
    margin-top: auto;
}

.proj-maint {
    padding-top: 14px;
    margin-bottom: 0;
}

.proj-detail strong.t {
    color: #8a7200;
    display: block;
    margin-bottom: 5px;
}

/* ---------- Sous-modal prix ---------- */
#prixModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, .5);
}

#prixModal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.prix-box {
    background: #fff;
    border-radius: 14px;
    padding: 26px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

/* Reset des boutons internes (style.css impose 400x50) */
#prixModal button {
    width: auto;
    height: auto;
    box-shadow: none;
    border: none;
    background: none;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    font-family: "SaelenFont", sans-serif;
}

.prix-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f1f2;
}

.prix-hd h3 {
    font-size: 1.05rem;
    color: var(--s-grey);
    margin: 0;
    padding: 0;
}

button.prix-close {
    font-size: 22px !important;
    color: #9ca3af !important;
    cursor: pointer;
}

.prix-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: #f9fafb;
    border-radius: 9px;
    margin-bottom: 8px;
}

.prix-row .lbl {
    font-size: .82rem;
    font-weight: bold;
    color: var(--s-grey);
}

.prix-row .val {
    font-size: 1rem;
    font-weight: bold;
    color: var(--s-blue);
}

.prix-note {
    font-size: .72rem;
    color: #9ca3af;
    margin: 10px 0 0;
}

.prix-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

button.btn-apply {
    flex: 1;
    padding: 11px !important;
    border-radius: 8px !important;
    font-size: .82rem !important;
    font-weight: bold !important;
    cursor: pointer;
    background: var(--s-yellow) !important;
    color: var(--s-grey) !important;
}

button.btn-apply:hover {
    background: #ffdb33 !important;
}

button.btn-cancel {
    flex: 1;
    padding: 11px !important;
    border-radius: 8px !important;
    font-size: .82rem !important;
    font-weight: bold !important;
    cursor: pointer;
    background: #e5e7eb !important;
    color: var(--s-grey) !important;
}

/* ---------- Responsive ---------- */
@media only screen and (max-width: 900px) {
    .config-grid,
    .results-grid {
        grid-template-columns: 1fr;
    }
    .deepdive-grid {
        grid-template-columns: 1fr;
    }
    .eco-body {
        padding: 18px;
    }
}

@media only screen and (max-width: 560px) {
    .hours-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .mini-comp,
    .maint-comp,
    .roi-kpis {
        grid-template-columns: 1fr;
    }
    .tc-amount {
        font-size: 2.4rem;
    }
    .eco-head {
        padding: 16px 18px;
    }
    .proj-row {
        grid-template-columns: 46px 1fr 1fr 1fr;
        gap: 6px;
    }
}
