:root {
  color-scheme: light;
  --canvas: #f6f8fa;
  --surface: #fff;
  --ink: #172433;
  --muted: #5f6c7c;
  --border: #e7ebef;
  --field: #86939f;
  --accent: #087f61;
  --accent-hover: #06694f;
  --accent-ink: #087f61;
  --mint: #eaf7f2;
  --danger: #962d32;
  --shadow: 0 2px 6px rgb(23 36 51 / 5%), 0 20px 44px -24px rgb(23 36 51 / 30%);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --canvas: #0c1411;
    --surface: #131d19;
    --ink: #e6efeb;
    --muted: #a3b7ae;
    --border: #32423a;
    --field: #5d7268;
    --accent-ink: #74d6b0;
    --mint: #1a3a2f;
    --danger: #ff9496;
    --shadow: 0 2px 6px rgb(0 0 0 / 30%), 0 20px 44px -24px rgb(0 0 0 / 65%);
  }
}

* { box-sizing: border-box; }

body {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: radial-gradient(ellipse at 50% 0, var(--mint), transparent 60%), var(--canvas);
  color: var(--ink);
  font: 1rem/1.5 'DM Sans', system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.auth-content {
  display: grid;
  place-items: center;
  padding: clamp(24px, 6vh, 60px) var(--atlas-content-gutter);
}

.auth-card {
  --auth-inset: clamp(22px, 6vw, 36px);
  width: min(100%, 428px);
  border: 1px solid var(--border);
  border-radius: var(--atlas-radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  padding: 14px var(--auth-inset);
  border-radius: calc(var(--atlas-radius) - 1px) calc(var(--atlas-radius) - 1px) 0 0;
  background: #10372e;
}

.auth-brand a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: var(--atlas-radius);
}

.auth-brand img {
  display: block;
  width: 82px;
  height: auto;
}

.auth-brand a:focus-visible { outline-color: #98e3c4; }

.auth-body { padding: clamp(24px, 6vw, 32px) var(--auth-inset); }
.auth-heading { margin-bottom: 24px; }

.auth-heading h1 {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.03em;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-field label {
  display: block;
  margin-bottom: 6px;
  font-size: .875rem;
  font-weight: 650;
}

.auth-field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--field);
  border-radius: var(--atlas-radius);
  background: var(--surface);
  color: inherit;
  font: inherit;
}

.auth-field input:focus { border-color: var(--accent-ink); }
.auth-field input[aria-invalid="true"] { border-color: var(--danger); }

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
}

.auth-submit,
.auth-return {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--atlas-radius);
  font: inherit;
  font-weight: 650;
  text-align: center;
}

.auth-submit {
  margin-top: 4px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.auth-submit:hover { background: var(--accent-hover); }

.auth-return {
  margin-top: 8px;
  color: var(--accent-ink);
  text-decoration: none;
}

.auth-return:hover {
  background: var(--mint);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-form .errorlist {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--danger);
  font-size: .875rem;
}

.auth-form .errorlist.nonfield {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--surface));
  border-radius: var(--atlas-radius);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

.auth-field .errorlist,
.auth-field .helptext {
  display: block;
  margin-top: 6px;
}

.auth-field .helptext {
  color: var(--muted);
  font-size: .875rem;
}
