/* Payment page: layout only. Colours, type and components come from /design/. */
.pay-top {
  justify-content: space-between;
}
.pay-secure {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.pay-secure svg {
  width: 16px;
  height: 16px;
  fill: var(--ok);
}
.pay {
  display: grid;
  gap: 24px;
  max-width: 640px;
  margin: 0 auto;
  padding: 8px var(--gutter) 72px;
  /* above the wash of colour the page background paints at the top */
  position: relative;
  z-index: 1;
}
.pay [hidden] {
  display: none;
}

.pay-title {
  margin: 0 0 clamp(22px, 3vw, 30px);
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: var(--weight-heading);
  line-height: var(--lead-heading);
  letter-spacing: var(--track-heading);
  text-align: center;
}
/* ----- where the customer is: package, payment, going live ----- */
.pay-steps {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: clamp(10px, 3vh, 26px) 0 clamp(8px, 2vh, 16px);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.pay-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pay-steps li + li::before {
  content: '';
  width: clamp(12px, 4vw, 40px);
  height: 2px;
  margin-right: 4px;
  border-radius: 2px;
  background: var(--line-strong);
}
.pay-steps span,
.pay-block legend span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}
.pay-steps [data-state='done'] span {
  background: var(--ok-tint);
  color: var(--ok-deep);
}
.pay-steps [data-state='now'] {
  color: var(--ink);
}
.pay-steps [data-state='now'] span {
  background: var(--violet);
  color: var(--paper);
}

/* ----- the form ----- */
.pay-main > .form-note:empty {
  display: none;
}
.pay-form {
  gap: 0;
  padding: clamp(20px, 3vw, 34px);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-lift);
}
.pay-block {
  margin-bottom: 30px;
}
.pay-block h2,
.pay-block > label {
  display: block;
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: var(--track-soft);
}
.pay-block .form-hint {
  margin-top: 8px;
}
.pay-account {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}
/* the card fields: a tinted panel of their own */
.pay-cardbox {
  padding: 20px;
  border-radius: var(--radius-s);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.pay-labelrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.pay-stripe {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ok-deep);
  font-size: 13px;
  font-weight: 600;
}
.pay-stripe svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

/* the code: a link that opens one field and a button */
.pay-code {
  margin-bottom: 22px;
}
.pay-code .textlink {
  font-size: 14px;
}
.pay-code label {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}
.pay-coderow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}
.form .pay-coderow .btn {
  margin: 0;
  min-height: 50px;
}
.pay-codeok {
  color: var(--ok-deep);
  font-size: 15px;
  font-weight: 600;
}
.pay-code .form-note:empty {
  min-height: 0;
}
.pay-code .form-note {
  margin-top: 8px;
}

/* what is being bought: name and length on the left, price on the right */
.pay-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-s);
  background: var(--violet-tint);
}
.pay-item p {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.pay-item p b {
  font-size: 17px;
  font-weight: 700;
}
.pay-item small {
  color: var(--ink-soft);
  font-size: 14px;
}
.pay-item-price {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  flex: none;
  white-space: nowrap;
}
.pay-item-price small {
  font-size: 12.5px;
}
.pay-item-price b {
  font-size: 20px;
  font-weight: var(--weight-heading);
  letter-spacing: var(--track-heading);
  white-space: nowrap;
}
.pay-off {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  padding: 0 18px;
  color: var(--ok-deep);
  font-size: 14.5px;
  font-weight: 600;
}
.pay-off[hidden],
.pay-plans[hidden] {
  display: none;
}
/* the package choice: two cards that work as radio buttons */
.pay-plans {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.pay-plan {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-s);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  cursor: pointer;
}
.pay-plan:has(input:checked) {
  background: var(--violet-tint);
  box-shadow: inset 0 0 0 2px var(--violet);
}
.pay-plan:has(input:focus-visible) {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}
.form .pay-plan input {
  flex: none;
  width: 20px;
  min-height: 0;
  height: 20px;
  padding: 0;
  box-shadow: none;
  accent-color: var(--violet);
}
.pay-plan-body {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.pay-plan-body b {
  font-size: 16px;
  font-weight: 700;
}
.pay-plan small {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
}
.pay-plan-price {
  display: grid;
  justify-items: end;
  white-space: nowrap;
}
.pay-plan-price b {
  font-size: 18px;
  font-weight: var(--weight-heading);
}

/* the three card fields: our boxes and labels, Stripe's text inside; expiry and code share a row */
.pay-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px 12px;
}
.pay-wide {
  grid-column: 1 / -1;
}
.pay-label {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}
.pay-field {
  height: 50px;
  padding: 15px 16px;
  border-radius: var(--radius-s);
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.pay-field.StripeElement--focus {
  box-shadow: inset 0 0 0 2px var(--violet);
}
.pay-field.StripeElement--invalid {
  box-shadow: inset 0 0 0 2px var(--no);
}
.pay-change {
  margin: 10px 0 0 18px;
  font-size: 14px;
}
.pay-cta {
  display: grid;
  gap: 12px;
}
.pay-sum {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-weight: 700;
}
.pay-sum b {
  font-size: 22px;
  font-weight: var(--weight-heading);
  letter-spacing: var(--track-heading);
}
.pay-go {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.pay-go svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.form .pay-go {
  justify-self: stretch;
  width: 100%;
  min-height: 58px;
  margin-top: 0;
  font-size: 18px;
}
.pay-form > .form-note {
  margin-top: 10px;
  text-align: center;
}
.pay-form > .form-note:empty {
  min-height: 0;
  margin: 0;
}
/* under the button: two short assurances on one row, then the small print */
.pay-assure {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
}
.pay-assure li {
  display: flex;
  align-items: center;
  gap: 7px;
}
.pay-assure svg {
  width: 14px;
  height: 14px;
  fill: var(--ok);
}
.pay-assure-ok::before {
  content: '';
  width: 9px;
  height: 5px;
  margin: 0 2px 3px;
  border-left: 2px solid var(--ok);
  border-bottom: 2px solid var(--ok);
  transform: rotate(-45deg);
}
.pay-terms {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
}
.pay-terms a {
  color: inherit;
  text-decoration: underline;
}

/* an offer before paying: nothing is drawn while it is empty */
.pay-offer {
  padding: 16px 18px;
  border-radius: var(--radius-s);
  box-shadow: inset 0 0 0 1.5px var(--violet);
  background: var(--violet-tint);
}

/* on a phone: little text, room between the parts, and the button always in reach */
@media (max-width: 640px) {
  .pay-top {
    padding-top: 14px;
    padding-bottom: 10px;
  }
  .pay-steps {
    flex-wrap: nowrap;
    gap: 8px;
    font-size: 13.5px;
    white-space: nowrap;
  }
  .pay-steps li {
    gap: 6px;
  }
  .pay-steps li + li::before {
    width: 18px;
    margin: 0 2px;
  }
  .pay-steps span {
    width: 22px;
    height: 22px;
  }
  .pay {
    padding-top: 4px;
    gap: 20px;
  }
  .pay-steps {
    margin-bottom: 8px;
  }
  .pay-block {
    margin-bottom: 24px;
  }
  .pay-cardbox {
    padding: 16px 14px;
  }
  /* total and button ride at the bottom of the screen while the form is in view */
  .pay-cta {
    position: sticky;
    bottom: 0;
    z-index: 2;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    margin: 0 calc(-1 * clamp(20px, 3vw, 34px));
    padding: 10px clamp(20px, 3vw, 34px) calc(10px + env(safe-area-inset-bottom));
    background: var(--paper);
    box-shadow: 0 -1px 0 var(--line);
  }
  .pay-sum {
    display: grid;
    padding: 0;
    border: 0;
    font-size: 13px;
    color: var(--muted);
  }
  .pay-sum b {
    color: var(--ink);
    font-size: 19px;
  }
  .form .pay-go {
    min-height: 52px;
    font-size: 17px;
  }
}
@media (max-width: 480px) {
  .pay {
    padding-inline: 14px;
  }
  .pay-form {
    padding: 20px 16px;
  }
  .pay-cta {
    margin-inline: -16px;
    padding-inline: 16px;
  }
}
@media (max-width: 400px) {
  .pay-steps {
    gap: 6px;
    font-size: 13px;
  }
  .pay-steps li + li::before {
    width: 10px;
    margin: 0;
  }
}
.pay-account b {
  color: var(--ink);
  font-weight: 700;
}
.pay-renew {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 14px;
  text-align: center;
}
