﻿:root {
  color-scheme: dark;
  --bg: #000000;
  --accent: #27d0ff;
  --accent-strong: #00f59f;
  --accent-rgb: 39, 208, 255;
  --accent-strong-rgb: 0, 245, 159;
  --surface-0: rgba(9, 14, 28, 0.76);
  --surface-1: rgba(255, 255, 255, 0.08);
  --control-border: rgba(188, 226, 255, 0.28);
  --control-border-strong: rgba(188, 226, 255, 0.45);
  --text: #f6f8ff;
  --muted: #a8b3cc;
  --input-height: 52px;
  --form-gap: 12px;
}

* {
  box-sizing: border-box;
}

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

body {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-scene,
.grid-layer {
  position: fixed;
  inset: 0;
}

.auth-scene {
  overflow: hidden;
  pointer-events: none;
  isolation: isolate;
}

.light {
  --light-core: rgba(31, 185, 216, 0.26);
  --light-mid: rgba(31, 185, 216, 0.18);
  --light-outer: rgba(31, 185, 216, 0.06);
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  background:
    radial-gradient(ellipse at 50% 50%, var(--light-core) 0%, var(--light-mid) 44%, var(--light-outer) 72%, transparent 100%);
  opacity: 0.62;
  will-change: transform;
  mix-blend-mode: screen;
}

.light-one {
  top: 2%;
  left: 3%;
  width: 52rem;
  height: 38rem;
}

.light-two {
  top: 40%;
  right: -6%;
  width: 46rem;
  height: 33rem;
}

.light-three {
  bottom: -6%;
  left: 26%;
  width: 44rem;
  height: 30rem;
}

.grid-layer {
  width: 100%;
  height: 100%;
  opacity: 0.58;
}

html.lite-runtime .auth-scene,
html.lite-runtime .grid-layer {
  display: none;
}

html.lite-runtime body {
  background:
    radial-gradient(120% 120% at 14% 12%, rgba(39, 208, 255, 0.22), transparent 44%),
    radial-gradient(100% 100% at 86% 88%, rgba(0, 245, 159, 0.16), transparent 48%),
    #070d19;
}

@media (pointer: coarse), (max-width: 900px), (prefers-reduced-motion: reduce) {
  .auth-scene,
  .grid-layer {
    display: none;
  }

  body {
    background:
      radial-gradient(120% 120% at 14% 12%, rgba(39, 208, 255, 0.22), transparent 44%),
      radial-gradient(100% 100% at 86% 88%, rgba(0, 245, 159, 0.16), transparent 48%),
      #070d19;
  }

  .field input {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(10, 18, 34, 0.82);
  }

  .auth-form,
  .form-stage,
  .primary-button,
  .provider-button,
  .link-button {
    transition: none;
  }
}

.auth-root {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

.auth-shell {
  width: min(430px, calc(100vw - 32px));
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
}

.auth-header {
  margin-bottom: 18px;
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-logo img {
  display: block;
  width: clamp(168px, 38vw, 240px);
  height: auto;
}

.auth-header h1 {
  margin: 0;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-size: clamp(2.4rem, 7vw, 3.1rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.form-stage {
  position: relative;
  transition: height 260ms ease;
}

.auth-form {
  position: absolute;
  inset: 0;
  display: grid;
  gap: var(--form-gap);
  align-content: start;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.985);
  transition:
    opacity 220ms ease,
    transform 260ms ease;
}

.auth-form.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.field {
  display: block;
}

.field input {
  width: 100%;
  height: var(--input-height);
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--control-border);
  background: rgba(8, 14, 30, 0.66);
  backdrop-filter: blur(12px) saturate(106%);
  -webkit-backdrop-filter: blur(12px) saturate(106%);
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 700;
  outline: none;
  transition:
    box-shadow 180ms ease,
    background 180ms ease,
    filter 180ms ease;
}

.field input::placeholder {
  color: var(--muted);
  font-weight: 600;
}

.field input:focus {
  border-color: var(--control-border-strong);
  box-shadow: 0 0 18px rgba(39, 208, 255, 0.26);
  background: rgba(10, 18, 34, 0.88);
  filter: brightness(1.03);
}

.primary-button,
.provider-button,
.link-button {
  transition:
    box-shadow 180ms ease,
    opacity 180ms ease,
    color 180ms ease,
    background 180ms ease,
    filter 180ms ease;
}

.primary-button,
.provider-button {
  height: var(--input-height);
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--control-border);
  color: var(--text);
}

.primary-button {
  background: linear-gradient(130deg, var(--accent), var(--accent-strong));
  color: #04111f;
  font-weight: 800;
}

.provider-button {
  background: rgba(8, 14, 30, 0.64);
  font-weight: 700;
}

.primary-button:disabled,
.provider-button:disabled,
.link-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.primary-button:hover,
.primary-button:focus-visible,
.provider-button:hover,
.provider-button:focus-visible,
.link-button:hover,
.link-button:focus-visible {
  border-color: var(--control-border-strong);
  box-shadow: 0 0 18px rgba(39, 208, 255, 0.28);
}

.primary-button:hover,
.primary-button:focus-visible {
  filter: brightness(1.04);
}

.auth-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 6px;
}

.auth-links--single {
  margin-top: 10px;
}

.link-button {
  width: 100%;
  height: var(--input-height);
  min-height: var(--input-height);
  padding: 0 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--control-border);
  background: rgba(8, 14, 30, 0.64);
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 700;
  white-space: nowrap;
}

.auth-message {
  min-height: 22px;
  margin: 14px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

.auth-message.is-error {
  color: #ff9eb0;
}

.auth-message.is-success {
  color: #87f0ff;
}

@media (max-width: 540px) {
  .auth-shell {
    width: min(440px, calc(100vw - 20px));
  }

  .auth-header {
    margin-bottom: 14px;
  }
}
