.account-page {
  box-sizing: border-box;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 20px;
  min-height: 100svh;
  padding: 22px 16px 40px;
}

.account-masthead {
  box-sizing: border-box;
  width: min(26rem, 100%);
  padding-bottom: 12px;
  border-bottom: 4px double var(--ink);
  text-align: center;
}

.account-masthead a {
  color: var(--ink);
  font:
    700 30px/1 "Zilla Slab",
    Georgia,
    serif;
  text-decoration: none;
}

.account-masthead p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.account {
  box-sizing: border-box;
  width: min(26rem, 100%);
  margin: 0;
  padding: 28px 28px 26px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 22px 40px -30px rgb(31 27 20 / 0.5);
  overflow-wrap: anywhere;
}

.account-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
}

.account h1 {
  margin: 0;
  font:
    700 32px/1.05 "Zilla Slab",
    Georgia,
    serif;
  text-wrap: balance;
}

.account-price {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.account-price strong {
  color: var(--ink);
  font:
    700 26px/1 "Zilla Slab",
    Georgia,
    serif;
}

.account-lede {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.account form {
  display: grid;
  justify-items: stretch;
  gap: 8px;
  margin-top: 22px;
}

.account label {
  font-size: 13px;
  font-weight: 700;
}

.account input[type="email"] {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: #fffdf8;
  color: var(--ink);
  /* 16px keeps iOS Safari from zooming the page when the field takes focus. */
  font:
    16px/1.2 Inter,
    system-ui,
    sans-serif;
}

.account input[type="email"]:focus {
  border-color: var(--winner);
}

.account :is(input, button, .account-button):focus-visible {
  outline: 3px solid rgb(36 89 196 / 0.45);
  outline-offset: 2px;
}

.account :is(button, .account-button) {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-height: 48px;
  margin-top: 6px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font:
    700 16px/1.2 Inter,
    system-ui,
    sans-serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.account :is(button, .account-button):hover {
  background: #3b342a;
}

.account button.account-button--secondary {
  border: 1px solid var(--rule-strong);
  background: transparent;
  color: var(--ink);
}

.account button.account-button--secondary:hover {
  background: var(--paper);
}

.account-fine {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.account-switch {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

:is(.account-switch, .account-fine, .account-lede) a {
  color: var(--ink);
  font-weight: 700;
  text-underline-offset: 3px;
}

.account-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  counter-reset: step;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.account-steps li {
  display: flex;
  align-items: center;
  gap: 6px;
  counter-increment: step;
}

.account-steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  font-size: 11px;
}

.account-steps li:not(:last-child)::after {
  content: "";
  width: 16px;
  height: 1px;
  margin-inline-start: 2px;
  background: var(--rule-strong);
}

.account-steps [aria-current="step"] {
  color: var(--ink);
}

.account-steps [aria-current="step"]::before {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.account-includes {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--rule);
  list-style: none;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.account-includes li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
}

.account-includes li::before {
  content: "";
  width: 18px;
  height: 18px;
  margin-top: 1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='9' fill='%232459c4'/%3E%3Cpath d='M5 9.3l2.6 2.5L13 6.4' fill='none' stroke='%23fbf8f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.account-includes b {
  color: var(--ink);
}

.account-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--paper);
}

.account-icon svg {
  width: 26px;
  height: 26px;
}

.account-lede b {
  color: var(--ink);
}

.account-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.account-section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 12px;
}

.account-section h2 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.account-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.account-status--paid {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.account-status--ending {
  border-color: var(--loser);
  color: var(--loser);
}

.account-status--complimentary {
  border-color: var(--winner);
  color: var(--winner);
}

.account-detail {
  margin: 10px 0 0;
  line-height: 1.45;
}

.account-detail + .account-detail {
  margin-top: 2px;
  color: var(--muted);
}

.account-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--paper);
  font-size: 14px;
  line-height: 1.45;
}

.account .account-section form {
  margin-top: 12px;
}

.account .account-section form + form {
  margin-top: 4px;
}

.account .account-section .account-fine {
  margin-top: 10px;
}

.account .account-section .account-fine + .account-fine {
  margin-top: 2px;
}

.account button.account-button--cancel {
  color: var(--loser);
}

.account form.account-signout {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

/* Use the extra width to bring the form and billing controls up on short screens. */
@media (orientation: landscape) and (max-height: 460px) {
  .account-page {
    gap: 8px;
    padding-block: 8px 20px;
  }

  .account-masthead {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 2px 16px;
    width: min(46rem, 100%);
    padding-bottom: 6px;
    text-align: left;
  }

  .account-masthead a {
    font-size: 22px;
  }

  .account-masthead p {
    margin: 0;
  }

  .account {
    width: min(46rem, 100%);
    padding: 16px 20px 18px;
  }

  .account h1 {
    font-size: 26px;
  }

  .account-steps {
    margin-bottom: 10px;
  }

  .account-lede {
    margin-top: 6px;
  }

  .account form {
    margin-top: 14px;
  }

  .account-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
  }

  .account :is(input, button, .account-button) {
    scroll-margin-block: 12px;
  }
}

@media (orientation: landscape) and (max-height: 460px) and (min-width: 34rem) {
  .account:has(> :is(form, .account-button, .account-section)) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
    align-items: start;
  }

  /* Reserve the last row for Subscribe's benefits, below the intro and form. */
  .account:not(:has(> .account-section)) {
    grid-template-rows: repeat(3, min-content) 1fr auto;
  }

  .account:not(:has(> .account-section)) > * {
    grid-column: 1;
  }

  .account:not(:has(> .account-section)) > :is(form, .account-button) {
    grid-column: 2;
    grid-row: 1 / 5;
    margin-top: 0;
  }

  .account > .account-includes {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }

  .account:has(> .account-section) {
    grid-template-rows: repeat(3, min-content) 1fr;
    grid-template-areas:
      "title access"
      "lede access"
      "daily access"
      "daily signout";
  }

  .account:has(> .account-section) > h1 {
    grid-area: title;
  }

  .account:has(> .account-section) > .account-lede {
    grid-area: lede;
  }

  .account > .account-section[aria-labelledby="access-title"] {
    grid-area: access;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .account > .account-section[aria-labelledby="daily-title"] {
    grid-area: daily;
  }

  .account
    > :is(.account-section[aria-labelledby="daily-title"], .account-signout) {
    margin-top: 14px;
    padding-top: 12px;
  }

  .account > .account-signout {
    grid-area: signout;
  }
}
