/*
 * Calculateur de couts caches — [macmoov-calculateur-couts]
 *
 * Extrait de la maquette docs/maquettes/calculateur-couts.html et SCOPE sous
 * .mm-calc : la source ciblait *, body et des classes generiques (.btn,
 * .card, .results, .form-group, .container) dont trois entrent en collision
 * averee avec assets/css/macmoov.css — .btn, .results (4 regles) et
 * .form-group (6 regles).
 *
 * Chargee uniquement par le shortcode, jamais globalement.
 *
 * REGLES ABANDONNEES A L'EXTRACTION :
 *   *{margin:0;padding:0}   — un reset global casserait le theme ; seul
 *                             box-sizing est conserve, scope aux descendants.
 *   body{padding:20px;...}  — reporte sur .mm-calc (fond, police, interligne).
 *   min-height:100vh        — le shortcode occupe la place de son contenu.
 *
 * Les couleurs sont celles du branding, identiques a page-vente.css:20-22
 * sous d'autres noms (--vert-fonce = --dark-green, etc.).
 *
 * @see docs/maquettes/calculateur-couts.html
 */

.mm-calc {
    --vert-fonce:#14612F;
    --vert-clair:#2C9334;
    --gris:#575758;
    --card:#FFFFFF;
    --muted:#6b6b6c;
    --border:#d4e8d6;
    --light-green:#e8f5e9;
    --accent-bg:#f0faf1;
}

.mm-calc *,.mm-calc *::before,.mm-calc *::after {
    box-sizing:border-box;
}

.mm-calc {
    font-family:'Poppins',system-ui,-apple-system,sans-serif;
    background:linear-gradient(135deg,#f4faf5 0%,#e8f5e9 100%);
    color:var(--gris);
    line-height:1.5;
    padding:20px;
}

.mm-calc .mm-calc-wrap {
    max-width:820px;
    margin:0 auto;
}

.mm-calc .mm-calc-head {
    text-align:center;
    margin-bottom:30px;
}

.mm-calc .mm-calc-head h2 {
    font-size:1.8rem;
    font-weight:700;
    color:var(--vert-fonce);
    margin:0 0 8px;
}

.mm-calc .mm-calc-head p {
    color:var(--muted);
    font-size:1rem;
    font-weight:400;
    margin:0;
}

.mm-calc .mm-calc-card {
    background:var(--card);
    border-radius:16px;
    box-shadow:0 4px 20px rgba(20,97,47,0.08);
    padding:28px;
    margin-bottom:24px;
}

.mm-calc .mm-calc-card h3 {
    font-size:1.25rem;
    font-weight:600;
    color:var(--vert-fonce);
    margin:0 0 20px;
    padding-bottom:10px;
    border-bottom:2px solid var(--border);
}

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

.mm-calc .mm-calc-field {
    display:flex;
    flex-direction:column;
}

.mm-calc .mm-calc-field.is-full {
    grid-column:1 / -1;
}

.mm-calc .mm-calc-field label {
    font-weight:600;
    font-size:0.9rem;
    margin-bottom:6px;
    color:var(--vert-fonce);
}

.mm-calc .mm-calc-hint {
    font-size:0.78rem;
    color:var(--muted);
    margin:4px 0 0;
}

.mm-calc input[type="number"] {
    padding:11px 14px;
    border:1.5px solid var(--border);
    border-radius:10px;
    font-size:1rem;
    font-family:inherit;
    transition:border-color 0.2s,background 0.2s;
    background:#fafcfa;
    color:var(--gris);
}

.mm-calc input[type="number"]:focus {
    outline:none;
    border-color:var(--vert-clair);
    background:#fff;
}

.mm-calc .mm-calc-btn {
    display:inline-block;
    background:var(--vert-clair);
    color:#fff;
    border:none;
    padding:14px 28px;
    font-size:1.05rem;
    font-weight:600;
    font-family:inherit;
    border-radius:12px;
    cursor:pointer;
    transition:background 0.2s,transform 0.1s;
    width:100%;
    margin-top:10px;
    text-align:center;
    text-decoration:none;
}

.mm-calc .mm-calc-btn:hover {
    background:var(--vert-fonce);
    color:#fff;
}

.mm-calc .mm-calc-btn:active {
    transform:scale(0.98);
}

.mm-calc .mm-calc-btn:focus-visible {
    outline:2px solid var(--vert-fonce);
    outline-offset:2px;
}

/* Le calcul tourne au chargement : les resultats sont visibles d'emblee.
   .is-hidden ne sert qu'au repli sans JS, pose par le template. */
.mm-calc .mm-calc-results.is-hidden {
    display:none;
}

.mm-calc .mm-calc-result-grid {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
    margin-bottom:20px;
}

.mm-calc .mm-calc-result {
    background:var(--light-green);
    border-radius:12px;
    padding:16px;
    text-align:center;
}

.mm-calc .mm-calc-result .mm-calc-label {
    font-size:0.85rem;
    color:var(--muted);
    margin:0 0 6px;
}

.mm-calc .mm-calc-result .mm-calc-value {
    font-size:1.4rem;
    font-weight:700;
    color:var(--vert-fonce);
}

.mm-calc .mm-calc-result.is-total {
    background:linear-gradient(135deg,var(--vert-clair),var(--vert-fonce));
    color:#fff;
    grid-column:1 / -1;
}

.mm-calc .mm-calc-result.is-total .mm-calc-label {
    color:rgba(255,255,255,0.9);
}

.mm-calc .mm-calc-result.is-total .mm-calc-value {
    color:#fff;
    font-size:1.7rem;
}

.mm-calc .mm-calc-comparison {
    background:#f8fdf8;
    border:1px solid var(--border);
    border-radius:12px;
    padding:18px;
    margin-top:16px;
}

.mm-calc .mm-calc-comparison h4 {
    font-size:1rem;
    font-weight:600;
    margin:0 0 12px;
    color:var(--vert-fonce);
}

.mm-calc .mm-calc-row {
    display:flex;
    justify-content:space-between;
    gap:16px;
    padding:6px 0;
    font-size:0.95rem;
    color:var(--gris);
}

.mm-calc .mm-calc-row strong {
    color:var(--vert-fonce);
    white-space:nowrap;
}

.mm-calc .mm-calc-row.is-saving {
    margin-top:10px;
    border-top:1px solid var(--border);
    padding-top:10px;
}

.mm-calc .mm-calc-row.is-saving strong {
    color:var(--vert-clair);
}

.mm-calc .mm-calc-cta {
    margin-top:20px;
    text-align:center;
}

.mm-calc .mm-calc-cta p {
    font-size:0.9rem;
    color:var(--muted);
    margin:0 0 4px;
}

.mm-calc .mm-calc-assumptions {
    background:var(--accent-bg);
    border-radius:10px;
    padding:14px;
    margin-top:16px;
    font-size:0.85rem;
    color:var(--muted);
}

.mm-calc .mm-calc-assumptions strong {
    color:var(--vert-fonce);
}

.mm-calc .mm-calc-assumptions ul {
    margin:8px 0 0 18px;
    padding:0;
}

.mm-calc .mm-calc-note {
    font-size:0.8rem;
    color:var(--muted);
    margin-top:20px;
    padding-top:16px;
    border-top:1px solid var(--border);
    line-height:1.5;
}

.mm-calc .mm-calc-note-box {
    margin-top:16px;
    padding:12px 14px;
    background:var(--light-green);
    border-radius:10px;
    font-size:0.82rem;
    color:var(--gris);
    line-height:1.45;
}

.mm-calc .mm-calc-note-box strong {
    color:var(--vert-fonce);
}

@media (max-width:600px) {
    .mm-calc .mm-calc-grid,
    .mm-calc .mm-calc-result-grid {
        grid-template-columns:1fr;
    }
}
