.bac-sections {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  padding: 20px;
  row-gap: 3rem;
}

.bac-section {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  margin: 10px;
  text-align: center;
  width: 200px;
  height: 150px;
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.bac-section:hover {
  transform: scale(1.05);
}

.bac-section:hover span {
  color: #ddd;
}

.bac-section i {
  font-size: 40px;
  color: #3498db;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
}

.bac-section span {
  display: block;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  position: relative;
  z-index: 2;
}

/* Galaxy Background Animation */
.bac-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("/Local_imgs/tenor.gif") center center/cover no-repeat;
  background-size: cover;
  opacity: 0;
  z-index: 1;
  transition: opacity 0.5s ease;
}

.bac-section:hover::before {
  opacity: 1;
}

/* Form Flexbox for form layout */
#myForm {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* Pill input styling */
.pill-input {
  border-radius: 50px !important;
  padding: 25px 20px !important;
  height: 50px;
  background-color: dark !important;
  font-weight: 500 !important;
  color: black !important;
  position: relative;
}

/* Form fields */
.title {
  font-weight: 300;
  font-size: 2.25rem;
  text-align: center;
}

.title span {
  color: #5c9adb;
  text-decoration: underline;
  font-weight: 600;
}

form h2.sec {
  font-weight: 300;
  font-size: 1.5rem;
  text-align: center;
  padding: 30px 0;
}

.form-field {
  flex: 1 1 30%; /* Allow 3 items per row */
  display: flex;
  flex-direction: column;
}

/* Label styling */
.form-field label {
  margin-bottom: 8px;
  font-weight: 400;
}

/* Disabled input style for output fields */
.output-box {
  background-color: #e9ecef;
  border-radius: 50px;
  text-align: center;
  font-weight: bold;
  font-size: 1.2rem;
  padding: 15px;
  min-height: 50px;
  display: flex;
  justify-content: center;
  align-items: center !important;
}

.output {
  display: flex;
  justify-content: start;
  align-items: center;
  gap: 20px;
}

/* Button styling */
.btn-primary {
  padding: 15px !important;
  font-size: 18px !important;
  font-weight: 100 !important;
  border-radius: 2em !important;
  border: none !important;
  background-color: rgb(27, 103, 138) !important;
  width: 200px !important;
}

.btn-primary:hover {
  background-color: #5c9adb !important;
}

.nonvalid {
  border-color: #f44336 !important; /* red-500 */
  box-shadow: 0 0 5px rgba(244, 67, 54, 0.5) !important; /* red-500 shadow */
}

.nonvalid-label {
  color: #f44336 !important; /* red-500 */
  position: relative;
}

.nonvalid-label::before {
  content: "⚠"; /* Warning icon */
  color: #f44336 !important; /* red-500 */
  font-size: 1.2rem;
  position: absolute;
  right: 40px; /* Position to the right of the label */
  top: 42px;
}

.admis h2 {
  margin: 10px 0;
  font-weight: bold;
  font-style: italic; /* Added this line */
  position: relative;
}

.control h2 {
  margin: 10px 0;
  font-weight: bold;
  font-style: italic; /* Added this line */
  position: relative;
}

.disabled {
  background-color: gray !important;
}

.ouWrap {
  align-items: center;
  background-image: url("/Local_imgs/thumb.png");
  background-position: 50%;
  background-size: cover;
  display: flex;
  height: 35px;
  justify-content: center;
  padding: 3px;
  position: absolute;
  right: -27px;
  top: 50%;
  width: 35px;
  z-index: 10;
}

/* Container semi-translucide pour bien se détacher du fond sombre */
.how-it-work,
article.art {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin: 2rem 0;
}

/* Texte clair et sobre */
.how-it-work,
article.art {
  color: #f0f0f0;
  line-height: 1.6;
  font-size: 1rem;
  margin: auto;
}

/* Titres avec un léger accent et une règle discrète */
.how-it-work h2,
article.art h2,
article.art h3 {
  color: #ffffff;
  font-weight: 600;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.5rem;
}

/* Espacements optimisés pour la lisibilité */
.how-it-work p.lead {
  margin-bottom: 1rem;
}

article.art p {
  margin-bottom: 1rem;
  text-align: left;
}

/* Listes épurées sans puces envahissantes */
article.art ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1rem;
}

article.art ul li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: 0.75rem;
}

article.art ul li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: #a8d0e6;
}

/* Liens discrets mais visibles */
.how-it-work a.link,
article.art a {
  color: #a8d0e6;
  text-decoration: underline;
}

/* Code inline pour formules */
article.art code,
.how-it-work code {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-family: monospace;
  font-size: 0.95em;
  color: #ffffff;
}

/* Responsive : réduit les marges sur mobile */
@media (max-width: 576px) {
  .how-it-work,
  article.art {
    padding: 1rem;
    margin: 1.5rem 0;
  }
}
