.subscriber-popup,
.subscriber-popup * {
  box-sizing: border-box;
}

.subscriber-popup {
  position: fixed;
  inset: auto max(24px, calc((100vw - 1202px) / 2)) 24px auto;
  z-index: 45;
  width: min(408px, calc(100vw - 28px));
  max-width: none;
  max-height: calc(100dvh - 28px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dfe5ec;
  border-radius: 16px;
  color: #1f2937;
  background: #fff;
  box-shadow:
    0 18px 48px rgba(15, 23, 42, 0.13),
    0 2px 8px rgba(15, 23, 42, 0.05);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.subscriber-popup:not([open]) {
  display: none;
}

.subscriber-popup[data-subscriber-popup-measuring] {
  display: block;
  visibility: hidden;
  pointer-events: none;
  animation: none;
}

.subscriber-popup::before {
  position: absolute;
  top: 17px;
  left: -1px;
  z-index: 1;
  width: 4px;
  height: 68px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #2563eb 0%, #60a5fa 100%);
  box-shadow: 3px 0 12px rgba(37, 99, 235, 0.14);
  content: "";
  pointer-events: none;
}

.subscriber-popup[open] {
  animation: subscriber-popup-in 160ms ease-out both;
}

.subscriber-popup.subscriber-popup-continued[open] {
  animation: none;
}

.subscriber-popup button,
.subscriber-popup input {
  font: inherit;
}

.subscriber-popup button {
  cursor: pointer;
}

.subscriber-popup button:focus-visible,
.subscriber-popup input:focus-visible {
  outline: 3px solid rgba(59, 111, 232, 0.24);
  outline-offset: 2px;
}

.subscriber-popup-card {
  position: relative;
  max-height: calc(100dvh - 28px);
  padding: 17px 18px 18px 20px;
  overflow-y: auto;
  background: #fff;
}

.subscriber-popup-topline {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.subscriber-popup-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.subscriber-popup-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 0 0 3px #eff6ff;
}

.subscriber-popup-close {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #64748b;
  background: transparent;
  appearance: none;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.subscriber-popup-close:hover {
  border-color: #e5e7eb;
  color: #334155;
  background: #f9fafb;
}

.subscriber-popup-title {
  margin: 9px 0 0;
  color: #172033;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.subscriber-popup-copy {
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
}

.subscriber-popup-form {
  margin-top: 14px;
}

.subscriber-popup-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.subscriber-popup-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.subscriber-popup-input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  outline: none;
  color: #1f2937;
  background: #fff;
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.subscriber-popup-input:focus {
  border-color: rgba(37, 99, 235, 0.62);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.09);
}

.subscriber-popup-input::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.subscriber-popup-submit {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: #172033;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  appearance: none;
  transition: background-color 160ms ease, transform 160ms ease;
}

.subscriber-popup-submit:hover {
  background: #243149;
  transform: translateY(-1px);
}

.subscriber-popup-submit:active {
  transform: translateY(0);
}

.subscriber-popup-submit:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.subscriber-popup-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
}

.subscriber-popup-consent {
  margin: 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}

.subscriber-popup-error {
  margin: 8px 0 0;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.45;
}

.subscriber-popup-dismiss {
  min-height: 28px;
  flex: 0 0 auto;
  margin: -5px -7px 0 0;
  padding: 4px 7px;
  border: 0;
  border-radius: 7px;
  color: #64748b;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  appearance: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.subscriber-popup-dismiss:hover {
  color: #334155;
  background: #f8fafc;
}

.subscriber-popup-success {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 11px;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  color: #166534;
  background: #f0fdf4;
  outline: none;
}

.subscriber-popup-success[hidden],
.subscriber-popup-error[hidden],
.subscriber-popup-form[hidden] {
  display: none;
}

.subscriber-popup-success-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #15803d;
  background: #dcfce7;
}

.subscriber-popup-success-icon svg {
  width: 13px;
  height: 13px;
}

.subscriber-popup-success p {
  margin: 0;
  color: #166534;
  font-size: 13px;
  line-height: 1.45;
}

@keyframes subscriber-popup-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 780px) {
  .subscriber-popup {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 430px) {
  .subscriber-popup-form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .subscriber-popup-submit {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .subscriber-popup[open] {
    animation: none;
  }
}
