/* Log-in and create-account pages. Loads after pandly.css, which provides the fonts and colours. */

.auth-page {
  /* vertical spacing that shrinks on shorter screens, so the whole page fits in the window */
  --page-pad-y: clamp(0.75rem, 3.5vh, 5rem);
  --panel-pad-y: clamp(1.25rem, 4vh, 3.25rem);
  --top-gap: clamp(0.25rem, 1.2vh, 1rem);
  --field-h: clamp(2.9rem, 6.6vh, 3.5rem);
  --field-gap: clamp(0.6rem, 2vh, 1.5rem);
  --title-size: clamp(2.2rem, 5.6vh, 3.1rem);
  --title-gap: clamp(1rem, 3.2vh, 2.4rem);
  --button-gap: clamp(1rem, 2.6vh, 2.1rem);
  --text-gap: clamp(0.6rem, 1.7vh, 1.25rem);
  --note-gap: clamp(0.4rem, 1.4vh, 1rem);
  /* soft, out-of-focus backdrop behind the card */
  background-color: #e8e5e3;
  background-image:
    radial-gradient(48% 34% at 50% 0%, #9d6f5ed9, #9d6f5e00 72%),
    radial-gradient(42% 52% at 100% 62%, #8b8789cc, #8b878900 70%),
    radial-gradient(46% 42% at 16% 100%, #b6a396cc, #b6a39600 70%),
    radial-gradient(40% 46% at 0% 30%, #ffffffe6, #fff0 70%);
  background-attachment: fixed;
  place-items: center;
  min-height: 100vh;
  padding: var(--page-pad-y) clamp(1rem, 5.6vw, 5rem);
  display: grid;
}

.auth-card {
  background-color: #231f1e;
  border-radius: 3.5rem;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 84rem;
  min-height: min(56rem, 100vh - 2 * var(--page-pad-y));
  display: grid;
  /* nothing is clipped here, so the legal menu can open below the card; the brand panel rounds its own corners */
  box-shadow:
    0 2.5rem 5rem #00000040,
    0 0.5rem 1.5rem #00000026;
}

/* ---------- left: brand panel ---------- */

.auth-brand {
  color: #fff;
  text-align: center;
  flex-flow: column;
  align-items: center;
  border-radius: 3.5rem 0 0 3.5rem;
  padding: calc(var(--panel-pad-y) + var(--top-gap) + 0.4rem) 2rem 0;
  display: flex;
  position: relative;
  overflow: hidden;
  /* lets the hand scale with the panel's width (cqw) */
  container-type: inline-size;
}

.auth-brand-tagline {
  color: #ffffffc7;
  margin-bottom: var(--text-gap);
  font-size: 0.95rem;
}

.auth-brand-title {
  z-index: 1;
  letter-spacing: -0.045em;
  margin: auto 0 clamp(1.75rem, 5vh, 3.5rem);
  font-size: clamp(2.6rem, min(5.2vw, 9.5vh), 4.6rem);
  font-weight: 500;
  line-height: 1;
  position: relative;
}

/* the two fine rings behind the title */
.auth-brand-title:before,
.auth-brand-title:after {
  content: "";
  aspect-ratio: 1;
  pointer-events: none;
  border: 1px solid #ffffff14;
  border-radius: 50%;
  width: 4.2em;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.auth-brand-title:after {
  width: 2.85em;
}

/* The hand stands on the bottom edge of the card, which cuts it off at the wrist. */
.auth-phone {
  z-index: 2;
  flex: none;
  position: relative;
}

.auth-hand {
  width: auto;
  max-width: none;
  height: min(72cqw, 46vh);
  display: block;
  /* the phone sits a little left of the title, as the hand comes in from the corner */
  transform: translateX(-20%);
}

/* ---------- right: form panel ---------- */

.auth-panel {
  background-color: #fff;
  border-radius: 3.5rem;
  /* equal rows above and below the form, and equal padding, keep the form on the card's centre line */
  grid-template-rows: 1fr auto 1fr;
  padding: var(--panel-pad-y) 4.25rem;
  display: grid;
}

.auth-top,
.auth-bottom {
  justify-content: space-between;
  align-items: center;
  display: flex;
}

.auth-top {
  align-self: start;
  margin-top: var(--top-gap);
}

.auth-logo {
  grid-column-gap: 0.6rem;
  color: #141414;
  letter-spacing: -0.03em;
  align-items: center;
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  display: flex;
}

.auth-logo img {
  width: 2.2rem;
}

.auth-link {
  grid-column-gap: 0.55rem;
  color: #3a3f4a;
  align-items: center;
  font-size: 0.975rem;
  text-decoration: none;
  display: flex;
}

.auth-link:hover {
  color: #141414;
}

.auth-link svg {
  width: 1.35rem;
  height: 1.35rem;
}

.auth-form {
  flex-flow: column;
  width: 100%;
  max-width: 27.5rem;
  margin: 0 auto;
  /* 2.5rem above the title = the room the status line keeps free below the last link (1rem + 1.4rem) + 0.1rem */
  padding: calc(var(--note-gap) + 1.5rem) 0 0.1rem;
  display: flex;
}

.auth-title {
  color: #1a2130;
  letter-spacing: -0.035em;
  margin: 0 0 var(--title-gap);
  font-size: var(--title-size);
  font-weight: 400;
  line-height: 1.1;
}

/* a short explanation under the title (forgot / new password) */
.auth-intro {
  color: #5c6270;
  margin: calc(1rem - var(--title-gap)) 0 var(--title-gap);
  font-size: 1rem;
  line-height: 1.5;
}

/* The pill is drawn by .auth-field; the input inside it is only 40px high. Password managers such as Bitwarden size
   and place their icon as if a field is at most 40px high, so this keeps their icon in the middle of the pill. */
.auth-field {
  background-color: #fff;
  border: 1px solid #dadbe0;
  border-radius: 10rem;
  align-items: center;
  height: var(--field-h);
  margin-bottom: var(--field-gap);
  /* room on the right, so a password manager's icon lines up with the eye icon of the password field */
  padding-right: 1.1rem;
  display: flex;
  position: relative;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}

.auth-input {
  color: #1a2130;
  font-family: inherit;
  font-size: 1rem;
  background-color: #0000;
  border: 0;
  outline: 0;
  width: 100%;
  height: 2.5rem;
  padding: 0 1.9rem;
}

.auth-input::placeholder {
  color: #5c6270;
}

/* the browser's own autofill colour would show as a band inside the pill */
.auth-input:-webkit-autofill {
  -webkit-text-fill-color: #1a2130;
  box-shadow: 0 0 0 2.5rem #fff inset;
}

/* Sign-up only: auth.js adds .is-valid once the field has been checked (same green as the contact form). */
.auth-field:has(.auth-input.is-valid) {
  border-color: #4ade80;
  box-shadow:
    0 0 0 1px #4ade8066,
    0 0 1.1rem #22c55e47;
}

/* first name and last name side by side; under each other on phones */
.auth-field-row {
  grid-column-gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
  display: grid;
}

.auth-field.has-toggle .auth-input {
  padding-right: 2.9rem;
}

.auth-toggle {
  color: #5c6270;
  cursor: pointer;
  background-color: #0000;
  border: 0;
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  display: flex;
  position: absolute;
  top: 50%;
  right: 1.1rem;
  transform: translateY(-50%);
}

.auth-toggle svg {
  width: 1.35rem;
  height: 1.35rem;
}

/* the slash through the eye shows while the password is hidden */
.auth-toggle[aria-pressed="true"] .auth-toggle-slash {
  display: none;
}

/* small and quiet, tucked under the password field in line with its eye icon */
.auth-forgot {
  color: #6b7080;
  align-self: flex-end;
  margin: calc(0.65rem - var(--field-gap)) 1.7rem 0 0;
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-forgot:hover {
  color: #141414;
}

.auth-submit {
  grid-column-gap: 0.6rem;
  color: #fff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  /* same as the site's buttons: black, inside a ring of the hologram gradient */
  background-image:
    linear-gradient(#000, #000),
    linear-gradient(
      270deg,
      var(--_color---hologram--0),
      var(--_color---hologram--25) 25%,
      var(--_color---hologram--50) 50%,
      var(--_color---hologram--75) 75%,
      var(--_color---hologram--100)
    );
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border: 2px solid #0000;
  border-radius: 10rem;
  justify-content: center;
  align-items: center;
  height: var(--field-h);
  margin-top: var(--button-gap);
  transition:
    box-shadow 0.2s,
    transform 0.2s;
  display: flex;
  box-shadow: 0 0.6rem 1.4rem #839aff38;
}

.auth-submit:hover {
  box-shadow: 0 0.6rem 1.6rem #839aff66;
}

.auth-submit:active {
  transform: scale(0.99);
}

.auth-submit svg {
  width: 1.35rem;
  height: 1.35rem;
}

.auth-switch {
  color: #6b7080;
  text-align: center;
  margin: var(--text-gap) 0 0;
  font-size: 0.9rem;
}

/* sign-up, once sent: the form makes way for a check and the request to confirm the e-mail address */
.auth-form[hidden],
.auth-done[hidden] {
  display: none;
}

.auth-done {
  text-align: center;
  flex-flow: column;
  align-items: center;
  width: 100%;
  max-width: 27.5rem;
  margin: 0 auto;
  display: flex;
}

.auth-done-check {
  width: 5rem;
  height: 5rem;
  margin: 0 0 1.75rem;
}

.auth-done-title {
  color: #1a2130;
  letter-spacing: -0.035em;
  outline: 0;
  margin: 0 0 1rem;
  font-size: var(--title-size);
  font-weight: 400;
  line-height: 1.1;
}

.auth-done-text {
  color: #3a3f4a;
  overflow-wrap: anywhere;
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  line-height: 1.55;
}

.auth-done-text strong {
  color: #1a2130;
  font-weight: 500;
}

.auth-done-hint {
  color: #6b7080;
  margin: 0 0 1.75rem;
  font-size: 0.9rem;
}

.auth-done-back {
  color: #1a2130;
  font: inherit;
  cursor: pointer;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: underline;
}

/* sign-up: accepting the terms; the button stays off until it's ticked (auth.js) */
.auth-consent {
  grid-column-gap: 0.75rem;
  color: #5c6270;
  cursor: pointer;
  align-items: flex-start;
  margin: 0.25rem 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.45;
  display: flex;
}

.auth-consent a {
  color: #1a2130;
  text-decoration: underline;
}

.auth-consent-input {
  appearance: none;
  cursor: pointer;
  background-color: #fff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 0.75rem;
  border: 1px solid #c4c7cf;
  border-radius: 0.35rem;
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.05rem 0 0;
  transition:
    background-color 0.2s,
    border-color 0.2s;
}

.auth-consent-input:checked {
  background-color: #141414;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6l4.5-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  border-color: #141414;
}

.auth-consent-input:focus-visible {
  outline: 2px solid #839aff;
  outline-offset: 2px;
}

.auth-consent + .auth-submit {
  margin-top: calc(var(--button-gap) * 0.75);
}

.auth-switch a {
  color: #141414;
  font-weight: 500;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* sign-up, not everything filled in and ticked yet: clearly off */
.auth-submit:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

/* while a form is being sent */
.auth-submit[aria-busy="true"] {
  cursor: progress;
  opacity: 0.7;
}

.auth-note {
  color: #5c6270;
  text-align: center;
  min-height: 1.4rem;
  margin: var(--note-gap) 0 0;
  font-size: 0.9rem;
}

.auth-note.is-error {
  color: #c2410c;
}

.auth-note.is-success {
  color: #15803d;
}

/* a way on from the message (to the log-in, when the address already has an account) */
.auth-note a {
  color: #141414;
  font-weight: 500;
  white-space: nowrap;
}

.auth-bottom {
  grid-column-gap: 1.5rem;
  color: #6b7080;
  white-space: nowrap;
  align-self: end;
  font-size: 0.8rem;
}

.auth-bottom-links {
  grid-column-gap: 1.5rem;
  grid-row-gap: 0.4rem;
  color: #1a2130;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  font-size: 0.85rem;
  display: flex;
}

.auth-bottom-links a {
  color: inherit;
  text-decoration: none;
}

.auth-bottom-links a:hover {
  text-decoration: underline;
}

/* Here the legal menu opens downwards like the language choice next to it, and like that one it opens upwards
   when there's no room below (legal-menu.js adds .opens-up) */
.auth-bottom .legal-menu:not(.opens-up) .legal-menu-list {
  top: calc(100% + 0.6rem);
  bottom: auto;
}

.auth-bottom .legal-menu-arrow {
  transform: rotate(180deg);
}

.auth-bottom .legal-menu[open] .legal-menu-arrow {
  transform: none;
}

.auth-bottom .legal-menu.opens-up[open] .legal-menu-arrow {
  transform: rotate(180deg);
}

/* EN / NL / FR: a plain select, with the arrow drawn on top of it */
.auth-language {
  cursor: pointer;
  /* undo the site's general label style (bold, 5px below), so it lines up with the links next to it */
  font-weight: inherit;
  margin-bottom: 0;
  align-items: center;
  display: flex;
  position: relative;
}

.auth-language-name {
  clip: rect(0 0 0 0);
  white-space: nowrap;
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
}

.auth-language-select {
  color: inherit;
  font: inherit;
  cursor: pointer;
  appearance: none;
  background: none;
  border: 0;
  border-radius: 0.4rem;
  padding: 0.15rem 1.2rem 0.15rem 0.2rem;
}

.auth-language-select:focus-visible {
  outline: 2px solid #839aff;
  outline-offset: 2px;
}

.auth-language svg {
  pointer-events: none;
  width: 0.85rem;
  height: 0.85rem;
  position: absolute;
  right: 0.1rem;
}

/* the page fits in the window, so it doesn't scroll (a very short window still can, so nothing becomes unreachable) */
@media screen and (min-width: 992px) and (min-height: 600px) {
  html:has(.auth-page) {
    overflow: hidden;
  }
}

@media screen and (max-width: 991px) {
  .auth-card {
    grid-template-columns: 1fr;
    max-width: 34rem;
  }

  .auth-brand {
    display: none;
  }

  .auth-panel {
    padding: var(--panel-pad-y) 2rem;
  }

  .auth-top {
    margin-top: 0.5rem;
  }
}

@media screen and (max-width: 479px) {
  .auth-field-row {
    grid-template-columns: 1fr;
  }

  .auth-page {
    padding: 0.75rem;
  }

  .auth-card,
  .auth-panel {
    border-radius: 2.25rem;
  }

  .auth-panel {
    padding: var(--panel-pad-y) 1.5rem;
  }

  .auth-title {
    font-size: min(var(--title-size), 2.5rem);
  }

  .auth-bottom {
    grid-row-gap: 0.75rem;
    flex-flow: column;
  }

  .auth-bottom-links {
    grid-row-gap: 0.5rem;
    grid-column-gap: 1.25rem;
    white-space: nowrap;
    flex-wrap: wrap;
    justify-content: center;
  }
}
