:root {
  --bg: #0e0e0d;
  --bg-elevated: #171715;
  --fg: #e7e5df;
  --fg-muted: color-mix(in oklab, var(--fg) 68%, transparent);
  --heather: #cfc5d1;
  --heather-soft: color-mix(in oklab, var(--heather) 22%, transparent);
  --border: color-mix(in oklab, var(--fg) 14%, transparent);
  --border-strong: color-mix(in oklab, var(--fg) 28%, transparent);
  --primary: #e7e2d5;
  --primary-fg: #141413;
  --danger: #d9897a;
  --radius: 14px;
  --font-sans: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --shadow: 0 24px 80px color-mix(in oklab, #000 55%, transparent);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  overflow: hidden;
}

.atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 18% 18%, color-mix(in oklab, var(--heather) 18%, transparent), transparent 60%),
    radial-gradient(ellipse 55% 45% at 88% 78%, color-mix(in oklab, #8a9a8c 12%, transparent), transparent 55%),
    linear-gradient(160deg, #121211 0%, #0e0e0d 45%, #151412 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(color-mix(in oklab, var(--fg) 4%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in oklab, var(--fg) 4%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  animation: grid-drift 28s linear infinite;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: float 12s ease-in-out infinite;
}

.orb-a {
  width: 280px;
  height: 280px;
  top: 8%;
  left: 6%;
  background: color-mix(in oklab, var(--heather) 40%, transparent);
}

.orb-b {
  width: 360px;
  height: 360px;
  right: -4%;
  bottom: 4%;
  background: color-mix(in oklab, #6f7f72 28%, transparent);
  animation-delay: -4s;
}

.panel {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: clamp(1.75rem, 4vw, 2.35rem);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: color-mix(in oklab, var(--bg-elevated) 88%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  animation: rise 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.brand img {
  width: 132px;
  height: auto;
  display: block;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--heather);
}

.brand-mark::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--heather);
  box-shadow: 0 0 0 4px var(--heather-soft);
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.85rem, 5vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brand h1 span {
  display: block;
  color: var(--fg-muted);
  font-weight: 500;
  font-size: 0.52em;
  letter-spacing: 0.02em;
  margin-top: 0.35rem;
}

.lede {
  margin: 0 0 1.5rem;
  color: var(--fg-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label {
  font-size: 0.82rem;
  font-weight: 500;
  color: color-mix(in oklab, var(--fg) 82%, transparent);
}

.field input {
  width: 100%;
  appearance: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in oklab, #000 28%, var(--bg));
  color: var(--fg);
  font: inherit;
  font-size: 1rem;
  padding: 0.85rem 1rem;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input::placeholder {
  color: color-mix(in oklab, var(--fg) 38%, transparent);
}

.field input:hover {
  border-color: var(--border-strong);
}

.field input:focus {
  border-color: color-mix(in oklab, var(--heather) 70%, white);
  box-shadow: 0 0 0 3px var(--heather-soft);
  background: color-mix(in oklab, #000 18%, var(--bg));
}

.actions {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.35rem;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.95rem 1.1rem;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
}

.btn-primary:hover {
  background: color-mix(in oklab, var(--primary) 88%, white);
}

.btn-primary:active {
  transform: translateY(1px);
}

.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.meta a {
  color: var(--heather);
  text-decoration: none;
}

.meta a:hover {
  text-decoration: underline;
}

.form-message {
  display: none;
  margin: 0 0 0.25rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--danger) 40%, transparent);
  background: color-mix(in oklab, var(--danger) 12%, transparent);
  color: color-mix(in oklab, var(--danger) 85%, white);
  font-size: 0.88rem;
}

.form-message.is-visible {
  display: block;
  animation: rise 400ms ease both;
}

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

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(12px, -18px, 0);
  }
}

@keyframes grid-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(32px, 32px, 0);
  }
}

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

@media (max-width: 480px) {
  .panel {
    width: 100%;
  }

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