:root {
  --lab-bg: #03070c;
  --lab-accent: #67ffd7;
  --lab-accent-rgb: 103 255 215;
  --lab-secondary: #73a6ff;
  --lab-secondary-rgb: 115 166 255;
  --lab-text: #e7fcff;
  --lab-muted: #98afbe;
  --lab-plate: rgb(6 13 22 / 0.62);
  --lab-plate-border: rgb(118 183 255 / 0.34);
}

body[data-login-edition="v2"] {
  --lab-bg: #031015;
  --lab-accent: #63ffc7;
  --lab-accent-rgb: 99 255 199;
  --lab-secondary: #7fd7ff;
  --lab-secondary-rgb: 127 215 255;
  --lab-text: #eafff6;
  --lab-muted: #9dd9c7;
  --lab-plate: rgb(6 17 20 / 0.6);
  --lab-plate-border: rgb(99 255 199 / 0.34);
}

body[data-login-edition="v3"] {
  --lab-bg: #050913;
  --lab-accent: #9eb6ff;
  --lab-accent-rgb: 158 182 255;
  --lab-secondary: #73f3ff;
  --lab-secondary-rgb: 115 243 255;
  --lab-text: #e9eeff;
  --lab-muted: #a8bbdf;
  --lab-plate: rgb(8 13 26 / 0.58);
  --lab-plate-border: rgb(158 182 255 / 0.36);
}

body[data-login-edition="v4"] {
  --lab-bg: #11080f;
  --lab-accent: #ffc164;
  --lab-accent-rgb: 255 193 100;
  --lab-secondary: #ff7ab8;
  --lab-secondary-rgb: 255 122 184;
  --lab-text: #fff2de;
  --lab-muted: #dfb88f;
  --lab-plate: rgb(20 11 16 / 0.6);
  --lab-plate-border: rgb(255 193 100 / 0.34);
}

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

body {
  overflow: hidden;
  background: var(--lab-bg);
  color: var(--lab-text);
  font-family: "Orbitron", "Aldrich", "Space Mono", "Courier New", monospace;
  letter-spacing: 0.02em;
}

#login-lab-webgl,
#login-lab-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

#login-lab-webgl {
  z-index: 0;
  filter: saturate(1.08) contrast(1.07);
}

#login-lab-overlay {
  z-index: 1;
  mix-blend-mode: screen;
  opacity: 0.96;
}

.lab-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(900px 720px at 82% 14%, rgb(var(--lab-secondary-rgb) / 0.08), transparent 66%),
    radial-gradient(1100px 860px at 10% 88%, rgb(var(--lab-accent-rgb) / 0.11), transparent 68%),
    radial-gradient(1200px 920px at 50% 50%, transparent 42%, rgb(0 0 0 / 0.58) 100%);
}

.lab-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  box-sizing: border-box;
  padding: clamp(16px, 2.6vw, 34px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(250px, 340px);
  grid-template-rows: auto 1fr;
  gap: clamp(12px, 2vw, 24px);
}

.lab-topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: clamp(10px, 1.1vw, 14px) clamp(12px, 1.4vw, 18px);
  border: 1px solid var(--lab-plate-border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgb(var(--lab-secondary-rgb) / 0.12), rgb(var(--lab-accent-rgb) / 0.06)),
    var(--lab-plate);
  box-shadow:
    0 12px 32px rgb(0 0 0 / 0.42),
    inset 0 0 0 1px rgb(var(--lab-accent-rgb) / 0.16);
  backdrop-filter: blur(5px);
  box-sizing: border-box;
}

.lab-topbar-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lab-topbar-title strong {
  font-size: clamp(16px, 1.8vw, 22px);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lab-topbar-title span {
  font-size: clamp(12px, 1.2vw, 14px);
  color: var(--lab-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lab-edition-nav {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lab-edition-link {
  min-height: 44px;
  min-width: 82px;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgb(var(--lab-secondary-rgb) / 0.36);
  background: linear-gradient(180deg, rgb(var(--lab-secondary-rgb) / 0.2), rgb(var(--lab-accent-rgb) / 0.08));
  color: var(--lab-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.lab-edition-link:hover {
  transform: translateY(-1px);
  border-color: rgb(var(--lab-accent-rgb) / 0.72);
  box-shadow: 0 8px 22px rgb(var(--lab-accent-rgb) / 0.26);
}

.lab-edition-link[aria-current="page"] {
  border-color: rgb(var(--lab-accent-rgb) / 0.92);
  background: linear-gradient(180deg, rgb(var(--lab-accent-rgb) / 0.42), rgb(var(--lab-accent-rgb) / 0.16));
  box-shadow: 0 0 0 1px rgb(var(--lab-accent-rgb) / 0.32), 0 10px 24px rgb(var(--lab-accent-rgb) / 0.28);
}

.lab-edition-link:focus-visible,
.auth-mock-btn:focus-visible {
  outline: 2px solid rgb(var(--lab-secondary-rgb) / 0.95);
  outline-offset: 2px;
}

.lab-copy {
  align-self: end;
  max-width: 56ch;
  padding: clamp(14px, 1.4vw, 20px);
  border-radius: 14px;
  border: 1px solid rgb(var(--lab-accent-rgb) / 0.28);
  background:
    linear-gradient(145deg, rgb(var(--lab-accent-rgb) / 0.1), transparent 56%),
    linear-gradient(180deg, rgb(1 5 8 / 0.64), rgb(1 8 11 / 0.5));
  box-shadow: 0 14px 34px rgb(0 0 0 / 0.38);
  box-sizing: border-box;
}

.lab-copy h1 {
  margin: 0;
  font-size: clamp(24px, 5.5vw, 60px);
  line-height: 1;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.lab-copy p {
  margin: 10px 0 0;
  font-size: clamp(14px, 1.5vw, 18px);
  line-height: 1.55;
  color: var(--lab-muted);
}

.auth-mock {
  align-self: end;
  justify-self: end;
  width: min(100%, 320px);
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgb(var(--lab-secondary-rgb) / 0.32);
  background:
    linear-gradient(180deg, rgb(var(--lab-secondary-rgb) / 0.12), transparent 55%),
    linear-gradient(145deg, rgb(var(--lab-accent-rgb) / 0.14), transparent 58%),
    var(--lab-plate);
  box-shadow:
    0 12px 30px rgb(0 0 0 / 0.44),
    inset 0 0 0 1px rgb(var(--lab-secondary-rgb) / 0.16);
  box-sizing: border-box;
}

.auth-mock h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-mock p {
  margin: 8px 0 0;
  color: var(--lab-muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-mock-fields {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.auth-mock-fields label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lab-muted);
}

.auth-mock-fields input {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  border-radius: 9px;
  border: 1px solid rgb(var(--lab-accent-rgb) / 0.28);
  background: rgb(4 11 16 / 0.86);
  color: var(--lab-text);
  padding: 10px 11px;
  font-family: inherit;
  font-size: 13px;
}

.auth-mock-fields input[readonly] {
  cursor: default;
}

.auth-mock-btn {
  margin-top: 10px;
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid rgb(var(--lab-secondary-rgb) / 0.42);
  background: linear-gradient(180deg, rgb(var(--lab-secondary-rgb) / 0.24), rgb(var(--lab-accent-rgb) / 0.14));
  color: var(--lab-text);
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: default;
}

.auth-mock-note {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.42;
  color: var(--lab-muted);
}

@media (max-width: 920px) {
  .lab-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .lab-copy,
  .auth-mock {
    justify-self: stretch;
  }

  .lab-copy {
    align-self: start;
  }

  .auth-mock {
    align-self: start;
    width: min(100%, 440px);
  }
}

@media (max-width: 640px) {
  .lab-shell {
    padding: 12px;
    gap: 10px;
  }

  .lab-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .lab-edition-link {
    min-width: 70px;
    padding-inline: 10px;
  }

  .lab-copy h1 {
    font-size: clamp(24px, 8.5vw, 38px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lab-edition-link {
    transition: none;
  }

  #login-lab-overlay {
    opacity: 0.82;
  }
}
