/* =============================================
   TheMealora — Subscribe Popup
   ============================================= */

#tm-subscribe-popup {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  padding: 16px;
}

#tm-subscribe-popup.tm-popup--visible {
  opacity: 1;
  visibility: visible;
}

.tm-popup__card {
  background: #ffffff;
  border-radius: 20px;
  padding: 40px 36px 32px;
  max-width: 440px;
  width: 100%;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  transform: translateY(32px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  border-top: 4px solid #2D6A4F;
}

#tm-subscribe-popup.tm-popup--visible .tm-popup__card {
  transform: translateY(0) scale(1);
}

.tm-popup__close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.tm-popup__close:hover { background: #f3f4f6; color: #374151; }

.tm-popup__icon {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
}

.tm-popup__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 10px;
  line-height: 1.25;
}

.tm-popup__subtitle {
  font-size: 0.9375rem;
  color: #6b7280;
  margin: 0 0 24px;
  line-height: 1.6;
}

.tm-popup__input-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tm-popup__input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-family: 'DM Sans', sans-serif;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fafafa;
}
.tm-popup__input:focus {
  border-color: #2D6A4F;
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
  background: #fff;
}
.tm-popup__input::placeholder { color: #9ca3af; }

.tm-popup__btn {
  width: 100%;
  padding: 14px 20px;
  background: #2D6A4F;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  letter-spacing: 0.01em;
}
.tm-popup__btn:hover:not(:disabled) {
  background: #1e4d38;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(45, 106, 79, 0.28);
}
.tm-popup__btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.tm-popup__privacy {
  font-size: 0.78rem;
  color: #9ca3af;
  text-align: center;
  margin-top: 12px;
}

.tm-popup__error {
  display: none;
  font-size: 0.84rem;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 8px 12px;
}

/* Success State */
.tm-popup__success {
  display: none;
  text-align: center;
  padding: 12px 0 4px;
}
.tm-popup__success-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}
.tm-popup__success-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #2D6A4F;
  margin: 0 0 8px;
}
.tm-popup__success-msg {
  font-size: 0.9375rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.6;
}

/* Mobile */
@media (max-width: 480px) {
  #tm-subscribe-popup {
    align-items: flex-end;
    padding: 0;
  }
  .tm-popup__card {
    border-radius: 20px 20px 0 0;
    padding: 32px 24px 28px;
    max-width: 100%;
    border-top-width: 4px;
    transform: translateY(100%);
  }
  #tm-subscribe-popup.tm-popup--visible .tm-popup__card {
    transform: translateY(0);
  }
}
