:root {
  color-scheme: dark;
  --bg: #000000;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.68);
  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.16);
  --line: rgba(255, 255, 255, 0.32);
  --line-hot: rgba(255, 255, 255, 0.72);
  --shadow: rgba(255, 255, 255, 0.24);
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", system-ui, sans-serif;
  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-emphasized: cubic-bezier(0.16, 1, 0.3, 1);
}

@property --rgb-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-ui);
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.auth-page {
  overflow: hidden;
  background: #000000;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 8px;
}

.particle-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
}

.entry-stage {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.login-button {
  position: relative;
  isolation: isolate;
  display: inline-grid;
  place-items: center;
  min-width: 148px;
  min-height: 54px;
  padding: 0 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08)),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.36), transparent 58%),
    rgba(0, 0, 0, 0.74);
  box-shadow:
    0 0 24px rgba(255, 255, 255, 0.22),
    0 0 82px rgba(255, 255, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -18px 36px rgba(255, 255, 255, 0.08);
  font-size: 0.96rem;
  font-weight: 780;
  pointer-events: auto;
  transform: translateZ(0);
  transition:
    border-color 220ms var(--ease-standard),
    box-shadow 260ms var(--ease-standard),
    transform 180ms var(--ease-standard),
    filter 220ms var(--ease-standard);
}

.login-button::before,
.login-button::after {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: inherit;
}

.login-button::before {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.72),
    rgba(255, 255, 255, 0.12),
    transparent
  );
  opacity: 0.64;
  transform: translateX(-120%);
  animation: button-sweep 3.6s var(--ease-emphasized) infinite;
}

.login-button::after {
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.3), transparent 56%);
  opacity: 0.42;
  filter: blur(18px);
  animation: button-breathe 2.8s var(--ease-emphasized) infinite alternate;
}

.login-button span {
  position: relative;
  z-index: 1;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.42);
}

.login-button:hover {
  border-color: var(--line-hot);
  box-shadow:
    0 0 34px rgba(255, 255, 255, 0.36),
    0 0 120px rgba(255, 255, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    inset 0 -18px 36px rgba(255, 255, 255, 0.12);
  transform: translateY(-2px) scale(1.035);
  filter: saturate(1.08);
}

.login-button:active {
  transform: translateY(0) scale(0.99);
}

.login-button-secondary {
  min-width: 132px;
  color: var(--muted);
}

.auth-stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #000000;
}

.auth-form {
  width: min(340px, 100%);
  display: grid;
  gap: 22px;
}

.auth-field {
  display: grid;
  gap: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 680;
}

.auth-input {
  width: 100%;
  height: 48px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  color: #ffffff;
  background: #000000;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.18);
  font: inherit;
  font-size: 1rem;
  font-weight: 560;
  outline: 0;
  padding: 0 14px 1px;
  transition:
    border-color 180ms var(--ease-standard),
    box-shadow 220ms var(--ease-standard);
}

.auth-input:focus {
  border-color: rgba(255, 255, 255, 0.62);
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.76),
    0 10px 34px rgba(255, 255, 255, 0.08);
}

.auth-submit {
  --rgb-angle: 0deg;
  position: relative;
  isolation: isolate;
  height: 50px;
  margin-top: 6px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 0;
  color: #000000;
  background: #ffffff;
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 760;
  transition:
    color 180ms var(--ease-standard),
    transform 160ms var(--ease-standard),
    box-shadow 220ms var(--ease-standard);
}

.auth-submit::before {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: -1;
  background: conic-gradient(
    from var(--rgb-angle),
    rgba(255, 0, 76, 0.94),
    rgba(255, 138, 0, 0.72),
    rgba(0, 255, 102, 0.84),
    rgba(0, 213, 255, 0.92),
    rgba(119, 72, 255, 0.82),
    rgba(255, 0, 76, 0.94)
  );
  opacity: 0;
  filter: blur(18px);
  transition: opacity 260ms var(--ease-standard);
}

.auth-submit span {
  position: relative;
  z-index: 1;
}

.auth-submit:hover,
.auth-submit:focus-visible {
  animation: rgb-spin 8s linear infinite;
  border-color: transparent;
  color: #000000;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    conic-gradient(
      from var(--rgb-angle),
      #ff004c,
      #ff8a00,
      #00ff66,
      #00d5ff,
      #7748ff,
      #ff004c
    ) border-box;
  box-shadow:
    0 0 14px rgba(255, 255, 255, 0.08),
    0 0 28px rgba(0, 213, 255, 0.14),
    0 0 38px rgba(255, 0, 76, 0.12);
  transform: translateY(-1px);
}

.auth-submit:hover::before,
.auth-submit:focus-visible::before {
  opacity: 0.62;
}

.auth-submit:active {
  transform: translateY(0) scale(0.992);
}

.private-shell {
  display: grid;
  place-items: center;
  min-width: 180px;
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.82);
  background: #000000;
  font-size: 0.88rem;
  font-weight: 680;
}

.private-shell p {
  margin: 0;
}

@keyframes button-sweep {
  0% {
    transform: translateX(-120%);
  }
  46%,
  100% {
    transform: translateX(120%);
  }
}

@keyframes button-breathe {
  from {
    opacity: 0.28;
    transform: scale(0.96);
  }
  to {
    opacity: 0.62;
    transform: scale(1.06);
  }
}

@keyframes rgb-spin {
  to {
    --rgb-angle: 360deg;
  }
}

@media (max-width: 520px) {
  .login-button {
    min-width: 136px;
    min-height: 52px;
    padding: 0 26px;
  }

  .auth-form {
    width: min(312px, 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
