/*
 * Sign-in and invitations (/login, /invite). Loaded after portal.css and theme.css, on this page only.
 *
 * One frosted panel covers the room, like the console's page. In it: the brown tile with the promise
 * (the one brown band of the page, the voice mark in light) beside a clean white card with the form.
 * On a phone the tile shrinks to the words and the form follows on the first screen.
 */

.gate {
  --gate-m: clamp(0.75rem, 2vw, 1.5rem);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 0.9rem;
  inline-size: min(100% - 2 * var(--gate-m), 78rem);
  min-block-size: calc(100dvh - 2 * var(--gate-m));
  margin: var(--gate-m) auto;
  padding: 0.9rem;
  border: 1px solid rgb(255 255 255 / 0.7);
  border-radius: 40px;
  background: var(--panel);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.85),
    0 40px 70px -40px rgb(50 38 26 / 0.55);
}

/* ---------- the brown tile ---------- */
.gate__side {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.5rem, 3.5vw, 3rem);
  border-radius: 30px;
  background: linear-gradient(170deg, color-mix(in srgb, var(--accent) 84%, #fff) 0%, var(--accent) 48%, var(--accent-deep) 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.3),
    0 26px 44px -26px var(--accent-deep);
  overflow: hidden;
}

.gate__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: rgb(255 255 255 / 0.92);
  font-size: 0.95rem;
  font-weight: 600;
}

.gate__mark {
  display: grid;
  place-items: center;
  inline-size: 2.6rem;
  block-size: 2.6rem;
  border: 1px solid rgb(255 255 255 / 0.25);
  border-radius: 50%;
  background: rgb(255 255 255 / 0.14);
  color: #fff;
}

.gate__mark .wave {
  block-size: 1.1rem;
  gap: 2.5px;
}

.gate__mark .wave i {
  inline-size: 2.5px;
}

/* the voice: drawn once by login.js, rises in and stays still */
.gate__voice {
  gap: clamp(3px, 0.45vw, 5px);
  block-size: clamp(3.5rem, 7vw, 5.5rem);
  max-inline-size: 30rem;
  color: rgb(243 231 216 / 0.8);
}

.gate__voice i {
  max-inline-size: 5px;
}

/* portal.css styles every paragraph of the side as small text, hence the longer selector */
.gate__side .gate__title {
  max-inline-size: 13ch;
  margin: 0;
  color: #fff;
  font-size: clamp(2.3rem, 1.5rem + 2.4vw, 3.7rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.gate__side .gate__title em {
  font-style: normal;
  color: rgb(255 255 255 / 0.62);
}

.gate__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
}

.gate__chips li {
  padding: 0.45rem 0.95rem;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.13);
  font-size: 0.95rem;
  font-weight: 500;
}

/* ---------- the form card ---------- */
.gate__form {
  display: grid;
  align-content: center;
  max-inline-size: none;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border: 1px solid rgb(255 255 255 / 0.85);
  border-radius: 30px;
  background: rgb(255 255 255 / 0.74);
  box-shadow: var(--lift);
}

.gate__form > * {
  justify-self: center;
  inline-size: min(100%, 24rem);
}

.gate__form .stack {
  gap: 1.15rem;
}

.gate__form h1 {
  font-size: 2.4rem;
  letter-spacing: -0.03em;
}

.gate__form .field > span {
  color: var(--ink-2);
  font-size: 0.9rem;
}

.gate__form input {
  min-block-size: 3.25rem;
  border-color: rgb(30 27 24 / 0.13);
  background-color: #fff;
}

.gate__form input:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.gate__form input[readonly] {
  background-color: rgb(30 27 24 / 0.05);
  color: var(--ink-2);
}

.gate__form .btn--primary {
  inline-size: 100%;
  min-block-size: 3.4rem;
  margin-block-start: 0.35rem;
  font-size: 1.05rem;
}

/* a field label written as <label for> (the password row holds a button too) */
.gate__form .field > label {
  color: var(--ink-2);
  font-size: 0.9rem;
  font-weight: 600;
}

/* the password and its eye button, in one pill */
.pw {
  position: relative;
}

/* the password reads left to right inside a right-to-left page: the button sits on the left, so the room
   for it is set on the left, not with logical sides (they would point opposite ways here) */
.gate__form .pw input {
  padding-left: 3.4rem;
}

.pw__eye {
  position: absolute;
  inset-block: 0;
  left: 0.3rem;
  display: grid;
  place-items: center;
  inline-size: 2.9rem;
  margin-block: auto;
  block-size: 2.9rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  -webkit-tap-highlight-color: transparent;
}

.pw__eye:hover,
.pw__eye[aria-pressed='true'] {
  background: rgb(30 27 24 / 0.06);
  color: var(--ink);
}

.pw__eye .icon {
  inline-size: 1.3rem;
  block-size: 1.3rem;
}

.gate__note {
  color: var(--ink-3);
  font-size: 0.875rem;
  text-align: center;
}

/* the "link expired" answer keeps its button to its own size */
.gate__form .stack > div > a.btn {
  inline-size: auto;
}

/* ---------- phones: just the form ----------
 * A slim brown bar with the brand, then one white card with the form at the top of the screen, so the
 * fields and the button stay above the keyboard. Big fields and button; the words stay on the computer.
 */
@media (max-width: 860px) {
  .gate {
    --gate-m: 0.6rem;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 0.6rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .gate__side {
    flex-direction: row;
    align-items: center;
    padding: 0.55rem 1rem 0.55rem 0.55rem;
    padding-inline: 0.55rem 1rem;
    border-radius: 999px;
  }

  .gate__voice,
  .gate__words {
    display: none;
  }

  .gate__mark {
    inline-size: 2.4rem;
    block-size: 2.4rem;
  }

  .gate__form {
    align-content: start;
    padding: 1.6rem 1.25rem 1.75rem;
    border-radius: 28px;
  }

  .gate__form .stack {
    gap: 1rem;
  }

  .gate__form h1 {
    font-size: 1.9rem;
  }

  .gate__form .field > span,
  .gate__form .field > label {
    font-size: 1rem;
  }

  .gate__form input {
    min-block-size: 3.6rem;
    font-size: 1.0625rem;
  }

  .gate__form .btn--primary {
    min-block-size: 3.7rem;
    font-size: 1.125rem;
  }

  .gate__note {
    font-size: 0.9rem;
  }
}
