﻿: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: 58px;
  --button-radius: 18px;
  --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;
  }

  .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: 28px;
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.auth-app-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 82px;
  height: 82px;
  padding: 0;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
}

.auth-app-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.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.25rem, 6vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.auth-subtitle {
  margin: 0;
  max-width: 320px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.form-stage {
  position: static;
  min-height: 0;
  transition: none;
}

.auth-form {
  position: static;
  display: grid;
  gap: var(--form-gap);
  align-content: start;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition: none;
}

.auth-form--social {
  gap: 14px;
}

.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: var(--button-radius);
  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 {
  width: 100%;
  min-height: var(--input-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 14, 30, 0.64);
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.16);
}

.provider-button__content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.provider-button__icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
}

.provider-button__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.provider-button__label {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.provider-button--apple {
  background: #050505;
  border-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.provider-button--google {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.82);
  box-shadow: 0 14px 30px rgba(255, 255, 255, 0.12);
}

.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);
}

.provider-button:hover,
.provider-button:focus-visible {
  transform: translateY(-1px);
}

.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: 18px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.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: 22px;
  }
}
