/*
 * The Newsletter plugin's page (/newsletter/: "Manage your preferences" from Chapter emails; inc/newsletter-page.php):
 * its form as a card in the site's style. The plugin's own classes (.tnp-*) are styled here, more specific than the
 * plugin's stylesheet.
 */

.bp-content .pmilc-pref-lead {
  max-width: 640px;
  margin: 0 0 24px;
  color: var(--muted-ui);
  font-size: var(--text-ui-lead);
  line-height: 1.6;
}

.bp-content .tnp-profile {
  max-width: 640px;
  margin: 0;
  padding: 32px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: var(--shadow-card);
}

.bp-content .tnp-profile form {
  margin: 0;
}

.bp-content .tnp-profile .pmilc-pref-h {
  margin: 0 0 16px;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.3;
}

.bp-content .tnp-profile .tnp-lists ~ .tnp-field,
.bp-content .tnp-profile .pmilc-pref-h + .pmilc-pref-hint {
  margin-top: 0;
}

.bp-content .tnp-profile .tnp-field-lastname + .pmilc-pref-h,
.bp-content .tnp-profile .tnp-field + .pmilc-pref-h {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}

.bp-content .tnp-profile .pmilc-pref-hint {
  margin: -8px 0 14px;
  color: var(--muted-ui);
  font-size: var(--text-ui-sm);
}

.bp-content .tnp-profile .tnp-field {
  margin: 0 0 18px;
}

.bp-content .tnp-profile .tnp-field > label {
  display: block;
  margin: 0 0 6px;
  color: var(--ink-strong);
  font-size: var(--text-ui-sm);
  font-weight: 600;
}

.bp-content .tnp-profile input[type="text"],
.bp-content .tnp-profile input[type="email"],
.bp-content .tnp-profile select {
  box-sizing: border-box;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-control);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-strong);
  font: inherit;
  font-size: var(--text-ui-md);
}

.bp-content .tnp-profile input[type="text"]:focus-visible,
.bp-content .tnp-profile select:focus-visible {
  border-color: var(--purple);
  outline: 3px solid var(--focus-ring);
  outline-offset: 1px;
}

/* The updates: one card each, the box, its name and what it brings. */
.bp-content .tnp-profile .tnp-lists {
  display: grid;
  gap: 10px;
  margin: 0 0 24px;
}

.bp-content .tnp-profile .tnp-field-list {
  margin: 0;
}

.bp-content .tnp-profile .tnp-field-list label {
  display: grid;
  grid-template-columns: 22px 1fr;
  column-gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line-control);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}

.bp-content .tnp-profile .tnp-field-list label:hover {
  border-color: var(--purple);
}

.bp-content .tnp-profile .tnp-field-list label:has(input:checked) {
  border-color: var(--purple);
  background: var(--purple-wash);
}

.bp-content .tnp-profile .tnp-field-list input[type="checkbox"] {
  grid-row: 1 / span 2;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--purple);
}

.bp-content .tnp-profile .tnp-field-list input[type="checkbox"]:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.bp-content .tnp-profile .tnp-list-label {
  color: var(--ink-strong);
  font-weight: 700;
}

.bp-content .tnp-profile .pmilc-pref-desc {
  grid-column: 2;
  margin-top: 2px;
  color: var(--muted-ui);
  font-size: var(--text-ui-sm);
  line-height: 1.5;
}

.bp-content .tnp-profile .tnp-field-privacy {
  margin: 0 0 18px;
  font-size: var(--text-ui-sm);
}

.bp-content .tnp-profile .tnp-field-privacy a {
  color: var(--purple);
}

.bp-content .tnp-profile .tnp-field-button {
  margin: 0;
}

.bp-content .tnp-profile .tnp-submit {
  height: var(--ds-button-lg);
  padding: 0 30px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--purple);
  box-shadow: var(--shadow-button);
  color: #fff;
  font-family: var(--font-ui);
  font-size: var(--text-ui-md);
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s ease;
}

.bp-content .tnp-profile .tnp-submit:hover {
  background: var(--purple-press);
}

.bp-content .tnp-profile .tnp-submit:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.bp-content .pmilc-pref-saved {
  max-width: 640px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--cyan-wash);
  color: var(--cyan-ink-strong);
  font-weight: 600;
}

.bp-content .pmilc-pref-notes {
  max-width: 640px;
  margin: 20px 0 0;
  color: var(--muted-ui);
  font-size: var(--text-ui-sm);
}

.bp-content .pmilc-pref-notes p {
  margin: 0 0 6px;
}

.bp-content .pmilc-pref-notes a,
.bp-content .pmilc-pref-missing a:not(.pmilc-unsub-link) {
  color: var(--purple);
}

.bp-content .pmilc-pref-missing .pmilc-unsub-link {
  margin: 4px 0 16px;
}

/* An expired or incomplete link. */
.bp-content .pmilc-pref-missing {
  max-width: 640px;
  padding: 28px 32px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  background: var(--purple-wash);
}

.bp-content .pmilc-pref-missing h2 {
  margin: 0 0 10px;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.bp-content .pmilc-pref-missing p {
  margin: 0 0 8px;
}

/* Hero card (inc/newsletter-page.php pmilc_tnp_hero_card(), in the shared .page-hero's glass card) ---------------- */
.nlp-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nlp-card ul,
.nlp-card ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nlp-card b,
.nlp-card h2 {
  color: var(--ink-strong);
  font-family: var(--font-display);
}

.nlp-card small {
  display: block;
  color: var(--muted-ui);
  font-size: var(--text-ui-xs);
  line-height: 1.45;
}

.nlp-note {
  margin: 0;
  color: var(--muted-ui);
  font-size: var(--text-ui-sm);
  line-height: 1.5;
}

/* Icon squares, one colour per email or route. */
.nlp-ico {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--purple-tint);
  color: var(--purple);
}

.nlp-ico svg {
  width: 20px;
  height: 20px;
}

.nlp-ico.is-night { background: var(--night-deep); color: #fff; }
.nlp-ico.is-cyan { background: var(--cyan-tint); color: var(--cyan-ink); }
.nlp-ico.is-orange { background: var(--orange-tint); color: var(--orange-deep); }

/* Preferences: "3/4 reach your inbox", a four-part meter, then one row per email. */
.nlp-score {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.nlp-score b {
  font-size: 48px;
  line-height: 1;
  letter-spacing: -.03em;
}

.nlp-score b small {
  display: inline;
  color: var(--muted-ui);
  font-size: 24px;
  letter-spacing: 0;
}

.nlp-score > span {
  color: var(--muted-ui);
  font-size: var(--text-ui-md);
}

.nlp-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.nlp-meter span {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--purple);
}

.nlp-meter .is-night { background: var(--night-deep); }
.nlp-meter .is-cyan { background: var(--highlight); }
.nlp-meter .is-orange { background: var(--join); }
.nlp-meter .is-off { background: var(--line-control); }

.nlp-mail,
.nlp-routes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nlp-mail li,
.nlp-routes a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--ds-radius-sm);
  background: rgba(255, 255, 255, .72);
}

.nlp-mail li.is-off .nlp-ico {
  background: var(--line-soft);
  color: var(--muted-ui);
}

.nlp-name {
  flex: 1;
  min-width: 0;
}

.nlp-name b {
  display: block;
  font-size: var(--text-ui-md);
  line-height: 1.3;
}

.nlp-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--cyan-wash);
  color: var(--cyan-ink-strong);
  font-size: var(--text-ui-xs);
  font-weight: 700;
}

.nlp-chip svg {
  width: 14px;
  height: 14px;
}

.nlp-chip.is-off {
  background: var(--line-soft);
  color: var(--muted-ui);
}

/* Unsubscribe: Stops | Stays. */
.nlp-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.nlp-col {
  padding: 16px;
  border-radius: var(--ds-radius-sm);
  background: rgba(255, 255, 255, .72);
}

.nlp-col h2 {
  margin: 0 0 12px;
  font-size: var(--text-ui-lg);
}

.nlp-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nlp-col li {
  display: flex;
  gap: 8px;
  color: var(--ink-strong);
  font-size: var(--text-ui-sm);
  line-height: 1.45;
}

.nlp-col li svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  padding: 2px;
  border-radius: var(--radius-round);
}

.nlp-col.is-stop li svg { background: var(--orange-wash); color: var(--orange-ink); }
.nlp-col.is-stay li svg { background: var(--cyan-wash); color: var(--cyan-ink-strong); }

/* Resubscribe / welcome back: three numbered steps on a line. */
.nlp-steps {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.nlp-steps::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: var(--line-control);
}

.nlp-steps li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.nlp-dot {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--line-control);
  border-radius: var(--radius-round);
  background: #fff;
  color: var(--muted-ui);
  font-family: var(--font-display);
  font-weight: 700;
}

.nlp-dot svg {
  width: 18px;
  height: 18px;
}

.nlp-steps .is-now .nlp-dot {
  border-color: var(--purple);
  color: var(--purple);
}

.nlp-steps .is-done .nlp-dot {
  border-color: var(--purple);
  background: var(--purple);
  color: #fff;
}

.nlp-steps b {
  display: block;
  padding-top: 6px;
  font-size: var(--text-ui-md);
}

.nlp-note a,
.nlp-steps b a {
  color: var(--purple);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Unsubscribed: route links. */
.nlp-routes a {
  color: var(--ink-strong);
  transition: background-color .15s ease, box-shadow .15s ease;
}

.nlp-routes a:hover {
  background: #fff;
  box-shadow: var(--shadow-card);
  color: var(--ink-strong);
}

.nlp-go {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-round);
  background: var(--purple);
  color: #fff;
  transition: transform .15s ease;
}

.nlp-go svg {
  width: 15px;
  height: 15px;
}

.nlp-routes a:hover .nlp-go {
  transform: translateX(2px);
}

/* A link without a subscriber: a small Chapter email, its footer's link marked. */
.nlp-email {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--ds-radius-sm);
  background: #fff;
  box-shadow: var(--shadow-card);
}

.nlp-email-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.nlp-email-top span {
  width: 72px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--purple) 0 30%, var(--join) 30% 45%, var(--line-control) 45%);
}

.nlp-email-top i {
  width: 38px;
  height: 26px;
  border-radius: 6px;
  background: var(--night-deep);
}

.nlp-email-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
}

.nlp-email-body > i {
  height: 8px;
  border-radius: 4px;
  background: var(--line-soft);
}

.nlp-email-body > i:first-child {
  width: 60%;
  height: 12px;
  background: var(--line-control);
}

.nlp-email-body > i.is-short {
  width: 75%;
}

.nlp-email-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.nlp-email-cards i {
  height: 46px;
  border-radius: 8px;
  background: var(--purple-wash);
}

.nlp-email-cards i + i {
  background: var(--cyan-wash);
}

.nlp-email-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  padding: 14px;
  background: var(--night-deep);
  color: rgba(255, 255, 255, .7);
  font-size: 11px;
  line-height: 1.4;
}

.nlp-email-foot .is-mark {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--join);
  color: var(--night-deep);
  font-weight: 700;
  box-shadow: 0 0 0 4px rgba(255, 122, 0, .25);
}

@media (max-width: 767px) {
  .nlp-score b {
    font-size: 40px;
  }

  .nlp-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Unsubscribe (texts under Newsletter → Subscription → Unsubscribe): the confirmation card next to the "fewer emails"
   card, and the one-card steps after it. */
.bp-content .pmilc-unsub {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  max-width: 900px;
  align-items: stretch;
}

.bp-content .pmilc-unsub-card,
.bp-content .pmilc-unsub-done {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 32px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: var(--shadow-card);
}

.bp-content .pmilc-unsub-done {
  max-width: 640px;
}

.bp-content .pmilc-unsub-alt {
  background: var(--purple-wash);
  box-shadow: none;
}

.bp-content .pmilc-unsub-card h2,
.bp-content .pmilc-unsub-done h2 {
  margin: 0 0 10px;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.3;
}

.bp-content .pmilc-unsub-card p,
.bp-content .pmilc-unsub-done p {
  margin: 0 0 20px;
  color: var(--muted-ui);
}

.bp-content .pmilc-unsub-card .tnp-button-form,
.bp-content .pmilc-unsub-done .tnp-button-form {
  margin: 0 0 20px;
}

/* Buttons sit at the same height in both cards; the small print keeps to the bottom. */
.bp-content .pmilc-unsub-card .tnp-button-form,
.bp-content .pmilc-unsub-card .pmilc-unsub-link {
  margin-top: auto;
}

.bp-content .pmilc-unsub-card > :last-child,
.bp-content .pmilc-unsub-done > :last-child {
  margin-bottom: 0;
}

.bp-content .pmilc-unsub-done .pmilc-unsub-link {
  margin-bottom: 20px;
}

.bp-content .tnp-button-form .tnp-submit,
.bp-content .pmilc-unsub-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: var(--ds-button-lg);
  padding: 0 30px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--purple);
  box-shadow: var(--shadow-button);
  color: #fff;
  font-family: var(--font-ui);
  font-size: var(--text-ui-md);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.bp-content .tnp-button-form .tnp-submit:hover,
.bp-content .pmilc-unsub-link:hover {
  background: var(--purple-press);
  color: #fff;
}

.bp-content .tnp-button-form .tnp-submit:focus-visible,
.bp-content .pmilc-unsub-link:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

/* Leaving is the quieter action: an outlined button. */
.bp-content .tnp-button-unsubscribe .tnp-submit {
  border: 2px solid var(--purple);
  background: #fff;
  box-shadow: none;
  color: var(--purple);
}

.bp-content .tnp-button-unsubscribe .tnp-submit:hover {
  background: var(--purple-wash);
  color: var(--purple-press);
}

.bp-content .pmilc-unsub-small {
  font-size: var(--text-ui-sm);
}

.bp-content .pmilc-unsub-card a:not(.pmilc-unsub-link),
.bp-content .pmilc-unsub-done a:not(.pmilc-unsub-link) {
  color: var(--purple);
}

@media (max-width: 760px) {
  .bp-content .pmilc-unsub {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .bp-content .tnp-profile,
  .bp-content .pmilc-unsub-card,
  .bp-content .pmilc-unsub-done {
    padding: 22px 18px;
  }

  .bp-content .tnp-button-form,
  .bp-content .tnp-button-form .tnp-submit,
  .bp-content .pmilc-unsub-link {
    width: 100%;
  }

  .bp-content .tnp-profile .tnp-submit {
    width: 100%;
  }
}
