/* Milesopedia Newsletter Inline - styles
   v1.2 mobile-compact: image hidden < 600px, tighter padding so the box fits
   text+CTA in the visible area on phones. Lead magnet variant supports a
   bullet list under the headline. */

.mli-box {
  display: flex;
  width: 100%;
  max-width: 1000px;
  margin: 32px auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(7, 7, 33, 0.08);
  background: #ffffff;
  font-family: 'Poppins', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #070721;
  line-height: 1.5;
  box-sizing: border-box;
}
.mli-box *, .mli-box *::before, .mli-box *::after { box-sizing: border-box; }

.mli-box .mli-image {
  flex: 0 0 42%;
  background-size: cover;
  background-position: center;
  min-height: 360px;
}

.mli-box .mli-content {
  flex: 1;
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #EFF5F9;
}

.mli-box .mli-logo { display: block; margin-bottom: 16px; }
.mli-box .mli-logo img { height: 32px; width: auto; display: block; max-width: 100%; }

.mli-box .mli-headline {
  font-size: 16px;
  font-weight: 600;
  color: #070721;
  margin: 0 0 12px 0;
  line-height: 1.4;
}
.mli-box--leadmagnet .mli-headline {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
}

.mli-box .mli-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  font-size: 14px;
  line-height: 1.45;
  color: #1a1a2e;
}
.mli-box .mli-bullets li {
  position: relative;
  padding: 4px 0 4px 24px;
}
.mli-box .mli-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #09A0DA;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-6' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.mli-box .mli-form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #070721;
  margin-bottom: 4px;
}

.mli-box .mli-form-row {
  display: flex;
  gap: 0;
  margin-bottom: 8px;
}

.mli-box .mli-input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid #d0d7de;
  border-right: none;
  border-radius: 6px 0 0 6px;
  font-size: 15px;
  font-family: inherit;
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s;
  color: #070721;
  min-width: 0;
}
.mli-box .mli-input:focus { border-color: #09A0DA; }

.mli-box .mli-button {
  padding: 12px 22px;
  background: #09A0DA;
  color: #ffffff;
  border: none;
  border-radius: 0 6px 6px 0;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.mli-box .mli-button:hover:not(:disabled) { background: #0782B0; }
.mli-box .mli-button:disabled { opacity: 0.6; cursor: not-allowed; }

.mli-box .mli-message {
  font-size: 13px;
  margin: 6px 0 8px 0;
  min-height: 18px;
  color: #070721;
}
.mli-box .mli-message.is-error { color: #c0392b; }
.mli-box .mli-message.is-success { color: #1e8449; }

.mli-box .mli-legal {
  font-size: 11px;
  color: #555;
  line-height: 1.45;
  margin: 0;
}
.mli-box .mli-legal a { color: #09A0DA; text-decoration: underline; }

/* Tablet: image still present but smaller */
@media (max-width: 900px) {
  .mli-box .mli-image { min-height: 280px; flex-basis: 38%; }
  .mli-box .mli-content { padding: 24px 28px; }
}

/* Phone: stack, hide decorative image so text + CTA fit above the fold */
@media (max-width: 600px) {
  .mli-box {
    flex-direction: column;
    margin: 20px auto;
    border-radius: 10px;
  }
  .mli-box .mli-image { display: none; }
  .mli-box .mli-content { padding: 20px 18px; background: #EFF5F9; }
  .mli-box .mli-logo { margin-bottom: 10px; }
  .mli-box .mli-logo img { height: 26px; }
  .mli-box .mli-headline { font-size: 15px; line-height: 1.35; margin-bottom: 8px; }
  .mli-box--leadmagnet .mli-headline { font-size: 16px; }
  .mli-box .mli-bullets { font-size: 13px; margin-bottom: 12px; }
  .mli-box .mli-bullets li { padding: 3px 0 3px 22px; }
  .mli-box .mli-bullets li::before { top: 7px; width: 14px; height: 14px; }
  .mli-box .mli-form-label { font-size: 12px; }
  .mli-box .mli-form-row { flex-direction: column; gap: 8px; }
  .mli-box .mli-input { border-radius: 6px; border-right: 1px solid #d0d7de; padding: 11px 13px; font-size: 14px; }
  .mli-box .mli-button { border-radius: 6px; padding: 12px 18px; font-size: 13px; }
  .mli-box .mli-message { margin: 4px 0 6px 0; }
  .mli-box .mli-legal { font-size: 10px; line-height: 1.35; }
}


/* WEB-523 — honeypot. Moved off-screen rather than `display:none`: a bot that
   skips hidden inputs would sail past the trap, and this keeps the field a
   real, fillable input. `aria-hidden` + `tabindex="-1"` on the markup keep it
   away from screen readers and the keyboard. */
.mli-hp {
    position: absolute !important;
    left: -9999px !important;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}


/* ------------------------------------------------------------------------ *
   WEB-523 — pop-up.

   L'enveloppe modale autour d'une .mli-box. La box garde sa mise en page
   normale ; seule la boîte englobante change. C'est ce qui permet de n'avoir
   qu'un seul formulaire dans le plugin, donc un seul pot de miel et un seul
   chemin de soumission.
 * ------------------------------------------------------------------------ */

/* `hidden` doit gagner contre le `display:flex` ci-dessous, sinon la pop-up
   est visible avant que le JS ne décide de l'ouvrir. */
.mli-popup[hidden] { display: none !important; }

.mli-popup {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 200ms ease;
}
.mli-popup.is-open { opacity: 1; }

.mli-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 7, 33, 0.62);
}

.mli-popup__dialog {
  position: relative;
  width: 100%;
  max-width: 900px;
  /* La modale ne dépasse jamais l'écran : sur un petit portable en paysage,
     c'est le contenu qui défile, pas la page derrière. */
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border-radius: 12px;
  transform: translateY(8px);
  transition: transform 200ms ease;
}
.mli-popup.is-open .mli-popup__dialog { transform: translateY(0); }

.mli-popup__close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #070721;
  font-size: 26px;
  line-height: 34px;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(7, 7, 33, 0.18);
}
.mli-popup__close:hover { background: #ffffff; }
.mli-popup__close:focus-visible { outline: 2px solid #09A0DA; outline-offset: 2px; }

/* Dans la modale la box ne flotte pas : elle EST la modale. */
.mli-box--popup {
  margin: 0;
  max-width: none;
  box-shadow: none;
}

/* Empêche la page de défiler derrière la modale ouverte. */
.mli-popup-lock, .mli-popup-lock body { overflow: hidden; }

@media (max-width: 600px) {
  .mli-popup { padding: 12px; }
  .mli-popup__dialog { max-height: calc(100vh - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  .mli-popup, .mli-popup__dialog { transition: none; }
}
