@font-face {
  font-family: "More Perfect DOS VGA";
  src: url("./assets/MorePerfectDOSVGA.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

:root {
  --background: #11110f;
  --panel: #2a2c31;
  --text: #f1efe7;
  --muted: #b3b5ba;
  --line: #4b4e56;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--background);
  background-size: 32px 32px;
  font-family: "More Perfect DOS VGA", "Courier New", monospace;
  font-synthesis: none;
  image-rendering: pixelated;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.video-background {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  background: var(--background);
}

.video-background video {
  position: absolute;
  inset: -30px;
  width: calc(100% + 60px);
  height: calc(100% + 60px);
  object-fit: cover;
  filter: blur(2px);
}

.video-background::after {
  position: absolute;
  content: "";
  inset: 0;
  background: rgba(17, 17, 15, 0.42);
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  place-content: center;
  padding: 24px;
}

.login-panel {
  --edge-mask-x: linear-gradient(
    to right,
    transparent,
    #000 28px,
    #000 calc(100% - 28px),
    transparent
  );
  --edge-mask-y: linear-gradient(
    to bottom,
    transparent,
    #000 28px,
    #000 calc(100% - 28px),
    transparent
  );
  position: relative;
  isolation: isolate;
  width: min(360px, calc(100vw - 32px));
  outline: 2px solid #fff;
  outline-offset: 10px;
  background: transparent;
}

.login-panel::before,
.attractor-field {
  position: absolute;
  z-index: -1;
  inset: -38px;
  pointer-events: none;
  -webkit-mask-image: var(--edge-mask-x), var(--edge-mask-y);
  -webkit-mask-composite: source-in;
  mask-image: var(--edge-mask-x), var(--edge-mask-y);
  mask-composite: intersect;
}

.login-panel::before {
  content: "";
  background: rgba(8, 8, 9, 0.88);
}

.attractor-field {
  width: calc(100% + 76px);
  height: calc(100% + 76px);
  mix-blend-mode: screen;
  opacity: 0.86;
  filter: contrast(1.35);
}

form {
  padding: 30px;
}

.field > label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  letter-spacing: 0.05em;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #aaaeb7;
  border-radius: 0;
  outline: none;
  color: var(--text);
  background: #202126;
  font-size: 18px;
  caret-color: var(--text);
  appearance: none;
}

input::placeholder {
  color: #858890;
}

input:focus {
  border-color: var(--text);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.submit {
  position: relative;
  width: 100%;
  min-height: 54px;
  margin-top: 18px;
  padding: 0 18px;
  border: 1px solid #000;
  border-radius: 0;
  color: #fff;
  background: transparent;
  cursor: pointer;
  font-size: 17px;
  letter-spacing: 0.06em;
}

.submit::before {
  position: absolute;
  z-index: 0;
  content: "";
  inset: 0;
  pointer-events: none;
  background: #fff;
  mix-blend-mode: difference;
}

.submit:hover::before {
  opacity: 0.86;
}

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

footer {
  padding: 0 18px 18px;
  text-align: center;
}

.request-button {
  padding: 3px;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.outlined-text {
  position: relative;
  z-index: 1;
  display: inline-block;
}

.invert-text {
  color: #fff;
  mix-blend-mode: difference;
}

.outlined-text::after {
  position: absolute;
  z-index: 2;
  content: attr(data-text);
  inset: 0;
  pointer-events: none;
  color: transparent;
  -webkit-text-stroke: 1px #000;
  text-shadow:
    -1px 0 #000,
    0 1px #000,
    1px 0 #000,
    0 -1px #000;
}

.outlined-text.white-outline::after {
  -webkit-text-stroke-color: #fff;
  text-shadow:
    -1px 0 #fff,
    0 1px #fff,
    1px 0 #fff,
    0 -1px #fff;
}

dialog {
  width: min(340px, calc(100vw - 40px));
  padding: 0;
  border: 1px solid rgba(241, 239, 231, 0.5);
  border-radius: 0;
  color: var(--text);
  background: rgba(42, 44, 49, 0.96);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  font-family: "More Perfect DOS VGA", "Courier New", monospace;
}

dialog::backdrop {
  background: rgba(17, 17, 15, 0.68);
  backdrop-filter: blur(4px);
}

.dialog-content {
  padding: 24px;
}

.dialog-content p {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.6;
}

.dialog-content a {
  color: var(--text);
  text-underline-offset: 3px;
}

.dialog-content form {
  padding: 0;
}

.dialog-close {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(241, 239, 231, 0.68);
  border-radius: 0;
  color: var(--text);
  background: rgba(32, 33, 38, 0.78);
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.05em;
}

.dialog-close:hover {
  background: rgba(241, 239, 231, 0.12);
}

@media (max-width: 520px) {
  .shell {
    padding: 16px;
  }

  .login-panel {
    width: 100%;
  }

  form {
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-background video {
    display: none;
  }

  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
