@font-face {
  font-family: "Roboto";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("fonts/roboto-regular.567f647d447a.woff2") format("woff2");
}

@font-face {
  font-family: "Roboto";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("fonts/roboto-medium.ef4cf493f925.woff2") format("woff2");
}

:root {
  --green: #1cd760;
  --green-hover: #19c156;
  /* The page background is the promo artwork's green, which is not quite the brand green. */
  --green-page: #21db6c;
  --green-dark: #004438;
  --text: rgb(60, 60, 60);
  --text-muted: rgb(110, 110, 110);
  /* The outline of a field, a choice, a box or a secondary button: 3.3:1 on white. */
  --line: rgba(0, 0, 0, 0.45);
  --error: #e00000;

  --title-size: 2.25em;
  --button-size: 1.5em;
  --input-size: 1.5em;
  --panel-width: 80%;
  --field-gap: 30px;
  --button-padding: 20px;
  --contact-gap: 50px;

  --header-height: 110px;
  --logo-width: 200px;
  --heading-gap: 40px;
  --buttons-margin: 60px 0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 100%;
  line-height: normal;
  color: var(--text);
  background-color: var(--green-page);
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
ul,
fieldset,
legend {
  margin: 0;
  padding: 0;
}

fieldset {
  border: 0;
  min-width: 0;
}

button,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--green-dark);
  outline-offset: 2px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.page {
  display: grid;
  grid-template-columns: 5fr 4fr;
  min-height: 100vh;
  min-height: 100dvh;
}

.promo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.promo-content {
  width: 60%;
  text-align: center;
}

.promo-image {
  display: block;
  width: 100%;
  max-width: 400px;
  height: auto;
  margin: 0 auto 48px;
}

/* Every page keeps the room for the sign-in page's button, so the artwork is in the same place on all of them. */
.promo-action {
  height: 3.625rem;
}

.promo-cta {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 15px;
  border-radius: 5px;
  background-color: var(--green-dark);
  color: white;
  font-size: 1.5em;
  font-weight: 500;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.3);
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.promo-cta:hover {
  background-color: var(--green);
  color: var(--green-dark);
}

.card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: calc(100vh - 20px);
  min-height: calc(100dvh - 20px);
  margin: 10px;
  padding: 10px;
  border-radius: 8px;
  background-color: white;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--header-height);
}

.brand-logo svg {
  display: block;
  width: var(--logo-width);
  height: auto;
  fill: var(--green);
}

.card-body {
  align-self: center;
  min-width: 0;
  padding-block: 10px 16px;
}

.panel {
  width: var(--panel-width);
  margin: 0 auto;
}

.panel-heading {
  margin-bottom: var(--heading-gap);
}

.panel-title {
  font-size: var(--title-size);
  font-weight: 500;
  text-align: center;
  overflow-wrap: anywhere;
}

.panel-subtitle {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 1.15em;
  text-align: center;
  overflow-wrap: anywhere;
}

.panel-subtitle strong {
  color: var(--text);
  font-weight: 500;
}

.card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.card-footer-text {
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.8em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 6px;
  list-style: none;
  overflow-wrap: anywhere;
}

.footer-links a {
  display: inline-block;
  padding-block: 6px;
  margin-block: -6px;
}

.social {
  display: flex;
  flex-shrink: 0;
  gap: 10px;
  margin-right: 5px;
  list-style: none;
}

.social a {
  display: flex;
  padding: 3px;
  border-radius: 5px;
  background-color: var(--green);
}

.social svg {
  display: block;
  width: 30px;
  height: 30px;
  padding: 5px;
  fill: var(--green-dark);
}

.form-lead {
  margin-top: 20px;
  text-align: center;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.field {
  margin-top: var(--field-gap);
}

.field-label {
  display: block;
  font-size: 0.9em;
  font-weight: 500;
}

.field-label-code {
  text-align: center;
}

.field-control {
  --underline: var(--line);
  position: relative;
  border-bottom: 1px solid var(--underline);
}

/*
 * The field itself has no outline, so focus is shown here: the underline doubles and turns deep green, which
 * is 11:1 against the page and 3.3:1 against the line it replaces. In a field with an error it doubles and
 * stays red, 5:1 against the page: deep green on that red would be 2.2:1.
 */
.field-control:focus-within {
  --underline: var(--green-dark);
  box-shadow: 0 1px 0 var(--underline);
}

.field-control-error,
.field-control-error:focus-within {
  --underline: var(--error);
}

.field-input {
  display: block;
  width: 100%;
  /* In rem, like the height of the button beside it, so the text in it is not cut off when text is larger. */
  height: 2.625rem;
  padding: 1px 2px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  font-size: var(--input-size);
  appearance: none;
}

.field-input-with-toggle {
  width: calc(100% - 3.5em);
}

.field-input-code {
  /* The spacing also follows the last digit, so as much goes in front of the first to keep the code centered. */
  padding-left: calc(2px + 0.25em);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.25em;
  text-align: center;
}

.field-toggle {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 2.5rem;
  height: 2.625rem;
  padding: 0 4px;
  border: 0;
  background: none;
  cursor: pointer;
}

.form-aside {
  margin: 10px 0 20px;
  font-size: 0.875em;
  text-align: right;
}

.form-aside a:hover,
.link-button:hover {
  text-decoration: underline;
}

.link {
  text-decoration: underline;
}

.icon-new-tab {
  width: 0.8em;
  height: 0.8em;
  margin-left: 0.25em;
  vertical-align: -0.05em;
  fill: currentColor;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.form-error {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Always there, so that an error appearing does not move the button. */
  min-height: 35px;
  padding-top: 15px;
  color: var(--error);
  text-align: center;
}

.form-note {
  margin-top: 15px;
  color: var(--text-muted);
  font-size: 0.9em;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
}

.form-note + .form-note {
  margin-top: 6px;
}

.buttons {
  display: grid;
  gap: 12px;
  margin: var(--buttons-margin);
}

.button {
  display: block;
  width: 100%;
  padding: var(--button-padding) 0;
  border: 0;
  border-radius: 5px;
  background-color: var(--green);
  /* Deep green on the brand green is 5.8:1. White would be 1.9:1. */
  color: var(--green-dark);
  font-size: var(--button-size);
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out, opacity 0.2s ease-in-out;
}

.button:hover {
  background-color: var(--green-hover);
}

.button-secondary {
  background-color: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.button-secondary:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.form[aria-busy="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.choices {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
}

.choice:has(.choice-input:checked) {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.choice-input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--green-dark);
}

.choice-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.choice-title {
  font-size: 1.15em;
  font-weight: 500;
}

.choice-detail {
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.section-title {
  margin-top: 30px;
  font-size: 1em;
  font-weight: 500;
}

.permissions {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  list-style: none;
  font-size: 1.15em;
}

.permissions li {
  position: relative;
  padding-left: 1.9em;
}

.permissions li::before {
  content: "";
  position: absolute;
  top: 0.1em;
  left: 0.35em;
  width: 0.45em;
  height: 0.8em;
  border: solid var(--green);
  border-width: 0 0.18em 0.18em 0;
  transform: rotate(45deg);
}

.scope-choices {
  margin-top: 30px;
}

.scope-choices .section-title {
  margin-top: 0;
}

.scope-choices .choices {
  margin-top: 14px;
}

.account {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  color: var(--text-muted);
  font-size: 0.9em;
  line-height: 1.6;
  text-align: center;
}

.account-email {
  color: var(--text);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.account .link-button {
  display: block;
  margin: 0 auto;
  padding: 8px 12px;
  text-decoration: underline;
}

.account-compact {
  margin-top: 16px;
  padding-top: 12px;
}

.account-compact .link-button {
  display: inline-block;
  margin: -12px 0 -12px 6px;
  padding: 12px 0;
}

.panel:has(> .account-compact) + .contact {
  margin-top: 18px;
}

.terms-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.9em;
}

.terms-text {
  margin-top: 10px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.terms-text p + p {
  margin-top: 0.9em;
}

.page-terms .panel-heading {
  margin-bottom: 0;
}

/*
 * The two gradients are a shadow along the bottom edge that the end of the text scrolls over and hides, so it shows
 * only while there is more to read.
 */
.terms-text-scrolls {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background:
    linear-gradient(rgba(255, 255, 255, 0), white 70%) bottom / 100% 28px no-repeat local,
    linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.12)) bottom / 100% 12px no-repeat scroll;
}

/* Inside the box, where the panel around it can't cut the ring off. */
.terms-text-scrolls:focus-visible {
  outline-offset: -2px;
  border-radius: 5px;
}

/*
 * The box takes the height the window has left, up to the height of its text. It counts as its least height when the
 * card is sized, so the page scrolls only when the window is too short for the rest of the page and that.
 */
.page-terms .card-body,
.page-terms .panel {
  display: flex;
  flex-direction: column;
}

.page-terms .card-body {
  align-self: stretch;
}

.page-terms .panel {
  flex: 1 1 auto;
}

.page-terms .panel > * {
  flex-shrink: 0;
}

.page-terms .panel > :first-child {
  margin-top: auto;
}

.page-terms .panel > :last-child {
  margin-bottom: auto;
}

.page-terms .terms-text-scrolls {
  flex: 1 1 0;
  min-height: 130px;
  max-height: max-content;
}

.page-document {
  grid-template-columns: 1fr;
}

.page-document .panel {
  max-width: 760px;
}

.page-document .terms-text {
  margin: 28px 0 24px;
}

.contact {
  margin-top: 24px;
  font-size: 1.1em;
  text-align: center;
}

.contact-request-account {
  font-weight: 500;
}

.contact-request-account:hover {
  text-decoration: underline;
}

.contact-request-account + .contact-phone {
  margin-top: var(--contact-gap);
}

.contact-phone {
  color: var(--text-muted);
}

.contact-phone a {
  text-decoration: underline;
}

/* Small text links get a taller area to press than their text, without moving anything around them. */
.form-aside a,
.form-aside .link-button,
.contact a {
  display: inline-block;
  padding-block: 12px;
  margin-block: -12px;
}

/* Two columns need height as well as width: at their text sizes the sign-in page is 716px tall. */
@media (max-width: 950px), (max-height: 719px) {
  :root {
    --title-size: 1.9em;
    --button-size: 1.275em;
    --input-size: 1.275em;
  }

  body {
    background-color: white;
  }

  .page {
    grid-template-columns: 1fr;
  }

  .promo {
    display: none;
  }
}

@media (max-width: 480px) {
  /* Text people type stays at 16px or more, or iOS zooms the page when the field is focused. */
  :root {
    --title-size: 1.7em;
    --button-size: 1.125em;
    --input-size: 1.125em;
    --panel-width: 95%;
  }
}

@media (max-width: 400px) {
  :root {
    --title-size: 1.4em;
    --field-gap: 20px;
    --button-padding: 15px;
    --contact-gap: 20px;
  }

  .form-aside {
    margin-bottom: 10px;
  }

  .contact-phone {
    font-size: 0.9em;
  }
}

@media (max-height: 900px) {
  :root {
    --header-height: 90px;
    --logo-width: 150px;
    --heading-gap: 0px;
    --buttons-margin: 30px 0;
  }
}

@media (max-height: 799px) {
  :root {
    --header-height: 60px;
    --buttons-margin: 20px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
