/* Newsletter lead-capture popup (exit-intent + timed). Injected site-wide via
   injectPopup in render.ts. Reuses /api/newsletter/subscribe. */

.tbe-popup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

.tbe-popup[hidden] {
  display: none;
}

.tbe-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 12, 9, 0.75);
  backdrop-filter: blur(3px);
}

.tbe-popup__box {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  max-width: 760px;
  background: #0e1a14;
  border: 1px solid rgba(146, 248, 199, 0.25);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  animation: tbe-popup-in 0.28s ease;
}

@keyframes tbe-popup-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tbe-popup__media {
  flex: 0 0 42%;
  background-size: cover;
  background-position: center;
  min-height: 340px;
}

.tbe-popup__content {
  flex: 1 1 auto;
  padding: 40px 36px;
  color: #fff;
}

.tbe-popup__title {
  margin: 0 0 12px;
  font-size: 27px;
  line-height: 1.2;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.tbe-popup__title span {
  color: #92f8c7;
}

.tbe-popup__sub {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.75);
}

.tbe-popup__form {
  margin: 0;
}

.tbe-popup__input {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  outline: 0;
  background: #fff;
  border-radius: 10px;
  padding: 15px 16px;
  font-size: 16px;
  color: #1a1a1a;
  font-family: inherit;
}

.tbe-popup__input::placeholder {
  color: #8a8f8c;
}

.tbe-popup__btn {
  width: 100%;
  margin-top: 12px;
  border: 0;
  cursor: pointer;
  background: #92f8c7;
  color: #05271a;
  font-weight: 800;
  font-size: 16px;
  padding: 15px 20px;
  border-radius: 10px;
  font-family: inherit;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

.tbe-popup__btn:hover {
  background: #7be9b4;
}

.tbe-popup__btn:active {
  transform: translateY(1px);
}

.tbe-popup__btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.tbe-popup__fine {
  margin: 14px 2px 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
}

.tbe-popup__fine a {
  color: #92f8c7;
  text-decoration: underline;
}

.tbe-popup__error {
  margin: 10px 2px 0;
  font-size: 14px;
  color: #ff9b9b;
}

.tbe-popup__error[hidden] {
  display: none;
}

.tbe-popup__success {
  color: #fff;
}

.tbe-popup__success .tbe-popup__title {
  color: #92f8c7;
}

.tbe-popup__close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.tbe-popup__close:hover {
  background: rgba(0, 0, 0, 0.65);
}

@media (max-width: 640px) {
  .tbe-popup__box {
    flex-direction: column;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
  }
  .tbe-popup__media {
    flex: 0 0 160px;
    min-height: 160px;
  }
  .tbe-popup__content {
    padding: 28px 24px 30px;
  }
  .tbe-popup__title {
    font-size: 23px;
  }
}
