
* { box-sizing: border-box; }

:root {
  --bg: #f4f4f5;
  --fg: #18181b;
  --muted: #71717a;
  --line: #d4d4d8;
  --field: #ffffff;
  --accent: #3f3f46;
  --error: #b91c1c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18181b;
    --fg: #f4f4f5;
    --muted: #a1a1aa;
    --line: #3f3f46;
    --field: #27272a;
    --accent: #e4e4e7;
    --error: #f87171;
  }
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

@supports (min-height: 100dvh) { body { min-height: 100dvh; } }

.box {
  width: 100%;
  max-width: 340px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}

form { display: flex; flex-direction: column; gap: 10px; }

h1 { margin: 0 0 6px; font-size: 1.15rem; font-weight: 600; }

label { font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: -4px; }

input[type="text"], input[type="password"] {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

#ssoBlock { display: flex; flex-direction: column; gap: 10px; }

a.primary {
  display: block;
  min-height: 44px;
  line-height: 44px;
  text-align: center;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border-radius: 8px;
  text-decoration: none;
}

button[type="submit"] {
  min-height: 44px;
  margin-top: 6px;
  font: inherit;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

button[type="submit"]:disabled { opacity: .6; cursor: not-allowed; }

.hint { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }

.linkish {
  padding: 4px 0;
  font: inherit;
  font-size: .8rem;
  color: var(--muted);
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}

#loginError, #noJs {
  margin: 0;
  min-height: 1.1em;
  font-size: .85rem;
  color: var(--error);
}

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

[hidden] { display: none !important; }
