/* ==========================================================================
   Sign-up pop-up (template-parts/subscribe-popup.php,
   assets/js/subscribe-popup.js): 2026 redesign SubscribePopup.dc.html
   (computers: purple panel beside the form) and SubscribePopupMobile.dc.html
   (phones: a short purple header above the form, as a sheet rising from the
   bottom of the screen, so the page stays in view above it).
   ========================================================================== */
.sp {
  width: 900px;
  max-width: calc(100% - 80px);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: var(--ds-radius-lg);
  background: transparent;
  color: var(--ink-strong);
  font-family: var(--font-ui);
}

.sp::backdrop {
  background: rgba(26, 11, 69, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.sp[open] {
  animation: sp-in .25s ease-out;
}

@keyframes sp-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}

@keyframes sp-up {
  from { opacity: 0; transform: translateY(48px); }
  to { opacity: 1; transform: none; }
}

html.sp-lock {
  overflow: hidden;
}

.sp-card:focus {
  outline: none;
}

.sp-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  max-height: inherit;
  overflow-y: auto;
  border-radius: var(--ds-radius-lg);
  background: #fff;
  box-shadow: var(--shadow-menu);
}

/* Purple panel */
.sp-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: 40px;
  overflow: hidden;
  background: var(--purple);
}

.sp-panel > :not(.sp-blur) {
  position: relative;
}

.sp-blur {
  position: absolute;
  border-radius: var(--radius-round);
  filter: blur(70px);
  pointer-events: none;
}

.sp-blur.is-orange {
  left: -60px;
  bottom: -80px;
  width: 260px;
  height: 260px;
  background: var(--join);
  opacity: .45;
}

.sp-blur.is-cyan {
  right: -60px;
  top: -60px;
  width: 240px;
  height: 240px;
  background: var(--highlight);
  opacity: .4;
}

.sp-logo {
  display: block;
  align-self: flex-start;
  width: auto;
  height: 52px;
  margin-bottom: 8px;
}

.sp-eyebrow {
  color: var(--cyan-light);
  font-size: var(--text-ui-2xs);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sp-title {
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: 2.125rem; /* 34px */
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.sp-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sp-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--on-purple);
  font-size: var(--text-ui);
  line-height: 1.5;
}

.sp-tick {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: var(--radius-round);
  background: var(--highlight-glass);
  color: var(--cyan-light);
}

.sp-tick svg {
  width: 14px;
  height: 14px;
}

.sp-intro {
  display: none;
  margin: 0;
  color: var(--on-purple);
  font-size: var(--text-ui-sm);
  line-height: 1.5;
}

/* Close (white, on the form side; on the purple header on phones) */
.sp-close {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-control);
  border-radius: var(--radius-round);
  background: #fff;
  color: var(--ink-strong);
  cursor: pointer;
}

.sp-close:hover {
  border-color: var(--purple);
}

.sp-close svg {
  width: 18px;
  height: 18px;
}

/* Form */
.sp-body {
  position: relative;
  padding: 48px 40px 40px;
}

.sp-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sp-field > label {
  color: var(--ink-strong);
  font-size: var(--text-ui-xs);
  font-weight: 700;
}

.sp-required {
  color: var(--orange-ink);
}

.sp-optional {
  color: var(--muted-strong);
  font-weight: 600;
}

.sp input:not([type="checkbox"]),
.sp select {
  box-sizing: border-box;
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line-control);
  border-radius: var(--ds-radius-sm);
  background: var(--surface-soft);
  color: var(--ink-strong);
  font-family: var(--font-ui);
  font-size: var(--text-ui);
}

.sp select {
  padding: 0 10px;
}

.sp input:not([type="checkbox"]):focus,
.sp select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(79, 23, 168, .15);
  outline: none;
}

.sp input.is-invalid {
  border-color: #C0262D;
}

.sp-consents {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 2px;
}

.sp-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted-ui);
  font-size: var(--text-ui-xs);
  line-height: 1.5;
}

.sp-check input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--purple);
}

/* "Also email me (optional)": the Monthly / Weekly / Daily updates (0.9.312). */
.sp .subscribe-digests {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--muted-ui);
  font-size: var(--text-ui-xs);
  line-height: 1.5;
}

.sp .subscribe-digests legend {
  float: left;
  margin-right: 2px;
  padding: 0;
}

.sp .subscribe-digests label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.sp .subscribe-digests input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--purple);
}

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

.sp-error {
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--ds-radius-sm);
  background: var(--error-wash);
  color: var(--error-ink);
  font-size: var(--text-ui-xs);
  font-weight: 600;
  line-height: 1.5;
}

.sp-submit {
  justify-content: center;
  width: 100%;
  height: 52px;
  border: 0;
  cursor: pointer;
}

.sp-submit[disabled] {
  opacity: .7;
  cursor: progress;
}

.sp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sp-foot span {
  color: var(--muted-strong);
  font-size: var(--text-ui-2xs);
  line-height: 1.5;
}

.sp-foot a {
  color: var(--purple);
  font-weight: 700;
}

.sp-later {
  flex-shrink: 0;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-ui);
  font-family: var(--font-ui);
  font-size: var(--text-ui-sm);
  font-weight: 700;
  cursor: pointer;
}

.sp-later:hover {
  color: var(--purple);
}

/* Thank-you */
.sp-sent {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
}

.sp-form[hidden],
.sp-field[hidden],
.sp-error[hidden],
.sp-sent[hidden] {
  display: none;
}

.sp-sent:focus {
  outline: none;
}

.sp-sent-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-round);
  background: var(--purple-tint-ui);
  color: var(--purple);
}

.sp-sent-icon svg {
  width: 28px;
  height: 28px;
}

.sp-sent h3 {
  margin: 0;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: var(--text-ui-panel);
  font-weight: 700;
}

.sp-sent p {
  margin: 0;
  color: var(--muted-ui);
  font-size: var(--text-ui);
  line-height: 1.6;
}

.sp-done {
  height: 48px;
  padding: 0 24px;
  border: 0;
  font-size: var(--text-ui);
  cursor: pointer;
}

/* Phones: a sheet at the bottom of the screen, purple header above the form. */
@media (max-width: 767px) {
  .sp {
    width: 100%;
    max-width: none;
    max-height: 88vh;
    max-height: 88dvh;
    margin: auto 0 0;
    border-radius: var(--ds-radius-lg) var(--ds-radius-lg) 0 0;
  }

  .sp[open] {
    animation: sp-up .28s ease-out;
  }

  .sp::backdrop {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .sp-card {
    display: block;
    border-radius: var(--ds-radius-lg) var(--ds-radius-lg) 0 0;
  }

  .sp-panel {
    gap: 8px;
    padding: 22px 20px;
  }

  .sp-blur {
    filter: blur(50px);
  }

  .sp-blur.is-cyan {
    right: -50px;
    top: -50px;
    width: 180px;
    height: 180px;
  }

  .sp-blur.is-orange {
    left: -40px;
    bottom: -70px;
    width: 180px;
    height: 180px;
  }

  .sp-logo {
    height: 40px;
    margin-bottom: 6px;
  }

  .sp-eyebrow {
    font-size: var(--text-ui-3xs);
  }

  .sp-title {
    padding-right: 48px;
    font-size: var(--text-ui-panel);
    line-height: 1.2;
    letter-spacing: 0;
  }

  .sp-points {
    display: none;
  }

  .sp-intro {
    display: block;
  }

  .sp-close {
    right: 12px;
    top: 12px;
    border: 0;
    background: rgba(255, 255, 255, .18);
    color: #fff;
  }

  .sp-close:hover {
    background: rgba(255, 255, 255, .28);
  }

  .sp-close:focus-visible {
    outline-color: var(--highlight);
  }

  .sp-body {
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  }

  .sp-form {
    gap: 14px;
  }
}

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