/* v0.73.0 (Max: "lets work on the redesign for the xcvlt.studio page. lets make a new sign in page first"): the Sign In page
   (views/login.js; the setup page, views/setup.js, wears it too). A canvas fills the window (the tile logo on the X tunnel, components/signin-art.js); over it are only the two
   fields and Continue. The canvas script places and sizes the fields through these variables on .signin:
     --ft  the fields' top, from the top of the window        --fw  their width
     --fh  one field's height     --fg  the gap between them     --fs  their text size
   and adds the class "in" when its opening is over, which brings the fields in. Colours: tokens.css (--signin-*). */
@font-face { font-family: "DM Mono"; src: url("/fonts/dm-mono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

html:has(.signin) { background: var(--signin-black); }
.signin { position: fixed; inset: 0; z-index: 5; overflow: hidden; background: var(--signin-black); }
.signin *, .signin *::before, .signin *::after { box-sizing: border-box; }
.sn-art { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; }
/* named for screen readers, not shown */
.sn-label { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.sn-form {
  position: absolute; left: 50%; top: var(--ft, 72%); width: min(var(--fw, 360px), calc(100% - 48px)); margin: 0;
  display: flex; flex-direction: column; gap: var(--fg, 12px);
  opacity: 0; transform: translateX(-50%) translateY(12px);
  transition: opacity .5s cubic-bezier(.2, .8, .2, 1), transform .5s cubic-bezier(.2, .8, .2, 1);
}
.signin.in .sn-form { opacity: 1; transform: translateX(-50%); }
.sn-field { position: relative; display: block; }
.sn-input {
  display: block; width: 100%; height: var(--fh, 46px); margin: 0; padding: 0 calc(var(--fh, 46px) * .43);
  border: 0; border-radius: 999px; background: var(--signin-grey); color: var(--signin-black);
  font: 400 var(--fs, 13px)/1 "DM Mono", ui-monospace, Menlo, Consolas, monospace; letter-spacing: .02em;
  -webkit-appearance: none; appearance: none;
}
/* the field that holds the disc leaves room for it */
.sn-input.has-go { padding-right: calc(var(--fh, 46px) * 1.3); }
.sn-input::placeholder { color: var(--signin-char); opacity: 1; }
/* v0.38.1 (Max: "it gives me a box around the password, make sure it doesnt do that"): no ring round a field, however it was focused */
.sn-input:focus, .sn-input:focus-visible { outline: none; }
/* a browser's autofill paints its own field colour - kept to the page's */
.sn-input:-webkit-autofill, .sn-input:-webkit-autofill:hover, .sn-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--signin-black); box-shadow: 0 0 0 1000px var(--signin-grey) inset; caret-color: var(--signin-black);
}
.signin ::selection { background: var(--signin-black); color: var(--signin-grey); }

/* Continue: the red disc in the password field (the last field, so it sits at the form's foot) */
.sn-go {
  position: absolute; right: calc(var(--fh, 46px) * .11); bottom: calc(var(--fh, 46px) * .11);
  width: calc(var(--fh, 46px) * .78); height: calc(var(--fh, 46px) * .78); margin: 0; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--signin-red); color: var(--signin-grey); cursor: pointer;
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), opacity .18s ease;
}
.sn-go svg { display: block; width: 45%; height: 45%; }
.sn-go:hover { transform: scale(1.08); }
.sn-go:active { transform: scale(.94); }
.sn-go:focus-visible { outline: 2px solid var(--signin-black); outline-offset: 2px; }
.sn-go[aria-busy="true"] { opacity: .55; cursor: default; transform: none; }

/* what went wrong, under the fields (out of the flow, so Continue stays in the password field) */
.sn-err {
  position: absolute; left: 0; right: 0; top: calc(100% + 14px); margin: 0; text-align: center; color: var(--signin-grey);
  font: 400 calc(var(--fs, 13px) + 1px)/1.45 "DM Mono", ui-monospace, Menlo, Consolas, monospace; letter-spacing: .02em;
}

/* ---- v0.74.0 (Max: "now lets redesign the setup page to match"): what the setup page (views/setup.js) adds to this look ---- */
/* v0.75.0 (Max: "... and the text that says choose your password at least 8 chracters and any text like that bigger"): the line above
   the fields. Out of the flow, so the fields stay where the canvas puts them (it leaves the room: startArt's "more"). The words on
   these pages follow the fields' text size, one pixel up; on a phone (16 px fields) they are 14 px. */
.sn-head { position: absolute; left: -60px; right: -60px; bottom: calc(100% + 14px); display: flex; flex-direction: column; gap: 4px; }
.sn-note {
  margin: 0; text-align: center; text-wrap: balance; color: var(--signin-grey);
  font: 400 calc(var(--fs, 13px) + 1px)/1.45 "DM Mono", ui-monospace, Menlo, Consolas, monospace; letter-spacing: .02em;
}
/* v0.76.0 (Max: "I want the email to be in a pill field that cant be edited"): the account's email, in a field of its own above the
   passwords. Ash where the fields to fill are Grey, so it reads as set; it can be selected and copied, not changed. */
.sn-input.is-fixed { background: var(--signin-ash); cursor: default; text-overflow: ellipsis; }
/* a message where the fields would be: an incomplete link, a password saved for someone not on a project yet */
.sn-say { margin: 0; text-align: center; text-wrap: balance; color: var(--signin-grey); font: 400 calc(var(--fs, 13px) + 1px)/1.5 "DM Mono", ui-monospace, Menlo, Consolas, monospace; letter-spacing: .02em; }
@media (max-width: 699px) {
  .sn-head { left: 0; right: 0; }
  .sn-note, .sn-say, .sn-err { font-size: 14px; }
}
/* Show / Hide: a small word at the end of the first field */
.sn-input.has-eye { padding-right: calc(var(--fh, 46px) * .3 + 50px); }
.sn-eye {
  position: absolute; right: calc(var(--fh, 46px) * .22); top: 0; height: 100%; margin: 0; padding: 0 8px; border: 0; border-radius: 999px; background: none;
  color: var(--signin-char); cursor: pointer; font: 400 9px/1 "DM Mono", ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; text-transform: uppercase;
}
.sn-eye:hover { color: var(--signin-black); }
.sn-eye:focus-visible { outline: 2px solid var(--signin-black); outline-offset: -6px; }
/* a link in the shape of a field, the disc at its end (the disc is a picture there: the whole pill is the link) */
.sn-pill {
  display: flex; align-items: center; height: var(--fh, 46px); padding: 0 calc(var(--fh, 46px) * 1.3) 0 calc(var(--fh, 46px) * .48); border-radius: 999px;
  background: var(--signin-grey); color: var(--signin-black); text-decoration: none;
  font: 700 11px/1 "Gilmer", "Helvetica Neue", Arial, sans-serif; letter-spacing: .04em; text-transform: uppercase;
}
.sn-pill:focus-visible { outline: 2px solid var(--signin-grey); outline-offset: 3px; }
span.sn-go { pointer-events: none; }

@media (prefers-reduced-motion: reduce) { .sn-form, .sn-go { transition: none; } }
