/**
 * Lead Magnet Popup Styles
 * Modal popup for lead capture
 * Version: 1.0.0
 */

.lead-magnet-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0%;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.lead-magnet-popup.active {
  opacity: 100%;
  visibility: visible;
  pointer-events: auto;
}

.lead-magnet-popup__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgb(0 0 0 / 80%);
  backdrop-filter: blur(4px);
  pointer-events: auto;
}

/* Ensure overlay doesn't block content when popup is hidden */
.lead-magnet-popup:not(.active) .lead-magnet-popup__overlay {
  pointer-events: none;
}

.lead-magnet-popup__container {
  position: relative;
  z-index: 1;
  max-width: 540px;
  width: calc(100% - 2rem);
  max-height: calc(100vh - 2rem);
  background: linear-gradient(135deg, rgb(255 255 255 / 95%) 0%, rgb(255 255 255 / 98%) 100%);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgb(255 255 255 / 30%);
  box-shadow: 0 20px 60px rgb(0 0 0 / 30%);
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lead-magnet-popup.active .lead-magnet-popup__container {
  transform: scale(1) translateY(0);
}

.lead-magnet-popup__header {
  padding: 2rem 2rem 1rem;
  text-align: center;
}

.lead-magnet-popup__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 2rem;
}

.lead-magnet-popup__title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.lead-magnet-popup__subtitle {
  font-size: 1rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.lead-magnet-popup__content {
  padding: 0 2rem 2rem;
}

.lead-magnet-popup__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lead-magnet-popup__input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lead-magnet-popup__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}

.lead-magnet-popup__input {
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  background: rgb(255 255 255 / 80%);
  border: 2px solid rgb(0 0 0 / 10%);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.lead-magnet-popup__input:focus {
  outline: none;
  border-color: #1e40af;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgb(30 64 175 / 10%);
}

.lead-magnet-popup__submit {
  padding: 1rem 2rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgb(245 158 11 / 40%);
}

.lead-magnet-popup__submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgb(245 158 11 / 50%);
}

.lead-magnet-popup__submit:active {
  transform: translateY(0);
}

.lead-magnet-popup__submit:disabled {
  opacity: 60%;
  cursor: not-allowed;
  transform: none;
}

.lead-magnet-popup__privacy {
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 0.5rem;
}

.lead-magnet-popup__privacy a {
  color: #1e40af;
  text-decoration: none;
}

.lead-magnet-popup__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 40px;
  height: 40px;
  background: rgb(0 0 0 / 5%);
  border: none;
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.lead-magnet-popup__close:hover {
  background: rgb(0 0 0 / 10%);
  color: #0f172a;
}

.lead-magnet-popup__close svg {
  width: 24px;
  height: 24px;
}

/* Success state */
.lead-magnet-popup__success {
  text-align: center;
  padding: 2rem 0;
}

.lead-magnet-popup__success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  color: #10b981;
}

.lead-magnet-popup__success h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.5rem;
}

.lead-magnet-popup__success p {
  font-size: 1rem;
  color: #64748b;
  margin: 0.5rem 0;
}

.lead-magnet-popup__success .btn {
  margin-top: 1rem;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
  .lead-magnet-popup__container {
    width: calc(100% - 1rem);
    max-height: calc(100vh - 1rem);
  }

  .lead-magnet-popup__header {
    padding: 1.5rem 1.5rem 1rem;
  }

  .lead-magnet-popup__content {
    padding: 0 1.5rem 1.5rem;
  }

  .lead-magnet-popup__title {
    font-size: 1.5rem;
  }

  .lead-magnet-popup__subtitle {
    font-size: 0.9375rem;
  }

  .lead-magnet-popup__icon {
    width: 56px;
    height: 56px;
    font-size: 1.75rem;
  }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  .lead-magnet-popup__container {
    background: linear-gradient(135deg, rgb(15 23 42 / 95%) 0%, rgb(30 41 59 / 98%) 100%);
    border-color: rgb(255 255 255 / 10%);
  }

  .lead-magnet-popup__title {
    color: #f8fafc;
  }

  .lead-magnet-popup__subtitle,
  .lead-magnet-popup__success p {
    color: #cbd5e1;
  }

  .lead-magnet-popup__label {
    color: #e2e8f0;
  }

  .lead-magnet-popup__input {
    background: rgb(255 255 255 / 5%);
    border-color: rgb(255 255 255 / 10%);
    color: #f8fafc;
  }

  .lead-magnet-popup__input:focus {
    background: rgb(255 255 255 / 8%);
    border-color: #3b82f6;
  }

  .lead-magnet-popup__close {
    background: rgb(255 255 255 / 5%);
    color: #cbd5e1;
  }

  .lead-magnet-popup__close:hover {
    background: rgb(255 255 255 / 10%);
    color: #f8fafc;
  }

  .lead-magnet-popup__success h3 {
    color: #f8fafc;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .lead-magnet-popup,
  .lead-magnet-popup__container {
    transition: none;
  }

  .lead-magnet-popup.active .lead-magnet-popup__container {
    transform: none;
  }

  .lead-magnet-popup__submit:hover {
    transform: none;
  }
}

/* Performance mode */
body.performance-mode .lead-magnet-popup__overlay {
  backdrop-filter: none;
}

body.performance-mode .lead-magnet-popup__container {
  backdrop-filter: none;
}

/* Print - hide */
@media print {
  .lead-magnet-popup {
    display: none !important;
  }
}
