/* Fenêtre « Candidature au conseil d'administration » (page S'impliquer).
   Un <dialog> natif plutôt qu'une des superpositions du thème : celles-ci
   sont créées une à une par le script du thème (frontend.min.js), qu'on ne
   modifie pas. Chargé sur toutes les pages, comme les autres feuilles
   d'assets, parce qu'une transition de page ne recharge pas le <head>. */

.c-board-dialog {
  width: min(860px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  background: transparent;
  color: #062c52;
  overflow: visible;
}

.c-board-dialog::backdrop {
  background: rgba(6, 44, 82, 0.82);
}

.c-board-dialog__panel {
  position: relative;
  box-sizing: border-box;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 3.2rem clamp(1.6rem, 5vw, 4.8rem) 3.6rem;
  background: #f8f5ef;
  border-radius: 1.7rem;
}

.c-board-dialog__close {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  width: 4.2rem;
  height: 4.2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f9ba00;
  color: #062c52;
  font-size: 2.6rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
}

.c-board-dialog__close:hover,
.c-board-dialog__close:focus-visible {
  background: #fadd8a;
}

.c-board-dialog .c-form-block,
.c-board-dialog .c-form-block__text {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.c-board-dialog .c-form-block__text {
  margin: 0 5.4rem 1.6rem 0;
  padding: 0;
  width: auto;
}

.c-board-dialog .c-form-block__text > * {
  max-width: 100%;
}

/* Une grille à nous : celle du thème dépend de la largeur de la page, pas
   de celle de cette fenêtre. */
.c-board-dialog .c-form__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem 2rem;
  margin: 0;
}

.c-board-dialog .c-form__fields > * {
  width: auto;
  max-width: none;
  margin: 0;
  grid-column: span 1;
}

.c-board-dialog .c-form__fields > .o-cols__c-8,
.c-board-dialog .c-form__fields > .o-textarea-ctn {
  grid-column: 1 / -1;
}

.c-board-dialog .c-form__submit-button-container {
  margin-top: 2.4rem;
}

.c-board-dialog .c-form-block__content,
.c-board-dialog .c-form-block__content-wrapper {
  width: 100%;
  max-width: none;
}

.c-board-dialog .c-form-block__content-message {
  margin: 3.6rem auto 0;
}

@media (max-width: 640px) {
  .c-board-dialog .c-form__fields {
    grid-template-columns: minmax(0, 1fr);
  }
}
