/* MT Lead Marketplace - Popup Styling */

.mtlm-popup {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  background: #F2F5FB;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  animation: mtlm-slide-up 0.3s ease-out;
  overflow: hidden;
}

@keyframes mtlm-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mtlm-popup.center {
  left: 50%;
  top: 50%;
  bottom: auto;
  right: auto;
  transform: translate(-50%, -50%);
  width: min(520px, 92vw);
  animation: mtlm-fade-in 0.25s ease-out;
}

@keyframes mtlm-fade-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.mtlm-popup-inner {
  padding: 20px;
  position: relative;
}

.mtlm-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.05);
  border: 0;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: background 0.15s ease, color 0.15s ease;
}

.mtlm-x:hover {
  background: rgba(0, 0, 0, 0.10);
  color: #111;
}

.mtlm-popup-title {
  font-weight: 800;
  font-size: 20px;
  color: #111;
  margin-bottom: 2px;
  padding-right: 30px;
}

.mtlm-popup-subtitle {
  font-weight: 700;
  font-size: 17px;
  color: #0084FF;
  margin-bottom: 8px;
}

.mtlm-popup-sub {
  font-size: 16px;
  color: #666;
  margin-bottom: 16px;
  line-height: 1.4;
}

.mtlm-popup-body {
  margin: 0;
}

.mtlm-popup-embed {
  display: none;
}

.mtlm-popup-form-host {
  max-height: 400px;
  overflow-y: auto;
}

/* Simplify the form inside popup */
.mtlm-popup .mtlm-lead-form-wrap {
  max-width: 100%;
  padding: 0;
}

.mtlm-popup .mtlm-lead-form .mtlm-row {
  margin-bottom: 12px;
}

.mtlm-popup .mtlm-models {
  grid-template-columns: 1fr;
  gap: 6px;
}

.mtlm-popup .mtlm-model-option {
  padding: 8px 10px;
  font-size: 13px;
}

.mtlm-popup .mtlm-budget-grid {
  gap: 10px;
}

.mtlm-popup .mtlm-checks {
  margin-top: 12px !important;
  padding-top: 12px;
}

.mtlm-popup .mtlm-check-option {
  font-size: 13px;
  margin-bottom: 8px !important;
}

.mtlm-popup .mtlm-submit-row {
  margin-top: 16px !important;
  padding-top: 12px;
}

/* Link fallback */
.mtlm-popup-form-host p {
  margin: 0;
}

.mtlm-popup-form-host p a {
  display: block;
  padding: 14px 20px;
  background: #0084FF;
  color: #fff !important;
  text-decoration: none;
  text-align: center;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  transition: background 0.15s ease;
}

.mtlm-popup-form-host p a:hover {
  background: #0070dd;
}

/* Overlay for center style */
.mtlm-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999998;
  animation: mtlm-overlay-fade 0.2s ease-out;
}

@keyframes mtlm-overlay-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Mobile */
@media (max-width: 480px) {
  .mtlm-popup {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    animation: mtlm-slide-up-mobile 0.3s ease-out;
  }

  @keyframes mtlm-slide-up-mobile {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .mtlm-popup.center {
    left: 0;
    top: auto;
    bottom: 0;
    transform: none;
    width: 100%;
    border-radius: 16px 16px 0 0;
  }

  .mtlm-popup-form-host {
    max-height: 60vh;
  }
}
