/* login.css: the local login page (#1444). Its own stylesheet, not hud.css. The page
   loads only this file, so it carries its own font faces and its own token block.
   Colors sit only in the :root block. Sizes are rem. No vh: the page fills the
   viewport with min-height: 100%. */

@font-face {
  font-family: "Victor Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/victor-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/chakra-petch-latin-600-normal.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --cyan: #35c7ff;
  --green: #a6e22e;
  --surface: #0b2a37;
  --deep: #08202b;
  --text: #d8f3ff;
  --text-dim: #8fc4d6;
  --input-bg: rgba(10, 45, 60, .6);
  --input-border: rgba(53, 199, 255, .55);
  --error: #e58fb1;
  --bad: #ff6b64;
  --faint: #6f9db0;
  --tab-line: #2280a5;
  --tab-bg: #09222d;
  --grid: rgba(53, 199, 255, .05);
  --page-bg: radial-gradient(ellipse at 30% 0%, #0f3342 0%, #08202b 75%);
  --fade-edge: rgba(53, 199, 255, .35);
  --fade-mid: rgba(53, 199, 255, .27);
  --fade-clear: rgba(53, 199, 255, 0);
  --fade-bottom: rgba(53, 199, 255, .3);
  --font-body: "Victor Mono", ui-monospace, Menlo, Consolas, monospace;
  --font-head: "Chakra Petch", system-ui, sans-serif;
  --cut: 1.375rem;
  --tab-cut: .875rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* #1455: the default root size is 80%, so signed-out pages match the HUD. */
html {
  font-size: 80%;
}

html,
body {
  background: var(--deep);
  height: 100%;
  margin: 0;
}

body {
  color: var(--text);
  font-family: var(--font-body);
}

.page {
  background-color: var(--deep);
  background-image:
    linear-gradient(var(--grid) 0.0625rem, transparent 0.0625rem),
    linear-gradient(90deg, var(--grid) 0.0625rem, transparent 0.0625rem),
    var(--page-bg);
  background-size: 2.5rem 2.5rem, 2.5rem 2.5rem, auto;
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  min-height: 100%;
}

/* The photo comes first in the DOM: on the right when wide, on top when stacked. */
.photo {
  flex: 1.25 1 30rem;
  margin: 0;
  min-height: 28rem;
  overflow: hidden;
  position: relative;
}

.photo img {
  display: block;
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: 50% 42%;
  position: absolute;
  width: 100%;
}

.photo .tint {
  background: var(--cyan);
  inset: 0;
  mix-blend-mode: soft-light;
  opacity: .22;
  position: absolute;
}

.photo .fade {
  background:
    linear-gradient(to right, var(--fade-edge) 0%, var(--fade-mid) 10%, var(--fade-clear) 38%),
    linear-gradient(to top, var(--fade-bottom) 0%, var(--fade-clear) 22%);
  inset: 0;
  position: absolute;
}

.photo .corner {
  fill: none;
  height: 2.5rem;
  position: absolute;
  right: 1.5rem;
  stroke: var(--cyan);
  stroke-width: 1.5;
  width: 2.5rem;
}

.photo .tr {
  top: 1.5rem;
}

.photo .br {
  bottom: 1.5rem;
}

/* The form column. */
.side {
  align-items: center;
  display: flex;
  flex: 1 1 26rem;
  justify-content: center;
  padding: 3rem 2rem;
}

.wrap {
  max-width: 25rem;
  width: 100%;
}

.brand {
  align-items: center;
  display: flex;
  gap: .75rem;
  margin-bottom: 2rem;
}

.brand .mark {
  height: 2.25rem;
  width: 2.25rem;
}

.brand .mark-frame {
  fill: none;
  stroke: var(--green);
  stroke-linejoin: round;
  stroke-width: 3;
}

.brand .mark-line {
  stroke: var(--cyan);
  stroke-width: 3;
}

.brand .name {
  font-family: var(--font-head);
  font-size: 1.625rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.brand .a {
  color: var(--cyan);
}

.brand .b {
  color: var(--green);
}

/* The card has three layers. Its edge is a cyan layer cut at two corners, and the
   surface sits on it, inset by the 1px edge. */
.card {
  position: relative;
}

.card .edge,
.card .edge i {
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  position: absolute;
}

.card .edge {
  background: var(--cyan);
  inset: 0;
}

.card .edge i {
  background: var(--surface);
  inset: 0.0625rem;
}

.card form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem 1.75rem 1.75rem;
  position: relative;
}

.card h1 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

.row {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

label {
  color: var(--text-dim);
  font-size: .875rem;
}

input {
  background: var(--input-bg);
  border: 0.0625rem solid var(--input-border);
  border-radius: 0;
  color: var(--text);
  font: 1rem var(--font-body);
  height: 3rem;
  outline: none;
  padding: 0 1rem;
}

input:focus {
  border-color: var(--green);
  outline: .125rem solid var(--green);
  outline-offset: .125rem;
}

button {
  background: color-mix(in srgb, var(--green) 16%, var(--deep));
  border: 0.0625rem solid var(--green);
  border-radius: 0;
  color: var(--green);
  cursor: pointer;
  font-family: var(--font-head);
  font-size: 1.125rem;
  font-weight: 600;
  height: 3.25rem;
  letter-spacing: .12em;
  margin-top: .5rem;
  text-transform: uppercase;
}

button:hover {
  background: color-mix(in srgb, var(--green) 30%, var(--deep));
}

button:focus-visible {
  outline: .125rem solid var(--green);
  outline-offset: .25rem;
}

button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.error {
  color: var(--error);
  font-size: .875rem;
  min-height: 1.25rem;
}

/* #1475: Login and Register folder tabs. Each tab is the label of a hidden radio,
   so the switch works without JavaScript. The radios sit before the tabs and the
   card, so one :checked selector drives both. */
.auth {
  position: relative;
}

.tab-radio,
.chk input {
  border: 0;
  height: 0;
  margin: 0;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  position: absolute;
  width: 0;
}

/* The tabs overlap the card's top edge by 1px, so the active tab opens into it. */
.tabs {
  display: flex;
  margin-bottom: -0.0625rem;
  position: relative;
  z-index: 2;
}

.tab {
  color: var(--text-dim);
  cursor: pointer;
  display: block;
  font-size: 1rem;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.tab + .tab {
  margin-left: calc(var(--tab-cut) * -1);
}

.tab .o,
.tab .i {
  position: absolute;
}

.tab .o {
  background: var(--tab-line);
  clip-path: polygon(0 0, calc(100% - var(--tab-cut)) 0, 100% var(--tab-cut), 100% 100%, 0 100%);
  inset: 0;
}

.tab .i {
  background: var(--tab-bg);
  clip-path: polygon(0 0, calc(100% - var(--tab-cut) + .04rem) 0, 100% calc(var(--tab-cut) - .04rem), 100% 100%, 0 100%);
  inset: 0.0625rem;
}

.tab .t {
  display: block;
  padding: .875rem 2.25rem .875rem 1.5rem;
  position: relative;
}

.tab:hover {
  color: var(--text);
}

.tab-radio-login:checked ~ .tabs .tab-login,
.tab-radio-register:checked ~ .tabs .tab-register {
  color: var(--text);
  z-index: 3;
}

.tab-radio-login:checked ~ .tabs .tab-login .o,
.tab-radio-register:checked ~ .tabs .tab-register .o {
  background: var(--cyan);
}

/* The active tab's surface runs to its bottom edge and covers the card's top line. */
.tab-radio-login:checked ~ .tabs .tab-login .i,
.tab-radio-register:checked ~ .tabs .tab-register .i {
  background: var(--surface);
  bottom: 0;
}

.tab-radio-login:checked ~ .tabs .tab-login .t::before,
.tab-radio-register:checked ~ .tabs .tab-register .t::before {
  background: var(--green);
  content: "";
  height: .125rem;
  left: 0;
  position: absolute;
  top: -0.0625rem;
  width: 2rem;
}

.tab-radio-login:focus-visible ~ .tabs .tab-login,
.tab-radio-register:focus-visible ~ .tabs .tab-register {
  outline: .125rem solid var(--green);
  outline-offset: .125rem;
}

/* Each pane is a one-row grid. Its row animates between 0fr and 1fr, so the card
   stretches from one form's height to the other's while the panes cross-fade. */
.pane {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows .25s ease, opacity .25s ease, visibility 0s;
  visibility: visible;
}

.pane-body {
  min-height: 0;
  overflow: hidden;
}

/* A hidden pane keeps visibility until its fade ends, then leaves the tab order. */
.pane-register,
.tab-radio-register:checked ~ .card .pane-login {
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .25s ease, opacity .25s ease, visibility 0s .25s;
  visibility: hidden;
}

.tab-radio-register:checked ~ .card .pane-register {
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows .25s ease, opacity .25s ease, visibility 0s;
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  .pane,
  .pane-register,
  .tab-radio-register:checked ~ .card .pane-login,
  .tab-radio-register:checked ~ .card .pane-register {
    transition: none;
  }
}

.hint {
  color: var(--faint);
  font-size: .8125rem;
  line-height: 1.5;
  margin: 0;
}

.hint[data-state="bad"] {
  color: var(--bad);
}

input[aria-invalid="true"] {
  border-color: var(--bad);
}

.chk {
  align-items: flex-start;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font-size: 1rem;
  gap: .875rem;
  line-height: 1.35;
  position: relative;
}

.chk .bx {
  align-items: center;
  background: var(--input-bg);
  border: 0.0625rem solid var(--input-border);
  color: transparent;
  display: flex;
  flex: 0 0 1.5rem;
  height: 1.5rem;
  justify-content: center;
  margin-top: .0625rem;
  width: 1.5rem;
}

.chk .bx svg {
  fill: none;
  height: 1rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  width: 1rem;
}

.chk input:checked + .bx {
  background: var(--green);
  border-color: var(--green);
  color: var(--deep);
}

.chk input:focus-visible + .bx {
  outline: .125rem solid var(--green);
  outline-offset: .125rem;
}

.chk .who {
  color: var(--cyan);
  font-weight: 600;
}

.chk small {
  color: var(--faint);
  display: block;
  font-size: .8125rem;
  line-height: 1.5;
  margin-top: .375rem;
}

.status {
  color: var(--text);
  font-size: .875rem;
  margin: 0;
  min-height: 1.25rem;
}

@media (max-width: 26rem) {
  .side {
    padding: 2rem 1.25rem;
  }
}
