* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 40px 20px;
  font-family: "Manrope", sans-serif;
  color: #e8edf7;
  background: radial-gradient(ellipse at top, #243656 0%, #101a2c 60%);
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 35px;
  background: #16243a;
  border: 1px solid #2c3c57;
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

h1,
h2,
h3 {
  color: #dce8ff;
}

h1 {
  position: relative;
  isolation: isolate;
  width: fit-content;
  margin: 0 auto 12px;
  color: #f0c987;
  font-size: clamp(2.3rem, 6vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  text-align: center;
}

/* Cinq étoiles de chaque côté du titre */
h1::before,
h1::after {
  position: absolute;
  top: 50%;
  z-index: -1;
  color: #ffd479;
  font-size: 1.8rem;
  letter-spacing: 0.3rem;
  text-shadow: 0 0 15px rgba(255, 212, 121, 0.9);
  white-space: nowrap;
  transform: translateY(-50%);
  pointer-events: none;
}

h1::before {
  content: "✦ ✦ ✦ ✦ ✦";
  right: calc(100% + 20px);
}

h1::after {
  content: "✦ ✦ ✦ ✦ ✦";
  left: calc(100% + 20px);
}

main > p {
  max-width: 600px;
  margin: 0 auto 24px;
  color: #b9c6dc;
  text-align: center;
}

p {
  color: #c3cee0;
  font-size: 16px;
  line-height: 1.6;
}

/* Chaque calculateur */
.calculator {
  position: relative;
  margin: 20px 0;
  padding: 25px 20px 35px;
  border: 1px solid #2c3c57;
  border-radius: 18px;
  background: #16243a;
  text-align: center;
}

.calculator:not(:last-child)::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 15%;
  width: 70%;
  height: 2px;
  border-radius: 999px;
  background: #384b6a;
}

.calculator h2 {
  margin: 0 0 10px;
  color: #c8baff;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.4px;
}

label {
  display: block;
  margin: 18px 0 8px;
  color: #dce5f4;
  font-weight: 600;
}

input,
select {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 10px auto;
  padding: 12px 14px;
  border: 1px solid #465a78;
  border-radius: 10px;
  background: #21324c;
  color: #f4f7ff;
  font: inherit;
}

input:focus,
select:focus {
  outline: 2px solid #9b8cff;
  outline-offset: 2px;
  border-color: #9b8cff;
}

button {
  display: inline-block;
  margin-top: 14px;
  padding: 12px 22px;
  border: 0;
  border-radius: 10px;
  background: #7566df;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

button:hover {
  background: #897cf0;
  transform: translateY(-1px);
}

button:focus-visible {
  outline: 3px solid #c2baff;
  outline-offset: 3px;
}

/* Résultats des calculateurs */
.result,
#result {
  max-width: 600px;
  margin: 20px auto 0;
  padding: 18px;
  border: 1px solid #384d70;
  border-radius: 14px;
  background: #1e304b;
  color: #e8edf7;
  line-height: 1.8;
  text-align: center;
}

.result:empty,
#result:empty {
  display: none;
}

.result ul,
#result ul {
  padding-left: 0;
  list-style: none;
}

.result li,
#result li {
  margin: 10px 0;
  color: #dce5ff;
  font-size: 18px;
  font-weight: 600;
}

/* Adaptation aux petits écrans */
@media (max-width: 600px) {
  body {
    padding: 20px 12px;
  }

  .container {
    padding: 24px 16px;
    border-radius: 16px;
  }

  h1 {
    font-size: 2rem;
  }

  h1::before,
  h1::after {
    font-size: 1rem;
    letter-spacing: 0.1rem;
  }

  h1::before {
    right: calc(100% + 8px);
  }

  h1::after {
    left: calc(100% + 8px);
  }

  .calculator {
    padding: 22px 4px 30px;
  }
}
/* Tablettes */
@media (max-width: 768px) {
  body {
    padding: 28px 16px;
  }

  .container {
    padding: 28px 22px;
  }

  .calculator {
    padding: 24px 16px 30px;
  }
}

/* Téléphones */
@media (max-width: 480px) {
  body {
    padding: 16px 10px;
  }

  .container {
    padding: 24px 14px;
    border-radius: 16px;
  }

  h1 {
    font-size: clamp(1.8rem, 9vw, 2.3rem);
    letter-spacing: -1px;
  }

  /* Réduit les étoiles pour éviter qu’elles dépassent de l’écran */
  h1::before,
  h1::after {
    font-size: 0.75rem;
    letter-spacing: 0.05rem;
  }

  h1::before {
    right: calc(100% + 4px);
  }

  h1::after {
    left: calc(100% + 4px);
  }

  .calculator {
    margin: 14px 0;
    padding: 20px 12px 26px;
  }

  .calculator h2 {
    font-size: 1.25rem;
  }

  input,
  select {
    max-width: none;
    min-height: 44px;
  }

  button {
    min-height: 44px;
    padding: 12px 20px;
  }

  .result,
  #result {
    padding: 14px 10px;
    overflow-wrap: anywhere;
  }

  .result li,
  #result li {
    font-size: 16px;
  }
}