.elementor-14 .elementor-element.elementor-element-bf70315{--display:flex;--flex-direction:column;--container-widget-width:100%;--container-widget-height:initial;--container-widget-flex-grow:0;--container-widget-align-self:initial;--flex-wrap-mobile:wrap;}/* Start custom CSS for html, class: .elementor-element-82eee41 */<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simulateur Achat-Revente</title>
<style>
  body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #f5f7fa;
    margin: 0;
    padding: 40px;
  }
  .container {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: auto;
  }
  .form-section, .result-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 25px;
  }
  .form-section {
    flex: 2;
  }
  .result-section {
    flex: 1;
    align-self: flex-start;
    position: sticky;
    top: 20px;
  }
  h2 {
    color: #222;
    font-size: 18px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  label {
    display: block;
    margin-top: 12px;
    font-weight: 600;
    color: #333;
  }
  input {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border-radius: 6px;
    border: 1px solid #ddd;
    box-sizing: border-box;
  }
  .section {
    margin-bottom: 30px;
  }
  .btn-row {
    display: flex;
    gap: 15px;
    margin-top: 20px;
  }
  button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease;
  }
  .btn-primary {
    background-color: #1846db;
    color: white;
  }
  .btn-primary:hover {
    background-color: #1438b2;
  }
  .btn-reset {
    background-color: #f2f2f2;
    color: #222;
  }
  .btn-reset:hover {
    background-color: #e2e2e2;
  }
  .result-section h3 {
    margin-top: 0;
    font-size: 20px;
    color: #333;
  }
  .result-item {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    font-size: 16px;
  }
  .result-item span {
    font-weight: bold;
  }
  .highlight {
    color: #007700;
  }
  .note {
    font-size: 13px;
    color: #777;
    margin-top: 10px;
  }
</style>
</head>
<body>

<div class="container">
  <div class="form-section">
    <div class="section">
      <h2>🏠 Informations sur le bien</h2>
      <label>Prix d’achat (€)</label>
      <input type="number" id="prixAchat">
      <label>Surface (m²)</label>
      <input type="number" id="surface">
      <label>Frais de notaire (€)</label>
      <input type="number" id="notaire">
    </div>

    <div class="section">
      <h2>🔧 Travaux et mise en conformité</h2>
      <label>Travaux de rénovation (€)</label>
      <input type="number" id="renov">
      <label>Décoration (€)</label>
      <input type="number" id="deco">
      <label>Mise aux normes (€)</label>
      <input type="number" id="norme">
    </div>

    <div class="section">
      <h2>💡 Charges et taxes</h2>
      <label>Charges de copropriété (€)</label>
      <input type="number" id="copro">
      <label>Taxe foncière (€)</label>
      <input type="number" id="fonciere">
      <label>Assurance PNO (€)</label>
      <input type="number" id="assurance">
      <label>Eau, électricité, internet (€)</label>
      <input type="number" id="utilitaires">
    </div>

    <div class="section">
      <h2>💼 Frais de revente</h2>
      <label>Frais d’agence (€)</label>
      <input type="number" id="fraisAgence">
      <label>Diagnostics (€)</label>
      <input type="number" id="diagnostics">
    </div>

    <div class="section">
      <h2>📈 Estimation de revente</h2>
      <label>Prix de revente estimé (€)</label>
      <input type="number" id="prixRevente">
    </div>

    <div class="btn-row">
      <button class="btn-primary" onclick="calculer()">Calculer</button>
      <button class="btn-reset" onclick="location.reload()">Réinitialiser</button>
    </div>
  </div>

  <div class="result-section" id="resultats" style="display:none;">
    <h3>Résumé de ton opération</h3>
    <div class="result-item"><span>Prix au m² :</span><span id="prixM2Achat"></span> €</div>
    <div class="result-item"><span>Total travaux :</span><span id="totalTravaux"></span> €</div>
    <div class="result-item"><span>Total charges et taxes :</span><span id="totalCharges"></span> €</div>
    <div class="result-item"><span>Total frais revente :</span><span id="totalFraisRevente"></span> €</div>
    <div class="result-item"><span>Bénéfice brut :</span><span id="benefBrut" class="highlight"></span> €</div>
    <div class="result-item"><span>Impôt (IS) :</span><span id="impotIS"></span> €</div>
    <div class="result-item"><span>Bénéfice net :</span><span id="benefNet" class="highlight"></span> €</div>
    <p class="note">Simulation indicative. Les valeurs fiscales sont à ajuster selon ta comptabilité réelle.</p>
  </div>
</div>

<script>
function calculer() {
  const v = id => parseFloat(document.getElementById(id).value) || 0;
  const prixAchat = v('prixAchat'), surface = v('surface'), notaire = v('notaire');
  const renov = v('renov'), deco = v('deco'), norme = v('norme');
  const copro = v('copro'), fonciere = v('fonciere'), assurance = v('assurance'), utilitaires = v('utilitaires');
  const fraisAgence = v('fraisAgence'), diagnostics = v('diagnostics'), prixRevente = v('prixRevente');

  const totalTravaux = renov + deco + norme;
  const totalCharges = copro + fonciere + assurance + utilitaires;
  const totalFraisRevente = fraisAgence + diagnostics;
  const coutTotal = prixAchat + notaire + totalTravaux + totalCharges + totalFraisRevente;
  const benefBrut = prixRevente - coutTotal;

  let impot = 0;
  if (benefBrut > 40500) impot = 40500 * 0.15 + (benefBrut - 40500) * 0.25;
  else if (benefBrut > 0) impot = benefBrut * 0.15;

  const benefNet = benefBrut - impot;

  document.getElementById('prixM2Achat').textContent = surface ? (prixAchat / surface).toFixed(0) : 0;
  document.getElementById('totalTravaux').textContent = totalTravaux.toLocaleString();
  document.getElementById('totalCharges').textContent = totalCharges.toLocaleString();
  document.getElementById('totalFraisRevente').textContent = totalFraisRevente.toLocaleString();
  document.getElementById('benefBrut').textContent = benefBrut.toLocaleString();
  document.getElementById('impotIS').textContent = impot.toLocaleString();
  document.getElementById('benefNet').textContent = benefNet.toLocaleString();
  document.getElementById('resultats').style.display = 'block';
}
</script>

</body>
</html>/* End custom CSS */