/* =================================================================
   NEXRUMO - POPUP FORM STYLES
   Estilos do popup de captação de leads
   ================================================================= */

/* Overlay do popup */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.popup-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Container do popup */
.popup-container {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 500px;
  width: 100%;
  position: relative;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-height: 90vh;
  overflow-y: auto;
}

.popup-overlay.active .popup-container {
  transform: scale(1) translateY(0);
}

/* Botão de fechar */
.popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-light);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
  z-index: 10;
}

.popup-close:hover {
  background: var(--error);
  color: var(--bg-white);
  transform: rotate(90deg);
}

/* Conteúdo do popup */
.popup-title {
  font-size: 28px;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: 8px;
  text-align: center;
}

.popup-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  text-align: center;
}

/* Formulário */
.popup-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

/* Garante que inputs não ultrapassem o container */
.form-row .form-group {
  min-width: 0;
  /* Permite que o grid funcione corretamente */
}

.form-row input {
  width: 100%;
  min-width: 0;
  /* Evita overflow */
}

.form-group {
  display: flex;
  flex-direction: column;
}

.popup-form input,
.popup-form select {
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--text-primary);
  transition: all 0.2s;
  background: var(--bg-white);
}

.popup-form input:focus,
.popup-form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ultra-light);
}

.popup-form input::placeholder {
  color: var(--text-muted);
}

.btn-popup-submit {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 18px;
  padding: 16px;
}

.btn-popup-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.popup-disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  line-height: 1.5;
}

/* Mensagem de sucesso */
.popup-success {
  text-align: center;
  padding: 20px 0;
  animation: fadeIn 0.4s ease;
}

.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: var(--success-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn 0.5s ease;
}

.success-icon i {
  color: var(--success);
  font-size: 48px;
}

.success-title {
  font-size: 28px;
  font-weight: var(--fw-bold);
  color: var(--success);
  margin-bottom: 16px;
}

.success-message {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
}

.success-message strong {
  color: var(--primary);
  font-weight: var(--fw-bold);
}

/* Animações */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  0% {
    transform: scale(0);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

/* Responsividade Mobile */
@media (max-width: 768px) {
  .popup-container {
    padding: 32px 24px;
    max-height: 95vh;
  }

  .popup-title {
    font-size: 24px;
  }

  .popup-subtitle {
    font-size: 14px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .popup-form input {
    font-size: 16px;
    /* Evita zoom no iOS */
  }

  .success-icon {
    width: 64px;
    height: 64px;
  }

  .success-icon i {
    font-size: 36px;
  }

  .success-title {
    font-size: 24px;
  }

  .success-message {
    font-size: 16px;
  }
}

/* Scrollbar customizada */
.popup-container::-webkit-scrollbar {
  width: 6px;
}

.popup-container::-webkit-scrollbar-track {
  background: var(--bg-light);
  border-radius: 3px;
}

.popup-container::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

.popup-container::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}