<!DOCTYPE html>
<html lang="fr">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Calculateur Brut / Net</title>
  <style>
    body {
      font-family: 'Segoe UI', sans-serif;
      background-color: #f5f5f5;
      color: #222;
      padding: 2rem;
      max-width: 600px;
      margin: auto;
    }

    header {
      display: flex;
      align-items: center;
      margin-bottom: 1rem;
    }

    .logo {
      width: 120px;
      height: auto;
    }

    h1 {
      text-align: center;
      color: #1a1a1a;
    }

    .calculator {
      background: #fff;
      padding: 2rem;
      border-radius: 1rem;
      box-shadow: 0 0 10px rgba(0,0,0,0.05);
    }

    label {
      display: block;
      margin-top: 1rem;
    }

    input, select {
      width: 100%;
      padding: 0.5rem;
      margin-top: 0.5rem;
      border: 1px solid #ccc;
      border-radius: 0.5rem;
    }

    button {
      margin-top: 1.5rem;
      width: 100%;
      background: #1a1a1a;
      color: #fff;
      padding: 0.75rem;
      border: none;
      border-radius: 0.5rem;
      cursor: pointer;
      font-size: 1rem;
    }

    .result {
      margin-top: 2rem;
      font-weight: bold;
      font-size: 1.2rem;
      color: #333;
      text-align: center;
    }
  </style>
</head>
<body>

  <header>
    <img src="logo ACC.jpg" alt="Logo Ambassade Cabinet Conseil" class="logo">
  </header>

  <h1>Calculateur Brut / Net</h1>

  <div class="calculator">
    <label for="salary">Salaire :</label>
    <input type="number" id="salary" placeholder="Ex. 3000" />

    <label for="type">Type :</label>
    <select id="type">
      <option value="brut">Salaire brut</option>
      <option value="net">Salaire net</option>
    </select>

    <label for="statut">Statut :</label>
    <select id="statut">
      <option value="non-cadre">Non-cadre</option>
      <option value="cadre">Cadre</option>
    </select>

    <button onclick="calculer()">Calculer</button>

    <div class="result" id="resultat"></div>
  </div>

  <script>
    function calculer() {
      const salaire = parseFloat(document.getElementById('salary').value);
      const type = document.getElementById('type').value;
      const statut = document.getElementById('statut').value;
      const tauxNonCadre = 0.77;
      const tauxCadre = 0.75;

      if (isNaN(salaire)) {
        document.getElementById('resultat').textContent = "Veuillez entrer un salaire valide.";
        return;
      }

      let resultat = 0;
      let taux = (statut === 'cadre') ? tauxCadre : tauxNonCadre;

      if (type === 'brut') {
        resultat = salaire * taux;
        document.getElementById('resultat').textContent = `Salaire net estimé : ${resultat.toFixed(2)} €`;
      } else {
        resultat = salaire / taux;
        document.getElementById('resultat').textContent = `Salaire brut estimé : ${resultat.toFixed(2)} €`;
      }
    }
  </script>
</body>
</html>