/* ==========================
   MODALS (clean / centered)
   Fix: gros cadre blanc + écarts
   ========================== */

/* Overlay modal */
.modal{
  display:none;
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  z-index:10001 !important;
  background: rgba(0,0,0,.45); /* remplace ton var si tu veux */
  overflow:auto;
  padding: 18px;              /* plus de padding-top:60px */
  box-sizing:border-box;
}

/* Show helpers (si tu ajoutes .open via JS) */
.modal.open{ display:flex; }

/* Si tu utilises aria-hidden (rpProModal), on supporte aussi */
.modal[aria-hidden="false"]{
  display:flex;
}

.modal{
  align-items:center;
  justify-content:center;
}

/* Boîte modal */
.modal-content{
  background:#fff; /* remplace ton var si tu veux */
  width: min(920px, calc(100vw - 36px));
  margin: 0;                       /* stop le 5% auto */
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 24px 70px rgba(0,0,0,.25);
  padding: 16px;                   /* padding simple, pas “38px top” */
  max-height: calc(100vh - 36px);  /* évite les modals gigantesques */
  overflow: auto;
  box-sizing:border-box;
}

/* Header/footer propres (tes modals les utilisent) */
.modal-header{
  position: sticky;
  top: 0;
  background:#fff;
  z-index: 2;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 10px 10px 12px;
  margin: -16px -16px 12px; /* colle le header au bord de la box */
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.modal-title{
  margin:0;
  font-weight:900;
}

.modal-body{
  padding: 0;
}

.modal-footer{
  position: sticky;
  bottom: 0;
  background:#fff;
  z-index: 2;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  padding: 12px 10px 10px;
  margin: 12px -16px -16px; /* colle le footer au bord */
  border-top: 1px solid rgba(0,0,0,.08);
}

/* Icône close (tes spans icon-cancel) */
.close,
.icon.icon-cancel{
  cursor:pointer;
}

/* Bootstrap-like structure: centre aussi les .modal-dialog */
.modal-dialog{
  width: min(920px, calc(100vw - 36px));
  margin: 0;               /* stop les marges bootstrap */
}

.modal-dialog .modal-content{
  width: 100%;
}

/* Backdrop bootstrap: garde z-index cohérent */
.modal-backdrop{
  z-index:10000;
}

/* ======================================================
   NEWSLETTER POPUP (tu l’avais, on le garde proprement)
   ====================================================== */

.modal-dialog.newsletter-dlg{
  position: fixed;
  bottom: 7px;
  right: 7px;
  left: 7px;
  width: auto;
  max-width: 100%;
  margin: 0;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,.12), 0 6px 20px rgba(0,0,0,.10);
  background: linear-gradient(to right,#ff8983 17.85%,#7f0e7f 53.28%,#007a65 100%);
  z-index: 10001 !important;
}

.modal-dialog.newsletter-dlg::before{
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  background: linear-gradient(to right,#ff8983 17.85%,#7f0e7f 53.28%,#007a65 100%);
  content:"";
  height: 5px;
  right:0;
  left:0;
  top:-4px;
  position:absolute;
  z-index:1;
}

.newsletter-dlg .popup-newsletter{
  padding-top: 0;
  margin: 1px;
  background: #f7f2e6;
  border-radius: 0 0 9px 9px;
  width: unset;
}

/* Transition slide (email popup) */
#emailPopup{
  transition: transform .5s ease-in-out, opacity .5s ease-in-out;
  transform: translateY(100%);
  opacity: 0;
  display:block;
}
#emailPopup.show{
  transform: translateY(0);
  opacity: 1;
}

/* ======================================================
   Mobile tweaks
   ====================================================== */
@media (max-width: 768px){
  .modal{ padding: 12px; }
  .modal-content{
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    border-radius: 12px;
  }
}