:root {
  --bg: #07070b;
  --bg-soft: #0d0d14;
  --fg: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #71717a;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.14);
  --violet: #8b5cf6;
  --indigo: #6366f1;
  --cyan: #22d3ee;
  --green: #34d399;
  --red: #f87171;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
}

body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(139, 92, 246, 0.45);
  color: #fff;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid transparent;
  border-radius: 10px;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
  background-clip: padding-box;
}

/* ---------- Background ---------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  will-change: transform;
}

.orb-a {
  width: 520px;
  height: 520px;
  top: -160px;
  left: -120px;
  opacity: 0.5;
  background: radial-gradient(circle at 30% 30%, var(--violet), transparent 70%);
  animation: drift-a 16s ease-in-out infinite alternate;
}

.orb-b {
  width: 480px;
  height: 480px;
  right: -140px;
  bottom: -180px;
  opacity: 0.35;
  background: radial-gradient(circle at 60% 40%, var(--cyan), transparent 70%);
  animation: drift-b 18s ease-in-out infinite alternate;
}

.orb-c {
  width: 360px;
  height: 360px;
  top: 45%;
  left: 55%;
  opacity: 0.14;
  background: radial-gradient(circle at 50% 50%, #ec4899, transparent 70%);
  animation: drift-c 22s ease-in-out infinite alternate;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 45%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 60% at 50% 45%, #000 20%, transparent 75%);
}

/* ---------- Logo ---------- */
.logo-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--violet), var(--indigo) 45%, var(--cyan));
  box-shadow:
    0 10px 30px -8px rgba(139, 92, 246, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.logo-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 55%);
  pointer-events: none;
}

.logo-mark svg {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  fill: #fff;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn-primary {
  background: linear-gradient(135deg, var(--violet), var(--indigo));
  color: #fff;
  box-shadow:
    0 10px 30px -10px rgba(139, 92, 246, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  color: #e4e4e7;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line-strong);
}

.btn-google {
  width: 100%;
  background: #fff;
  border-color: #fff;
  color: #18181b;
}

.btn-google:hover:not(:disabled) {
  background: #f4f4f5;
}

.btn-google svg {
  flex: none;
  width: 18px;
  height: 18px;
}

.btn-sm {
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 0.85rem;
}

/* ---------- Inputs ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #c4c4cc;
  letter-spacing: 0.01em;
}

.input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--fg);
  font-size: 0.94rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input::placeholder {
  color: #5b5b66;
}

.input:focus {
  border-color: rgba(139, 92, 246, 0.65);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

/* ---------- Avatar ---------- */
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 100;
  max-width: min(90vw, 440px);
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #18181f;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  color: #e4e4e7;
  font-size: 0.86rem;
  text-align: center;
  transform: translateX(-50%);
}

.toast.error {
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecaca;
}

.toast.success {
  border-color: rgba(52, 211, 153, 0.4);
  color: #a7f3d0;
}

/* ---------- Landing nav ---------- */
.site-nav {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 48px);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-brand .logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  box-shadow: none;
}

.site-brand .logo-mark svg {
  width: 17px;
  height: 17px;
}

.site-nav nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav nav > a:not(.btn) {
  padding: 8px 10px;
  color: #c4c4cc;
  font-size: 0.9rem;
}

.site-nav nav > a:not(.btn):hover {
  color: #fff;
}

/* ---------- Spinner ---------- */
.spinner {
  width: 26px;
  height: 26px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--violet);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.small {
  width: 18px;
  height: 18px;
}

/* ---------- Animations ---------- */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes drift-a {
  to {
    transform: translate(80px, 60px) scale(1.08);
  }
}

@keyframes drift-b {
  to {
    transform: translate(-70px, -50px) scale(1.12);
  }
}

@keyframes drift-c {
  to {
    transform: translate(-40px, 60px) scale(0.92);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
