/* Newsletter card (assets/js/newsletter.js) and the unsubscribe page (api/unsubscribe.php).
   The card sits above the floating help button in the bottom right corner. */

.nl-card {
  --nl-offset: 0px;
  position: fixed;
  right: 24px;
  bottom: calc(96px + var(--nl-offset));
  z-index: 99999;
  width: 360px;
  max-width: calc(100vw - 32px);
  padding: 22px 22px 18px;
  background: #fff;
  color: #222529;
  border-top: 3px solid #0064c0;
  border-radius: 4px;
  box-shadow: 0 18px 50px rgba(34, 37, 41, 0.22);
  font-family: "Open Sans", sans-serif;
  opacity: 0;
  visibility: hidden;
  transform: translateX(calc(100% + 40px));
  transition: transform 550ms cubic-bezier(0.16, 1, 0.3, 1), opacity 400ms ease, visibility 0s linear 550ms, bottom 400ms ease;
}

.nl-card.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: transform 550ms cubic-bezier(0.16, 1, 0.3, 1), opacity 400ms ease, visibility 0s, bottom 400ms ease;
}

.nl-card__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #777;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nl-card__close:hover,
.nl-card__close:focus-visible {
  background: #f4f4f4;
  color: #222529;
}

.nl-card__close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.nl-card__title {
  margin: 0 32px 8px 0;
  font-family: Poppins, sans-serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #222529;
}

.nl-card__text {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #555;
}

.nl-card__form {
  margin: 0;
}

.nl-card__row {
  display: flex;
  gap: 8px;
}

.nl-card__input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
  color: #222529;
  background: #fff;
}

.nl-card__input:focus {
  outline: none;
  border-color: #0064c0;
  box-shadow: 0 0 0 3px rgba(0, 100, 192, 0.15);
}

.nl-btn {
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 3px;
  background: #0064c0;
  color: #fff;
  font-family: Poppins, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.nl-btn:hover,
.nl-btn:focus-visible {
  background: #222529;
}

.nl-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.nl-card__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.nl-card__note {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: #777;
}

.nl-card__note a {
  color: #0064c0;
  text-decoration: underline;
}

.nl-card__status {
  min-height: 0;
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
}

.nl-card__status:empty {
  display: none;
}

.nl-card__status.is-error {
  color: #b00020;
}

.nl-card__status.is-success {
  color: #0064c0;
  font-weight: 600;
}

@media (max-width: 575px) {
  .nl-card {
    right: 12px;
    left: 12px;
    bottom: calc(84px + var(--nl-offset));
    width: auto;
    max-width: none;
    padding: 22px 18px 16px;
    transform: translateY(calc(100% + 40px));
  }

  .nl-card__title {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nl-tab {
    transition: none;
  }

  .nl-card,
  .nl-card.is-open {
    transition: opacity 200ms ease, visibility 0s;
    transform: none;
  }
}

/* Envelope tab that reopens the card */

.nl-tab {
  position: fixed;
  top: 38%;
  right: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 8px 0 0 8px;
  background: #0064c0;
  color: #fff;
  box-shadow: 0 6px 18px rgba(34, 37, 41, 0.25);
  cursor: pointer;
  transform: translateX(100%);
  transition: transform 350ms cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, width 0.2s ease;
}

.nl-tab.is-visible {
  transform: translateX(0);
}

.nl-tab:hover,
.nl-tab:focus-visible {
  width: 52px;
  background: #222529;
}

.nl-tab svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 575px) {
  .nl-tab {
    width: 40px;
    height: 40px;
  }

  .nl-tab:hover,
  .nl-tab:focus-visible {
    width: 40px;
  }
}

/* Unsubscribe page */

.nl-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: #f4f4f4;
  font-family: "Open Sans", sans-serif;
  color: #222529;
}

.nl-page__card {
  width: 100%;
  max-width: 480px;
  padding: 32px 28px;
  background: #fff;
  border-top: 3px solid #0064c0;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(34, 37, 41, 0.12);
  text-align: center;
}

.nl-page__card img {
  max-width: 100%;
  height: auto;
  margin-bottom: 20px;
}

.nl-page__title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
}

.nl-page__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.nl-page__actions form {
  margin: 0;
}

.nl-page__link {
  color: #0064c0;
  font-weight: 600;
}
