:root {
  color-scheme: light dark;
  --ui-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --surface-0: #ffffff;
  --surface-2: #f4f4f5;
  --border: #e4e4e7;
  --foreground: #1a1a1e;
  --muted: #71717a;
  --accent: #20744a;
  --accent-fg: #ffffff;
  --destructive: #b04138;
  --ring: #239956;
  --ring-soft: rgba(32, 116, 74, 0.22);
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface-0: #181b1a;
    --surface-2: #272a29;
    --border: #252b2a;
    --foreground: #fafafa;
    --muted: #a1a5a4;
    --accent: #20744a;
    --accent-fg: #ffffff;
    --destructive: #c64f43;
    --ring: #7ccba0;
    --ring-soft: rgba(124, 203, 160, 0.28);
  }
}

* { box-sizing: border-box; }

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

body {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--surface-0);
  color: var(--foreground);
  font-family: var(--ui-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.login {
  width: min(320px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo {
  width: 48px;
  height: 48px;
  display: block;
  color: var(--foreground);
}

.brand {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--foreground);
}

.form {
  width: 100%;
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--foreground);
  font: 400 16px/1 var(--ui-font);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field::placeholder { color: var(--muted); }

.field:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring-soft);
}

.error {
  margin: -2px 0 0;
  min-height: 16px;
  font-size: 12px;
  line-height: 16px;
  color: var(--destructive);
}

.error:empty { display: none; }

.button {
  height: 44px;
  border: 0;
  border-radius: 9999px;
  background: var(--accent);
  color: var(--accent-fg);
  font: 500 14px/1 var(--ui-font);
  cursor: pointer;
  transition: filter 120ms ease;
}

.button:hover { filter: brightness(1.08); }
.button:active { filter: brightness(0.94); }
.button:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 600px) {
  .field { font-size: 14px; }
}

@media (max-width: 480px) {
  .form { margin-top: 28px; }
}

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