.tout {
  width: 80%;
  border: 1px solid lightgrey;
  padding: 20px;
  border-radius: 5px;
  margin: auto;
  background-color: #fafafa;
}

.tout input,
.tout select,
.tout textarea {
  display: block;
  width: 100%;
  margin-top: 10px;
  margin-bottom: 10px;
  border: 1px solid lightgrey;
  border-radius: 5px;
  box-sizing: border-box;
}


.tout .page {
  display: none;
}

.tout header {
  display: flex;
  justify-content: space-between;
  margin: 0rem;
}

.tout .page-numbers {
  font-size: 1.5rem;
  text-align: center;
  padding: 10px;
  font-weight: bold;
}

.tout .fit-picture {
  width: 70px;
}

.tout .active {
  color: #f88f25;
  font-weight: bolder;
}


.tout .button {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #8c8c8c;
  margin: 20px auto 0;
  padding: 10px 20px;
  color: white;
  font-size: 20px;
  border-radius: 5px;
  width: fit-content;
  min-width: 180px;
}


.tout .im {
  display: flex;
  flex-direction: row;
}

.tout .captcha {
  margin-top: 20px;
  width: 60%;
}

.tout .prev,
.tout .next {
  margin-top: 2rem;
}

.tout .imgca {
  margin-left: 2rem;
}

.tout .form-check-inline {
  display: inline-flex;
  align-items: center;
  margin-right: 20px;
}

.tout .form-check-input {
  margin-right: 5px;
}

.tout .invalidCheck2 {
  display: inline-flex;
  align-items: left;
  gap: 2px;
}

.tout input.invalidCheck2 {
  width: 16px;
}
.tout .captcha img {
    width: 240px;
    height: 80px;
    max-width: 100%;
}

/* ===========================
   ÉCRAN DE REMERCIEMENT (fin de formulaire)
=========================== */
.tout.merci {
  text-align: center;
}

.tout.merci h3 {
  color: #8c8c8c;
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.tout.merci p {
  margin: 0.75rem auto;
  max-width: 90%;
  line-height: 1.5;
}

/* ===========================
   RESPONSIVE MOBILE
=========================== */
@media (max-width: 768px) {

  .tout {
    width: 95%;
    padding: 15px;
  }

  .tout input,
  .tout select,
  .tout textarea {
    width: 100%;
    box-sizing: border-box;
  }

  /* Captcha en colonne */
  .tout .im {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  /* Image du captcha plus visible */
  .tout .imgca {
    margin-left: 0;
    text-align: center;
  }

  .tout .captcha {
    width: 100%;
    max-width: 320px;
  }

  /* Si l'image possède une classe ou est directement dans imgca */
 .tout .captcha img {
        width: 320px;
        height: auto;
    }

  /* Boutons */
  .tout .button {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    text-align: center;
    font-size: 18px;
    padding: 12px;
    box-sizing: border-box;
  }

  .tout .prev,
  .tout .next {
    width: 100%;
  }

  /* Numéro d'étape */
  .tout .page-numbers {
    font-size: 1.2rem;
  }

  /* Logo */
  .tout .fit-picture {
    width: 55px;
  }

  /* Écran de remerciement */
  .tout.merci {
    padding: 10px;
  }

  .tout.merci h3 {
    font-size: 1.2rem;
  }

  .tout.merci p {
    max-width: 100%;
    font-size: 0.95rem;
  }

}

/* ===========================
   GRILLE 2 COLONNES (formulaire simple)
=========================== */
.simple-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}
.simple-grid input {
  margin: 0;
}

.simple-footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
}
.simple-captcha {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 260px;
  min-width: 0;
}
.simple-captcha .captcha {
  width: 55px;
  margin: 0;
}
.simple-submit {
  flex: 0 0 auto;
  white-space: nowrap;
  margin: 0 !important;
}

@media (max-width: 768px) {
  .simple-grid {
    grid-template-columns: 1fr;
  }
  .simple-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===========================
   THÈME ESBH (fond sombre, champs en pilule)
   Approximation visuelle depuis capture d'écran — couleurs à ajuster
   après comparaison côte à côte avec le site d'origine.
=========================== */
.tout.theme-esbh-dark {
  background: #1c2b06;
  border: none;
  color: #ffffff;
  padding: 40px;
  width: 90%;
  max-width: 900px;
}

.tout.theme-esbh-dark .form-badge {
  display: inline-block;
  border: 1px solid #ffffff;
  border-radius: 15px;
  padding: 6px 20px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.tout.theme-esbh-dark .form-title {
  color: #ffffff;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 25px;
}

.tout.theme-esbh-dark input,
.tout.theme-esbh-dark textarea {
  background: transparent;
  border: 1px solid #ffffff;
  border-radius: 15px;
  color: #ffffff;
  padding: 14px 20px;
}

.tout.theme-esbh-dark .simple-captcha input[type="checkbox"] {
  width: auto;
  display: inline-block;
  margin: 0;
  flex: 0 0 auto;
}

.tout.theme-esbh-dark .simple-captcha label {
  margin: 0;
  flex: 0 0 auto;
}

.tout.theme-esbh-dark textarea {
  border-radius: 15px;
  width: 100%;
  box-sizing: border-box;
}

.tout.theme-esbh-dark input::placeholder,
.tout.theme-esbh-dark textarea::placeholder {
  color: #ffffff;
  opacity: 0.85;
}

.tout.theme-esbh-dark .privacy-note {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 15px;
}

.tout.theme-esbh-dark .simple-captcha {
  background: #ffffff;
  color: #1c2b06;
  border-radius: 15px;
  padding: 8px 15px;
}

.tout.theme-esbh-dark .simple-captcha .imgca {
  max-width: 150px;
  height: auto;
}
.tout.theme-esbh-dark .simple-captcha label {
  font-size: 0.9rem;
}
.tout.theme-esbh-dark .simple-captcha .captcha {
  border: 1px solid #1c2b06;
  color: #1c2b06;
  border-radius: 15px;
  padding: 6px 10px;
  min-width: 150px;
}

.tout.theme-esbh-dark .simple-submit {
  background: #ffffff;
  color: #1c2b06;
  border-radius: 15px;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 16px;
  width: auto;
  min-width: 0;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .tout.theme-esbh-dark .simple-captcha {
    flex-wrap: wrap;
  }

  .tout.theme-esbh-dark .simple-captcha .captcha {
    min-width: 0;
    width: 70px;
  }

  .tout.theme-esbh-dark .simple-captcha .imgca {
    max-width: 100px;
  }

  .tout.theme-esbh-dark .simple-footer {
    flex-wrap: wrap;
  }
}

/* ===========================
   LABELS VISIBLES (au-dessus des champs, au lieu du placeholder-comme-label)
=========================== */
.field-block {
  display: flex;
  flex-direction: column;
}
.field-block label {
  font-weight: bold;
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.field-block label .req {
  color: #d32f2f;
  margin-left: 2px;
}

/* ===========================
   THÈME CLAIR ESBH (fond blanc, bordures fines, bouton vert)
=========================== */
.tout.theme-esbh-light {
  background: #ffffff;
  border: none;
  width: 90%;
  max-width: 1000px;
}

.tout.theme-esbh-light input,
.tout.theme-esbh-light select,
.tout.theme-esbh-light textarea {
  border: 1px solid #333333;
  border-radius: 4px;
  padding: 10px 14px;
}

.tout.theme-esbh-light .privacy-note {
  font-size: 0.8rem;
  color: #555;
  margin-top: 10px;
}

.tout.theme-esbh-light .simple-captcha {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid #333333;
  border-radius: 8px;
  padding: 10px 15px;
}

/* Case à cocher */
.tout.theme-esbh-light .simple-captcha input[type="checkbox"] {
  width: 18px !important;
  height: 18px;
  min-width: 18px;
  margin: 0 !important;
  padding: 0;
  flex: 0 0 18px;
}

/* Texte du checkbox */
.tout.theme-esbh-light .simple-captcha label {
  width: auto !important;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: 0.9rem;
}

/* Champ où on tape le code */
.tout.theme-esbh-light .simple-captcha input.captcha {
  width: 100px !important;
  min-width: 100px;
  height: 42px;
  margin: 0 !important;
  padding: 8px 10px;
  box-sizing: border-box;
  border: 1px solid #333333;
  border-radius: 6px;
  flex: 0 0 100px;
}

/* Image CAPTCHA */
.tout.theme-esbh-light .simple-captcha .imgca {
  width: 150px;
  max-width: 150px;
  height: auto;
  margin: 0;
  flex: 0 0 auto;
}

@media (max-width: 768px) {
  .tout.theme-esbh-light .simple-captcha {
    flex-wrap: wrap;
  }
  .tout.theme-esbh-light .simple-footer {
    flex-wrap: wrap;
  }
}

.tout.theme-esbh-light .simple-submit {
  background: #6a9a3a;
  color: #ffffff;
  border-radius: 30px;
  padding: 14px 24px;
  font-weight: 700;
  width: auto;
  min-width: 0;
  white-space: nowrap;
  border: none;
}