/* ============================================
   Modal - Liquid Glass + Animações SVG
   ============================================ */

/* Overlay do modal */
.snp-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 17, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  padding: max(0.75rem, env(safe-area-inset-top))
           max(0.75rem, env(safe-area-inset-right))
           max(0.75rem, env(safe-area-inset-bottom))
           max(0.75rem, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.snp-modal-overlay.snp-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Container do modal - Efeito liquid-glass */
.snp-modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: min(90vh, 90dvh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: rgba(20, 22, 28, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 2rem 1.75rem;
  margin: auto;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
  opacity: 0;
}

.snp-modal-overlay.snp-active .snp-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* SVG animado de abertura - fundo decorativo */
.snp-modal-bg-svg {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
  animation: snpModalFloat 8s ease-in-out infinite;
}

@keyframes snpModalFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(-10px, -15px) rotate(2deg); }
  66% { transform: translate(10px, 10px) rotate(-2deg); }
}

/* Botão fechar */
.snp-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  color: #d8d7d2;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}

.snp-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  transform: rotate(90deg);
}

.snp-modal-close:focus-visible {
  outline: 2px solid #9b9993;
  outline-offset: 2px;
}

.snp-modal-close svg {
  width: 18px;
  height: 18px;
}

/* Conteúdo do formulário */
.snp-modal-content {
  position: relative;
  z-index: 1;
  padding-right: 0.25rem;
}

.snp-modal-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 2.75rem 0.5rem 0;
  line-height: 1.2;
}

.snp-modal-sub {
  color: #b8b7b3;
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
  line-height: 1.45;
}

/* Campos */
.snp-form-group {
  margin-bottom: 1rem;
}

.snp-form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #cfcfc9;
  margin-bottom: 0.35rem;
}

.snp-form-input {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  color: #ffffff;
  /* 16px evita zoom automático no iOS ao focar o campo */
  font-size: 16px;
  line-height: 1.35;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.snp-form-input:focus {
  border-color: #9b9993;
  box-shadow: 0 0 0 3px rgba(155, 153, 147, 0.2);
}

.snp-form-input::placeholder {
  color: #8c8b86;
}

/* Checkbox LGPD */
.snp-form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 1.25rem 0 1.5rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #cfcfc9;
}

.snp-form-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 0.1rem;
  flex-shrink: 0;
  accent-color: #9b9993;
  cursor: pointer;
}

.snp-form-check a {
  color: #d8d7d2;
  text-decoration: underline;
  transition: color 0.2s;
}

.snp-form-check a:hover {
  color: #ffffff;
}

/* Botão enviar */
.snp-modal-btn {
  width: 100%;
  min-height: 48px;
  padding: 0.9rem 1rem;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 30px;
  border: none;
  background: #9b9993;
  color: #0a0c11;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .snp-modal-btn:hover {
    background: #b3b1ab;
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
  }
}

.snp-modal-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.snp-modal-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

/* Mensagem de sucesso/erro */
.snp-modal-msg {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  font-size: 0.9rem;
  text-align: center;
  display: none;
  word-break: break-word;
}

.snp-modal-msg.snp-success {
  display: block;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.snp-modal-msg.snp-error {
  display: block;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.snp-modal-msg.snp-info {
  display: block;
  background: rgba(155, 153, 147, 0.12);
  border: 1px solid rgba(155, 153, 147, 0.28);
  color: #d8d7d2;
}

/* Honeypot: oculto de humanos, visível a bots ingênuos */
.snp-hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Loading spinner */
.snp-spinner {
  display: none;
  width: 24px;
  height: 24px;
  margin: 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #0a0c11;
  border-radius: 50%;
  animation: snpSpin 0.8s linear infinite;
}

@keyframes snpSpin {
  to { transform: rotate(360deg); }
}

.snp-modal-btn.snp-loading .snp-btn-text {
  display: none;
}
.snp-modal-btn.snp-loading .snp-spinner {
  display: inline-block;
}

/* Mobile / telas baixas (teclado virtual) */
@media (max-width: 640px), (max-height: 720px) {
  .snp-modal-overlay {
    align-items: flex-start;
  }

  .snp-modal {
    max-height: none;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 480px) {
  .snp-modal {
    padding: 1.35rem 1.1rem 1.5rem;
    border-radius: 20px;
  }

  .snp-modal-title {
    font-size: 1.35rem;
    margin-right: 2.5rem;
  }

  .snp-modal-sub {
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
  }

  .snp-form-group {
    margin-bottom: 0.85rem;
  }

  .snp-form-check {
    margin: 1rem 0 1.25rem;
  }

  .snp-modal-bg-svg {
    width: 100px;
    height: 100px;
    top: -20px;
    right: -20px;
  }

  .snp-modal-close {
    top: 0.5rem;
    right: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .snp-modal-overlay,
  .snp-modal,
  .snp-modal-close,
  .snp-modal-btn,
  .snp-form-input,
  .snp-modal-bg-svg,
  .snp-spinner {
    animation: none !important;
    transition: none !important;
  }
}
