/* =============================================================================
   Fenetre « Request portfolio » — remplace le popup Elementor Pro 3632 et son
   formulaire The Plus Addons (tp-plus-form).

   Emboitement d'origine, reproduit ici :
     .aec-modal        = le voile (#000000B3, plein ecran, centre)
     .aec-modal__box   = l'ancien .dialog-widget-content + .dialog-message
                         (600 px, fond blanc, rayon 8, ombre, padding 40)
     .aec-modal__body  = l'ancien conteneur Elementor, qui ajoutait le padding
                         par defaut du kit (40 px bureau / 30 tablette / 20 mobile)
   D'ou une zone de contenu de 440 px sur 600 en bureau. Ce second niveau de
   padding est indispensable a la parite.

   Les interlignes en pixels (titre 1.2px, bouton 1.3px) sont les valeurs
   reellement produites par Elementor : les reproduire telles quelles.
   ============================================================================= */

/* --- Voile ---------------------------------------------------------------- */
.aec-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000000B3;
}
.aec-modal[hidden] { display: none; }

/* --- Boite ---------------------------------------------------------------- */
.aec-modal__box {
  position: relative;
  box-sizing: border-box;
  width: 600px;
  max-width: 100%;
  max-height: 100vh;
  overflow: auto;
  padding: 40px;
  background-color: #FFFFFF;
  border-radius: 8px;
  box-shadow: 2px 8px 30px 3px rgba(0, 0, 0, 0.3);
  animation: aec-modal-entree .5s both;
}
@keyframes aec-modal-entree { from { opacity: 0; } to { opacity: 1; } }

/* Second niveau de padding : l'ancien conteneur Elementor. */
.aec-modal__body { padding: 40px; }

/* Sous 1025 px, la boite d'origine n'etait pas centree horizontalement : sa
   largeur en pourcentage sur un element en position:absolute la calait a gauche
   du voile. On reproduit ce comportement pour ne rien deplacer. */
@media (max-width: 1024px) {
  .aec-modal       { justify-content: flex-start; }
  .aec-modal__box  { width: 90%; }
  .aec-modal__body { padding: 30px; }
}
@media (max-width: 767px) {
  .aec-modal__box  { width: 95%; }
  .aec-modal__body { padding: 20px; }
}

/* --- Croix de fermeture --------------------------------------------------- */
.aec-modal__close {
  position: absolute;
  top: 20px;
  inset-inline-end: 20px;
  z-index: 9999;
  display: flex;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;      /* neutralise le rayon du bouton de assets/css/reset.css */
  background: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 1;
}
.aec-modal__close:hover,
.aec-modal__close:focus { background: none; border: 0; }
.aec-modal__close svg { width: 1em; height: 1em; fill: #1f2124; }

/* --- Titre ---------------------------------------------------------------- */
/* Deux classes : doit passer devant `.aec-kit h2` (0,1,1) du socle repris du kit,
   dont seul `text-transform:uppercase` est conserve ici. */
.aec-modal .aec-modal__title {
  /* 10 px du reglage + 20 px d'espacement inter-widgets du kit (--kit-widget-spacing). */
  margin: 0 0 30px;
  padding: 0;
  font-family: "Helvetica", Inter, sans-serif;
  font-size: 34px;
  font-weight: 700;
  font-style: normal;
  line-height: 1.2px;      /* valeur d'origine, en pixels */
  letter-spacing: 0;
  text-transform: uppercase;
  color: #8B0000;
}
@media (max-width: 1024px) {
  .aec-modal .aec-modal__title { font-size: 40px; line-height: 1.2em; letter-spacing: 0; }
}
@media (max-width: 767px) {
  .aec-modal .aec-modal__title { font-size: 32px; line-height: 0.9em; letter-spacing: -1.1px; }
}

/* --- Texte d'introduction ------------------------------------------------- */
.aec-modal .aec-modal__text {
  /* `flow-root` garde la marge basse du dernier paragraphe A L'INTERIEUR du bloc,
     comme le faisait le conteneur du widget Elementor ; la marge de 20 px qui suit
     est l'espacement inter-widgets du kit. */
  display: flow-root;
  margin-bottom: 20px;
  font-family: "Playfair Display", Inter, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 26px;
  letter-spacing: 0;
  color: #474745;
}
.aec-modal .aec-modal__text p { margin-block-end: 15px; }
@media (max-width: 1024px) {
  .aec-modal .aec-modal__text { font-size: 17px; line-height: 1.6em; }
}
@media (max-width: 767px) {
  .aec-modal .aec-modal__text { font-size: 16px; line-height: 1.6em; }
}

/* --- Formulaire ----------------------------------------------------------- */
.aec-pf {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  column-gap: 15px;
  row-gap: 20px;
}
.aec-pf__pot { display: none; }

.aec-pf__field {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
}
.aec-pf__field--half { width: 49%; }

.aec-modal .aec-pf__label {
  margin: 0 0 6px;
  font-family: "Helvetica", Inter, sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  text-align: left;
  color: #3A3A3A;
}
.aec-modal .aec-pf__req { color: #8B0000; }

.aec-modal .aec-pf input,
.aec-modal .aec-pf select,
.aec-modal .aec-pf textarea {
  box-sizing: border-box;
  width: 100%;
  padding: .5rem 1rem;
  border: 1px solid #D6D3D3;
  border-radius: 4px;
  background-color: #FFFFFF;
  color: #000000;
  transition: all .3s;
}
.aec-modal .aec-pf input::placeholder,
.aec-modal .aec-pf textarea::placeholder,
.aec-modal .aec-pf select {
  font-family: "Roboto Mono", Inter, sans-serif;
  font-size: 13px;
  font-weight: 400;
  font-style: normal;
  line-height: 17px;
  letter-spacing: 0;
  text-align: left;
  color: #3A3A3A;
}
@media (max-width: 1024px) {
  .aec-modal .aec-pf input::placeholder,
  .aec-modal .aec-pf textarea::placeholder,
  .aec-modal .aec-pf select { font-size: 12px; line-height: 1.3em; }
}
@media (max-width: 767px) {
  .aec-modal .aec-pf input::placeholder,
  .aec-modal .aec-pf textarea::placeholder,
  .aec-modal .aec-pf select { font-size: 11px; line-height: 1.3em; }
}
.aec-modal .aec-pf select option { color: #000; }
.aec-modal .aec-pf input:hover,
.aec-modal .aec-pf textarea:hover,
.aec-modal .aec-pf input:focus,
.aec-modal .aec-pf textarea:focus { background-color: #fff; color: #000; }
.aec-pf__field.has-error input,
.aec-pf__field.has-error select,
.aec-pf__field.has-error textarea { border-color: #dc3545; }

.aec-pf__help { color: #000; background-color: #fff; }

/* --- Bouton d'envoi ------------------------------------------------------- */
.aec-pf__submit-row {
  display: flex;
  justify-content: center;
  width: 100%;
}
.aec-modal .aec-pf__button {
  /* Pas de flex : le libelle doit rester une boite EN LIGNE, comme a l'origine.
     En flex il deviendrait un bloc de 1,3 px (l'interligne), ce qui decale sa
     boite de mesure meme si les glyphes tombent au meme endroit. */
  display: block;
  text-align: center;
  box-sizing: border-box;
  width: 18%;
  margin: 0;
  padding: 12px;
  border: none;
  border-radius: 25px;
  background-color: #8B0000;
  color: #FFFFFF;
  font-family: "Helvetica", Inter, sans-serif;
  font-size: 13px;
  font-weight: 600;
  font-style: normal;
  line-height: 1.3px;      /* valeur d'origine, en pixels */
  letter-spacing: 0;
  cursor: pointer;
  transition: all .3s;
}
.aec-modal .aec-pf__button:hover,
.aec-modal .aec-pf__button:focus {
  background: #FFFFFF;
  background-color: #FFFFFF;
  color: #8B0000;
  border: 1px solid #3A3A3A;
}
@media (max-width: 1024px) {
  .aec-modal .aec-pf__button { padding: 0; margin: 0; font-size: 14px; line-height: 1.3em; }
}
@media (max-width: 767px) {
  .aec-modal .aec-pf__button { width: 63px; padding: 0; margin: 0; font-size: 12px; }
}

.aec-pf__spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border: 2px solid #fff;
  border-top-color: #000;
  border-radius: 50%;
  vertical-align: middle;
  animation: aec-pf-spin .6s linear infinite;
}
@keyframes aec-pf-spin { to { transform: rotate(360deg); } }

/* --- Messages ------------------------------------------------------------- */
.aec-modal .aec-pf__message {
  width: 100%;
  text-align: left;
  color: #000;
}
.aec-modal .aec-pf__message.success { color: #28a745; }
.aec-modal .aec-pf__message.error   { color: #dc3545; }
