:root {
  color-scheme: light;
  --bg: #f6f5ef;
  --surface: #ffffff;
  --text: #20201d;
  --muted: #6b6f68;
  --line: #d9ddd4;
  --brand: #1f6f64;
  --brand-strong: #174f49;
  --warn: #9f3a38;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--surface);
  font-weight: 800;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:where(a, button, input):focus-visible {
  outline: 3px solid #005fcc;
  outline-offset: 3px;
}

[aria-invalid="true"] {
  border-color: var(--warn);
  box-shadow: 0 0 0 2px rgba(159, 58, 56, 0.2);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 24px;
  box-shadow: 0 18px 45px rgba(30, 35, 31, 0.12);
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.1;
}

.helper-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.setup-box {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
  padding: 12px;
}

.setup-box code {
  color: var(--brand-strong);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.qr-code-box {
  width: min(220px, 100%);
  aspect-ratio: 1;
  place-self: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.qr-code-box:empty {
  display: none;
}

.qr-code-box svg {
  display: block;
  width: 100%;
  height: 100%;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

input {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--brand-strong);
}

@media (forced-colors: active) {
  :where(a, button, input):focus-visible {
    outline: 3px solid Highlight;
  }
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--warn);
  font-weight: 800;
}

@media (max-width: 480px) {
  .login-shell {
    align-items: start;
    padding: 10px;
  }

  .login-panel {
    gap: 12px;
    padding: 16px;
  }

  .eyebrow {
    font-size: 0.68rem;
  }

  h1 {
    font-size: 1.45rem;
  }

  .helper-text {
    font-size: 0.9rem;
  }

  .setup-box {
    padding: 10px;
  }

  .qr-code-box {
    width: min(180px, 100%);
    padding: 7px;
  }
}
