/* The door to an account, and the plain pages beside it (privacy, what the
   site is). The same room as Aurora inside, in the look the visitor chose
   there: one soft light, a sheet of glass, one solid button. These pages load
   only this file and the fonts, so the few tokens they need are repeated
   here: the dark look first, then the light one (which is what a newcomer
   meets: the page's first script sets `data-appearance`). */

:root {
  --ground: #050609;
  --ink: #f5f6fa;
  --ink-2: #b9bdca;
  --ink-3: #868b9b;
  --on-ink: #0b0c12;
  --rim: rgba(255, 255, 255, 0.14);
  --rim-soft: rgba(255, 255, 255, 0.08);
  --card: linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 38%), rgba(18, 20, 28, 0.62);
  --card-solid: #15161e;
  --card-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9);
  --field: rgba(255, 255, 255, 0.06);
  --field-hover: rgba(255, 255, 255, 0.08);
  --field-focus: rgba(255, 255, 255, 0.09);
  --field-ring: inset 0 0 0 1px rgba(255, 255, 255, 0.5), 0 0 0 4px rgba(255, 255, 255, 0.1);
  --button-hover: #e3e5ec;
  --button-shadow: 0 14px 30px -16px rgba(255, 255, 255, 0.55), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
  --underline: rgba(255, 255, 255, 0.28);
  --danger: #ff9d8f;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

html[data-appearance='light'] {
  --ground: #eef0f6;
  --ink: #0b0c12;
  --ink-2: #454a59;
  --ink-3: #666b7b;
  --on-ink: #ffffff;
  --rim: rgba(255, 255, 255, 0.95);
  --rim-soft: rgba(20, 24, 40, 0.09);
  --card: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.5) 62%), rgba(255, 255, 255, 0.46);
  --card-solid: #ffffff;
  --card-shadow: 0 40px 80px -46px rgba(34, 44, 86, 0.5);
  --field: rgba(20, 24, 40, 0.05);
  --field-hover: rgba(20, 24, 40, 0.07);
  --field-focus: #ffffff;
  --field-ring: inset 0 0 0 1px rgba(20, 24, 40, 0.55), 0 0 0 4px rgba(20, 24, 40, 0.08);
  --button-hover: #262833;
  --button-shadow: 0 14px 30px -18px rgba(20, 24, 40, 0.6);
  --underline: rgba(20, 24, 40, 0.3);
  --danger: #b3261e;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ground);
}

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.5 'Geist', system-ui, sans-serif;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
}

/* the light: two quiet fields of the lobby's colour, and dark edges */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 80% at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.55)),
    radial-gradient(54% 62% at 22% 18%, rgba(105, 135, 181, 0.26), rgba(105, 135, 181, 0.185) 18%, rgba(105, 135, 181, 0.1) 38%, rgba(105, 135, 181, 0.036) 58%, transparent 78%),
    radial-gradient(46% 56% at 82% 84%, rgba(112, 122, 176, 0.17), rgba(112, 122, 176, 0.12) 18%, rgba(112, 122, 176, 0.065) 38%, rgba(112, 122, 176, 0.024) 58%, transparent 78%);
}

/* on a light ground the same two fields are pale washes, and nothing darkens the edges */
html[data-appearance='light'] body::before {
  background:
    radial-gradient(54% 62% at 22% 18%, rgba(160, 184, 236, 0.72), rgba(160, 184, 236, 0.3) 40%, transparent 78%),
    radial-gradient(46% 56% at 82% 84%, rgba(230, 180, 222, 0.5), rgba(230, 180, 222, 0.2) 40%, transparent 78%);
}

/* The living backdrop of the site (js/backdrop.js), where a page asks for it: the sign-in page does, so the door
   stands in the same light as the rooms behind it. The still fields above are what is seen without it. */
#backdrop,
.backdrop-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.backdrop-grain {
  background-size: 160px;
  mix-blend-mode: soft-light;
  opacity: 0.19;
}

html[data-appearance='light'] .backdrop-grain {
  opacity: 0.13;
}

html[data-backdrop-on='true']:not([data-backdrop-engine='css']) body::before,
html[data-backdrop-engine='css'] :is(#backdrop, .backdrop-grain) {
  display: none;
}

@media (forced-colors: active) {
  #backdrop,
  .backdrop-grain {
    display: none;
  }
}

.entry {
  position: relative;
  width: min(420px, 100%);
  display: grid;
  gap: 28px;
}

.wordmark {
  justify-self: start;
  padding: 4px 2px;
  color: var(--ink-2);
  font: 500 21px/1 'Geist', sans-serif;
  letter-spacing: -0.04em;
  text-decoration: none;
  border-radius: 8px;
}

.wordmark b {
  color: var(--ink);
  font-weight: 700;
}

.entry-card {
  padding: 34px 32px 28px;
  border-radius: 28px;
  background: var(--card);
  -webkit-backdrop-filter: blur(28px) saturate(1.35);
  backdrop-filter: blur(28px) saturate(1.35);
  box-shadow: inset 0 1px 0 var(--rim), inset 0 0 0 1px var(--rim-soft), var(--card-shadow);
}

h1 {
  margin: 0 0 8px;
  font: 600 clamp(28px, 7vw, 34px) / 1.08 'Geist', sans-serif;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.intro {
  margin: 0 0 28px;
  color: var(--ink-2);
  font-size: 15px;
  text-wrap: pretty;
}

form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
}

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

input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  background: var(--field);
  box-shadow: inset 0 0 0 1px var(--rim-soft);
  font-size: 16px;
  transition: background-color 0.18s, box-shadow 0.18s;
}

input:hover {
  background: var(--field-hover);
}

input:focus-visible {
  outline: 0;
  background: var(--field-focus);
  box-shadow: var(--field-ring);
}

/* the one solid thing on the page */
button {
  height: 52px;
  margin-top: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: var(--button-shadow);
  transition: background-color 0.18s, transform 0.18s var(--ease);
}

button:hover {
  background: var(--button-hover);
}

button:active {
  transform: scale(0.985);
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

button:focus-visible,
select:focus-visible,
.wordmark:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.help {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
  text-wrap: pretty;
}

#invite-note {
  margin-top: 18px;
}

/* the quiet ways on: to the other form, or in as a guest */
.link {
  display: block;
  height: auto;
  /* 2px above and below: a 24px target on a phone, the same gaps between the lines */
  margin: 16px 0 0;
  padding: 2px 0;
  border-radius: 6px;
  background: none;
  box-shadow: none;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-underline-offset: 4px;
  cursor: pointer;
  transition: color 0.18s, text-decoration-color 0.18s;
}

.link:hover {
  background: none;
  color: var(--ink);
  text-decoration-color: currentColor;
}

.link + .link,
.help + .link {
  margin-top: 6px;
}

.link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* a field people never see or reach; a script that fills it in gives itself away */
.hp {
  position: absolute;
  left: -200vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

#error {
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

/* the same closed look as every dropdown of the app (css/base.css): its own chevron, never the system's arrow */
select {
  appearance: none;
  -webkit-appearance: none;
  margin-top: 22px;
  min-height: 40px;
  max-width: 100%;
  padding: 0 30px 0 14px;
  border: 0;
  border-radius: 999px;
  background-color: var(--field);
  background-image:
    linear-gradient(to top right, transparent calc(50% - 0.6px), color-mix(in srgb, currentColor 62%, transparent) calc(50% - 0.6px) calc(50% + 0.6px), transparent calc(50% + 0.6px)),
    linear-gradient(to bottom right, transparent calc(50% - 0.6px), color-mix(in srgb, currentColor 62%, transparent) calc(50% - 0.6px) calc(50% + 0.6px), transparent calc(50% + 0.6px));
  background-repeat: no-repeat;
  background-size: 5px 5px;
  background-position: right 17px center, right 12px center;
  box-shadow: inset 0 0 0 1px var(--rim-soft);
  color: var(--ink-2);
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

select:hover {
  box-shadow: inset 0 0 0 1px var(--underline);
}

select option {
  background: var(--card-solid);
  color: var(--ink);
}

/* the light switch, in the corner where the site keeps it: one press turns the page's light off, or on again */
.lamp {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--card);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
  box-shadow: inset 0 1px 0 var(--rim), inset 0 0 0 1px var(--rim-soft), 0 18px 30px -18px rgba(0, 0, 0, 0.5);
  color: var(--ink-2);
  transition: color 0.18s, transform 0.25s var(--ease);
}

.lamp:hover {
  background: var(--card);
  color: var(--ink);
  transform: translateY(-2px);
}

.lamp span {
  display: grid;
}

.lamp svg {
  width: 20px;
  height: 20px;
}

/* the change of light spreads from the switch */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-new(root) {
  animation: relight 0.75s cubic-bezier(0.65, 0, 0.35, 1);
}

@keyframes relight {
  from {
    clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0));
  }
  to {
    clip-path: circle(150vmax at var(--vt-x, 50%) var(--vt-y, 0));
  }
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  .entry {
    animation: entry-in 0.7s var(--ease) both;
  }

  @keyframes entry-in {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
  }
}

@media (prefers-reduced-transparency: reduce) {
  .entry-card {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--card-solid);
  }
}

@media (max-width: 500px) {
  body {
    place-items: start center;
    padding-top: 28px;
  }

  .lamp {
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
  }

  .entry-card {
    padding: 28px 22px 24px;
    border-radius: 24px;
  }
}

/* the language list, drawn by the page where the browser allows it */
@supports (appearance: base-select) {
  select,
  select::picker(select) {
    appearance: base-select;
  }

  select {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-inline: 14px 12px;
    background-image: none;
  }

  select::picker-icon {
    content: '';
    flex: none;
    width: 14px;
    height: 14px;
    background: currentColor;
    opacity: 0.6;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: rotate 0.2s;
  }

  select:open::picker-icon {
    rotate: 180deg;
  }

  select::picker(select) {
    margin-block: 6px;
    padding: 6px;
    border: 0;
    border-radius: 16px;
    background: var(--card-solid);
    color: var(--ink);
    box-shadow: inset 0 1px 0 var(--rim), inset 0 0 0 1px var(--rim-soft), var(--card-shadow);
  }

  select option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    background: none;
    cursor: pointer;
  }

  select option:is(:hover, :focus-visible) {
    background: var(--field-hover);
    outline: 0;
  }
}
