/* ==========================================================================
   SIGN-UP CARDS (.signup)

   Used by the Community page (Website 2.0, node 73:14649) and the Pricing
   page. A pale frame holds white boxes: on Community, a list of two
   audience cards; on both, an article with a heading, a paragraph and a
   sign-up form. The form is a frame of its own around a white fieldset.

   There is no tablet or mobile frame in Figma, so the narrower layouts are
   our own: the cards drop to one column below 700px, and the form moves
   under the article's words below 901px.

   Horizontal bound: the same 1230px content zone as the header and footer.
   ========================================================================== */

.signup {
  padding-inline: max(var(--grid-margin), calc((100% - 1230px) / 2));
}

/* The frame, and the white boxes inside it */
.signup > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--color-border-disabled);
  border-radius: 20px;
}

.signup > div > :is(ul, article) {
  border: 1px solid var(--color-border-neutral);
  border-radius: 16px;
  background: var(--color-background-white, #fff);
}

/* Headings: small, in the label gradient */
.signup h2 {
  width: fit-content;
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.64px;
  background: var(--gradient-label);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* The words: a large serif */
.signup li > p,
.signup article > p {
  margin: 0;
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: 20px;
  line-height: 26px;
  letter-spacing: -0.8px;
  color: var(--color-text-regular);
}

/* --------------------------------------------------------------------------
   The audience cards
   -------------------------------------------------------------------------- */

.signup ul {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
}

.signup li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
}

.signup li + li {
  border-top: 1px solid var(--color-border-neutral);
}

/* --------------------------------------------------------------------------
   The article: its heading (with a tag over it on Community), its words,
   and the form
   -------------------------------------------------------------------------- */

.signup article {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.signup article > :is(hgroup, h2) {
  margin: 24px 24px 0;
}

.signup hgroup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
}

/* The "Coming soon" tag */
.signup hgroup > p {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0 6px;
  border: 1px solid #DBC7C6;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12px;
  line-height: 20px;
  letter-spacing: -0.48px;
  /* The tag keeps its own background, so the gradient is clipped to an
     inner layer: the text paints the gradient, the box paints the fill. */
  background-image: linear-gradient(to left, #666550 0%, #6C66C5 100%), linear-gradient(var(--color-surface-regular), var(--color-surface-regular));
  -webkit-background-clip: text, padding-box;
  background-clip: text, padding-box;
  color: transparent;
}

.signup article > p {
  padding: 24px;
}

/* --------------------------------------------------------------------------
   The form: a frame round a white fieldset of labelled fields, then the
   button, the status line (signup-form.js) and a privacy note
   -------------------------------------------------------------------------- */

.signup form {
  margin: 0 8px 8px;
  padding: 6px;
  border: 1px solid var(--color-border-disabled);
  border-radius: 20px;
}

.signup fieldset {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-inline-size: 0;
  margin: 0;
  padding: 24px 16px;
  border: 1px solid var(--color-border-neutral);
  border-radius: 16px;
  background: var(--color-background-white, #fff);
}

.signup label,
.signup fieldset > p:last-child {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  line-height: 22px;
  letter-spacing: -0.56px;
  color: var(--color-text-light);
}

.signup label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.signup input:not([type="checkbox"]) {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 15px 16px;
  border: 1px solid var(--color-border-regular);
  border-radius: 12px;
  background: var(--color-surface-regular);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.32px;
  color: var(--color-text-strong);
}

.signup input::placeholder {
  color: var(--color-text-light);
  opacity: 1;
}

.signup input:not([type="checkbox"]):focus-visible {
  outline: 2px solid #6C66C5;
  outline-offset: 1px;
}

/* The news opt-in: a checkbox before its words */
.signup label:has(> [type="checkbox"]) {
  flex-direction: row;
  align-items: center;
  cursor: pointer;
}

.signup [type="checkbox"] {
  appearance: none;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1px solid var(--color-border-regular);
  border-radius: 6px;
  background: var(--color-btn-regular);
  cursor: pointer;
}

.signup [type="checkbox"]:checked {
  border-color: var(--color-btn-strong);
  background: var(--color-btn-strong) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3L15 7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
}

.signup [type="checkbox"]:focus-visible {
  outline: 2px solid #6C66C5;
  outline-offset: 2px;
}

/* The button, status and note, centred under the fields */
.signup fieldset > .button {
  align-self: center;
  margin-top: 16px;
}

.signup fieldset > p {
  align-self: center;
  margin: 16px 0 0;
  text-align: center;
}

.signup [role="status"] {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  line-height: 22px;
  letter-spacing: -0.56px;
  color: var(--color-text-regular);
}

.signup [role="status"][data-kind="error"] {
  color: #B42318;
}

.signup fieldset > p:last-child a {
  color: var(--color-text-regular);
  text-decoration: none;
}

.signup fieldset > p:last-child a:hover,
.signup fieldset > p:last-child a:focus-visible {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Tablet and up
   -------------------------------------------------------------------------- */

@media (min-width: 700px) {
  .signup ul {
    grid-template-columns: 1fr 1fr;
  }

  .signup li {
    padding: 32px 40px;
  }

  .signup li + li {
    border-top: 0;
    border-left: 1px solid var(--color-border-neutral);
  }

  .signup article > :is(hgroup, h2) {
    margin: 32px 40px 0;
  }

  .signup article > p {
    padding: 24px 40px 32px;
  }

  .signup form {
    margin: 0 16px 16px;
  }

  .signup fieldset {
    padding: 24px 32px;
  }

  .signup li > p,
  .signup article > p {
    font-size: 24px;
    line-height: 28px;
    letter-spacing: -0.96px;
  }
}

/* --------------------------------------------------------------------------
   Desktop: the article's words on the left, the form on the right
   -------------------------------------------------------------------------- */

@media (min-width: 901px) {
  .signup article {
    display: grid;
    grid-template-columns: 50% minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }

  .signup article > :is(hgroup, h2) {
    grid-column: 1;
    margin: 32px 96px 0 40px;
  }

  .signup article > p {
    grid-column: 1;
    align-self: end;
    padding: 24px 96px 40px 40px;
  }

  .signup form {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    margin: 16px;
  }

  .signup li {
    padding-right: 96px;
  }

  .signup fieldset {
    padding: 24px 32px 32px;
  }

  .signup fieldset > p:last-child {
    margin-bottom: 24px;
  }

  .signup fieldset > .button {
    font-size: 18px;
    line-height: 28px;
    letter-spacing: -0.64px;
  }
}

/* The bot trap on the interest forms. It sits off the screen rather than
   being hidden, because some bots skip fields that are hidden. */
label:has(> [data-trap]) {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
