/* The sign-in page.
 *
 * The one surface a stranger can reach, so it is the one that has to look
 * deliberate. Same tokens, same light/dark behaviour and same typography as
 * everywhere else -- a sign-in page styled from scratch always ends up looking
 * like a different product bolted on.
 *
 * The warm glow behind the card is the design system's on-channel colour, the
 * one that means "light is emitting". It is the only decoration here and it is
 * doing a job: it says which house this is before you have read a word.
 */

body[data-surface="login"] {
  min-height: 100svh;               /* svh, so a phone's address bar cannot clip it */
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg-0);
  position: relative;
  overflow: hidden;
}

/* Two soft pools of light rather than an image: nothing to load, nothing to
   cache, and it recolours itself with the theme. */
body[data-surface="login"]::before,
body[data-surface="login"]::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(90px);
  opacity: 0.30;
}
body[data-surface="login"]::before {
  width: 520px; height: 520px;
  top: -160px; left: -140px;
  background: var(--on);
}
body[data-surface="login"]::after {
  width: 460px; height: 460px;
  bottom: -180px; right: -120px;
  background: var(--accent);
  opacity: 0.22;
}
@media (prefers-reduced-motion: no-preference) {
  body[data-surface="login"]::before { animation: drift 18s ease-in-out infinite alternate; }
}
@keyframes drift {
  to { transform: translate3d(40px, 30px, 0) scale(1.08); }
}

.signin {
  position: relative;               /* above the glow */
  width: 100%;
  max-width: 360px;
  display: grid;
  gap: 18px;
}

.signin form {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 26px 24px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.brandmark {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.brandmark img { border-radius: 10px; display: block; }
.brandmark h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text-0);
}
.brandmark .sub {
  margin: 1px 0 0;
  font-size: 12.5px;
  color: var(--text-2);
}

.signin label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  margin: 14px 0 5px;
}

.signin input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 11px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-0);
  font-family: var(--font);
  font-size: 15px;                  /* 16px or more, or iOS zooms the page in */
  min-height: 44px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.signin input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
/* color-mix is recent; a browser without it simply gets the border colour and
   no ring, which is still a visible focus state rather than none. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .signin input:focus { box-shadow: 0 0 0 3px var(--bg-3); }
}

.signin button {
  width: 100%;
  margin-top: 22px;
  padding: 11px;
  min-height: 44px;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  font-family: var(--font);
  font-weight: 650;
  font-size: 14.5px;
  cursor: pointer;
  transition: filter .12s ease;
}
.signin button:hover { filter: brightness(1.08); }
.signin button:active { filter: brightness(0.94); }
.signin button:focus-visible { outline: 2px solid var(--text-0); outline-offset: 2px; }

.signin .err {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 9px 11px;
  font-size: 13px;
  margin-bottom: 4px;
}
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .signin .err { background: var(--bg-2); border-color: var(--danger); }
}

.signin .foot {
  margin: 0;
  padding: 0 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
  display: flex;
  gap: 8px;
}
.signin .foot .dot {
  flex: none;
  width: 7px; height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--on);
  box-shadow: 0 0 8px var(--on);
}

@media (max-width: 380px) {
  .signin form { padding: 20px 18px 18px; }
}
