/* ============================================
   猫虾 — Exit Intent Popup Styles
   Mini popup (not full-screen modal)
   ============================================ */

/* --- Exit Intent Popup --- */
.exit-popup {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  background: var(--surface, #fff);
  border-radius: var(--radius-lg, 20px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  padding: 1.5rem 1.5rem 1.25rem;
  max-width: 360px;
  width: calc(100vw - 48px);
  border: 1px solid var(--border, #e5e5e7);
  animation: exitSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif);
}

/* Gentle idle version — more subtle */
.exit-popup.idle-version {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  border-color: var(--green-light, #e8f7e2);
  background: linear-gradient(135deg, #fafff8 0%, #fff 100%);
}

@keyframes exitSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes exitSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
}

.exit-popup.closing {
  animation: exitSlideOut 0.25s ease-in forwards;
}

/* Close button */
.exit-popup__close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-tertiary, #aeaeb2);
  line-height: 1;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.exit-popup__close:hover {
  color: var(--text, #1c1c1e);
  background: var(--bg, #f2f2f4);
}

/* Icon row */
.exit-popup__icon {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* Title */
.exit-popup__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, #1c1c1e);
  margin-bottom: 0.4rem;
}

/* Body text */
.exit-popup__text {
  font-size: 0.85rem;
  color: var(--text-secondary, #6e6e73);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Email form */
.exit-popup__form {
  display: flex;
  gap: 0.5rem;
}

.exit-popup__input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  border: 1.5px solid var(--border, #e5e5e7);
  border-radius: 100px;
  background: var(--bg, #f2f2f4);
  color: var(--text, #1c1c1e);
  font-family: var(--font, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif);
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}
.exit-popup__input:focus {
  border-color: var(--green, #7ecf5e);
}
.exit-popup__input::placeholder {
  color: var(--text-tertiary, #aeaeb2);
}

.exit-popup__submit {
  flex-shrink: 0;
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--green, #7ecf5e);
  color: #fff;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: var(--font, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif);
}
.exit-popup__submit:hover {
  background: var(--green-dark, #5cb83a);
  transform: translateY(-1px);
}

/* Success state */
.exit-popup__success {
  display: none;
  text-align: center;
  padding: 0.5rem 0;
}
.exit-popup__success.active {
  display: block;
}
.exit-popup__success-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}
.exit-popup__success-text {
  font-size: 0.9rem;
  color: var(--green-dark, #5cb83a);
  font-weight: 600;
}

/* Hide form when success shown */
.exit-popup.success .exit-popup__form,
.exit-popup.success .exit-popup__title,
.exit-popup.success .exit-popup__text {
  display: none;
}

/* Idle version specific styles */
.exit-popup.idle-version .exit-popup__icon {
  font-size: 1.4rem;
}
.exit-popup.idle-version .exit-popup__text {
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 480px) {
  .exit-popup {
    bottom: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
    width: auto;
    padding: 1.25rem 1rem 1rem;
  }
  .exit-popup__form {
    flex-direction: column;
  }
  .exit-popup__submit {
    text-align: center;
  }
}
