/* =========================================================
   NEWSLETTER BOX
   ========================================================= */

.newsletter-box {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 32px;
  max-width: var(--max-width);
  margin: 0 auto 40px;
  text-align: center;
}


/* Newsletter heading */

.newsletter-box-text h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: #fff;
}


/* Newsletter description */

.newsletter-box-text p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 auto 22px;
  max-width: 520px;
}


/* =========================================================
   NEWSLETTER FORM
   ========================================================= */

.newsletter-form {
  display: flex;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
}


/* Email input */

.newsletter-input {
  flex: 1;
  min-width: 0;

  padding: 12px 16px;

  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);

  background: rgba(255, 255, 255, 0.08);
  color: #fff;

  font-size: 0.92rem;
}

.newsletter-input:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.newsletter-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.newsletter-input:focus {
  outline: none;
  border-color: var(--violet);
  background: rgba(255, 255, 255, 0.12);
}


/* Subscribe button */

.newsletter-submit {
  padding: 12px 24px;

  white-space: nowrap;

  border: none;
  border-radius: 999px;

  font-weight: 600;
  cursor: pointer;

  background: var(--indigo);
  color: #fff;
}

.newsletter-submit:hover {
  filter: brightness(1.08);
}


/* =========================================================
   HONEYPOT
   ========================================================= */

.newsletter-honeypot {
  position: absolute;
  left: -9999px;

  width: 1px;
  height: 1px;

  opacity: 0;
}


/* =========================================================
   NEWSLETTER POPUP OVERLAY
   ========================================================= */

/*
 * The overlay handles ALL positioning.
 * It centers the popup horizontally AND vertically.
 */

.newsletter-popup-overlay {
  position: fixed;
  inset: 0;

  z-index: 8000;

  background: rgba(18, 22, 43, 0.5);

  display: none;

  align-items: center;
  justify-content: center;

  padding: 20px;
}

.newsletter-popup-overlay.is-visible {
  display: flex;
}


/* =========================================================
   NEWSLETTER POPUP
   ========================================================= */

.newsletter-popup {
  /*
   * Do NOT use position: fixed here.
   * The overlay centers this element.
   */

  width: fit-content;
  max-width: calc(100vw - 40px);

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 14px;

  padding: 14px 18px 14px 20px;

  background: var(--ink);
  color: #fff;

  border-radius: 999px;

  box-shadow: 0 16px 40px rgba(18, 22, 43, 0.3);

  font-size: 0.9rem;

  opacity: 0;
  transform: scale(0.95);

  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}


/* Popup visible animation */

.newsletter-popup-overlay.is-visible .newsletter-popup {
  opacity: 1;
  transform: scale(1);
  width:fit-content;
}


/* =========================================================
   POPUP TYPES
   ========================================================= */

.newsletter-popup-success {
  border: 1px solid var(--teal);
}

.newsletter-popup-error {
  border: 1px solid var(--coral);
}

.newsletter-popup-info {
  border: 1px solid var(--border);
}


/* =========================================================
   POPUP ICON / TICK
   ========================================================= */

.newsletter-popup-icon {
  flex: 0 0 52px;

  width: 52px;
  height: 52px;

  margin: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
}


/* Success icon */

.newsletter-popup-success .newsletter-popup-icon {
  background: var(--success-tint);
  color: var(--success);
}


/* Error icon */

.newsletter-popup-error .newsletter-popup-icon {
  background: var(--danger-tint);
  color: var(--danger);
}


/* Info icon */

.newsletter-popup-info .newsletter-popup-icon {
  background: var(--violet-tint);
  color: var(--violet);
}


/* SVG */

.newsletter-popup-icon .icon {
  display: block;

  width: 24px;
  height: 24px;
}


/* =========================================================
   POPUP TEXT
   ========================================================= */

.newsletter-popup-text {
  margin: 0;
  line-height: 1.4;
}


/* =========================================================
   POPUP CLOSE / GOT IT BUTTON
   ========================================================= */

.newsletter-popup-close-btn {
  flex-shrink: 0;

  padding: 10px 12px;

  background: none;
  color: #fff;

  border: none;
  border-radius: 999px;

  font-weight: 600;
  font-size: 0.9rem;

  cursor: pointer;
}

.newsletter-popup-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}


/* =========================================================
   MOBILE NEWSLETTER POPUP
   ========================================================= */

@media (max-width: 560px) {

  .newsletter-popup {
    max-width: calc(100vw - 32px);

    gap: 10px;

    padding: 10px 12px 10px 14px;

    font-size: 0.85rem;
  }

  .newsletter-popup-icon {
    flex: 0 0 44px;

    width: 44px;
    height: 44px;
  }

  .newsletter-popup-icon .icon {
    width: 21px;
    height: 21px;
  }

  .newsletter-popup-text {
    font-size: 0.8rem;
  }

  .newsletter-popup-close-btn {
    padding: 8px;
    font-size: 0.8rem;
  }
}


/* =========================================================
   MOBILE NEWSLETTER BOX
   ========================================================= */

@media (max-width: 560px) {

  .newsletter-box {
    padding: 10px;
    margin: 0 20px;
  }

  .newsletter-form {
    flex-direction: column;
    max-width: 100%;
  }

  .newsletter-submit {
    width: 100%;
  }
}