@font-face {
  font-family: "Bungee";
  src: url("/assets/bungee.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --text: #f8f8ff;
  --text-muted: rgb(237 239 255 / 58%);
  --glass-edge: rgb(246 248 255 / 62%);
  --glass-fill: rgb(76 73 118 / 18%);
  --control-fill: rgb(255 255 255 / 7%);
  --control-edge: rgb(255 255 255 / 17%);
  --accent: #7b2ff2;
  --accent-pressed: #6922d7;
  --shadow: rgb(7 9 27 / 30%);
  --radius-panel: 30px;
  --radius-control: 16px;
  --motion: 160ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background-color: #1f2842;
  background-image: url("/assets/background.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

.brand {
  position: fixed;
  top: 32px;
  left: 32px;
  z-index: 10;
  isolation: isolate;
  width: 220.8px;
  height: 65.6px;
  overflow: hidden;
  border: 1px solid rgb(244 248 255 / 78%);
  border-radius: 999px;
  background: rgb(222 232 251 / 3.5%);
  box-shadow:
    inset 0 0.9px 0 rgb(255 255 255 / 48%),
    inset 0 -0.9px 0 rgb(17 27 55 / 34%),
    0 7.2px 18px rgb(5 10 29 / 24%);
  -webkit-backdrop-filter: blur(1.1px) saturate(112%) brightness(103%);
  backdrop-filter: blur(1.1px) saturate(112%) brightness(103%);
  pointer-events: none;
}

.brand::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background:
    radial-gradient(72% 155% at 10% -45%, rgb(255 255 255 / 24%), transparent 51%),
    radial-gradient(55% 145% at 92% 145%, rgb(190 208 242 / 15%), transparent 60%);
  content: "";
}

.brand__optics {
  position: absolute;
  inset: -12px;
  z-index: 0;
  background-image: url("/assets/background.png");
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: url("#brand-refraction");
  opacity: 0.92;
}

.brand__avatar {
  position: absolute;
  top: 1px;
  left: 1px;
  z-index: 2;
  width: 61.6px;
  height: 61.6px;
  border-radius: 50%;
  box-shadow:
    0 0 0 0.5px rgb(111 124 171 / 72%),
    0 2.4px 8px rgb(19 10 67 / 24%);
}

.brand__name {
  position: absolute;
  top: 50%;
  left: 67.4px;
  z-index: 2;
  transform: translateY(-50%);
  color: #fff;
  font-family: "Bungee", sans-serif;
  font-size: 24.9216px;
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0.008em;
  white-space: nowrap;
  text-shadow: 0 0.8px 1.6px rgb(13 19 43 / 18%);
}

.login-stage {
  min-height: 100vh;
  min-height: 100svh;
}

.login-card {
  position: fixed;
  top: 50%;
  right: clamp(40px, 10vw, 144px);
  isolation: isolate;
  width: min(380px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-panel);
  background: var(--glass-fill);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 38%),
    inset 0 -1px 0 rgb(15 18 48 / 28%),
    0 26px 64px var(--shadow);
  transform: translateY(-50%);
  -webkit-backdrop-filter: blur(14px) saturate(118%) brightness(103%);
  backdrop-filter: blur(14px) saturate(118%) brightness(103%);
}

.login-card::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background:
    radial-gradient(90% 56% at 16% -8%, rgb(255 255 255 / 20%), transparent 58%),
    radial-gradient(72% 78% at 105% 102%, rgb(123 47 242 / 12%), transparent 68%);
  content: "";
  pointer-events: none;
}

.login-card__optics {
  position: absolute;
  inset: -20px;
  z-index: 0;
  background-image: url("/assets/background.png");
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: url("#panel-refraction");
  opacity: 0.38;
}

.login-card__content {
  position: relative;
  z-index: 2;
  padding: 30px;
}

h1 {
  margin: 0 0 26px;
  font-size: 30px;
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.login-form {
  display: grid;
  gap: 12px;
}

.field {
  display: block;
}

.field input {
  width: 100%;
  height: 54px;
  padding: 0 17px;
  border: 1px solid var(--control-edge);
  border-radius: var(--radius-control);
  outline: none;
  background: var(--control-fill);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 5%);
  transition:
    border-color var(--motion) var(--ease-out),
    background-color var(--motion) var(--ease-out),
    box-shadow var(--motion) var(--ease-out);
}

.field input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.field input:hover {
  border-color: rgb(255 255 255 / 28%);
  background-color: rgb(255 255 255 / 9%);
}

.field input:focus-visible {
  border-color: rgb(255 255 255 / 72%);
  background-color: rgb(255 255 255 / 10%);
  box-shadow:
    0 0 0 3px rgb(123 47 242 / 24%),
    inset 0 1px 0 rgb(255 255 255 / 7%);
}

.button {
  display: inline-flex;
  height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: var(--radius-control);
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transform: translate3d(0, 0, 0);
  transition:
    background-color var(--motion) var(--ease-out),
    border-color var(--motion) var(--ease-out),
    transform var(--motion) var(--ease-out),
    box-shadow var(--motion) var(--ease-out);
}

.button--primary {
  margin-top: 4px;
  background: var(--accent);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 24%),
    0 10px 24px rgb(71 21 158 / 24%);
}

.button--primary:hover {
  background-color: #873df5;
  transform: translate3d(0, -1px, 0);
}

.button--primary:active {
  background-color: var(--accent-pressed);
  transform: scale(0.975);
}

.button:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgb(31 40 66),
    0 0 0 5px rgb(255 255 255 / 78%);
}

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

.social-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.button--social {
  border: 1px solid var(--control-edge);
  background: rgb(255 255 255 / 6%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 6%);
}

.button--social:hover {
  border-color: rgb(255 255 255 / 30%);
  background-color: rgb(255 255 255 / 10%);
  transform: translate3d(0, -1px, 0);
}

.button--social:active {
  background-color: rgb(255 255 255 / 5%);
  transform: scale(0.97);
}

.button--primary:disabled:hover,
.button--primary:disabled:active {
  background-color: var(--accent);
  transform: none;
}

.button--social:disabled:hover,
.button--social:disabled:active {
  border-color: var(--control-edge);
  background-color: rgb(255 255 255 / 6%);
  transform: none;
}

.button__icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: currentColor;
}

.button__icon--google {
  width: 18px;
  height: 18px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.optical-filters {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

@media (max-width: 720px) {
  .brand {
    top: 16px;
    left: 16px;
  }

  .login-card {
    right: auto;
    left: 50%;
    width: calc(100vw - 32px);
    max-width: 380px;
    transform: translate(-50%, -46%);
  }

  .login-card__content {
    padding: 26px;
  }
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .brand,
  .login-card {
    background-color: rgb(46 48 82 / 94%);
  }
}

@media (hover: none) {
  .field input:hover {
    border-color: var(--control-edge);
    background-color: var(--control-fill);
  }

  .button--primary:hover,
  .button--social:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .field input,
  .button {
    transition: none;
  }
}
