/* Login page. GitHub-like neutrals, light and dark, matching the apps it protects. */
:root {
  color-scheme: light;
  --bg: #f6f8fa; --surface: #ffffff; --border: #d1d9e0;
  --fg: #1f2328; --muted: #59636e;
  --accent: #7c3aed; --accent-hover: #6d28d9; --accent-fg: #ffffff; --focus: #7c3aed40;
  --btn: #f6f8fa; --btn-hover: #eef1f4;
  --danger: #d1242f; --danger-bg: #ffebe9; --danger-border: #ff818266;
  --shadow: 0 1px 0 #1f23280a, 0 1px 3px #1f23280f;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0d1117; --surface: #151b23; --border: #3d444d;
    --fg: #f0f6fc; --muted: #9198a1;
    --accent: #a78bfa; --accent-hover: #c4b5fd; --accent-fg: #0d1117; --focus: #a78bfa66;
    --btn: #212830; --btn-hover: #2a313c;
    --danger: #f85149; --danger-bg: #25171c; --danger-border: #f8514966;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.auth { width: 100%; max-width: 368px; margin: 0 auto; padding: 56px 16px 32px; }
.logo { display: block; width: 48px; height: 48px; margin: 0 auto 20px; }
h1 { margin: 0; font-size: 24px; font-weight: 300; letter-spacing: -0.01em; text-align: center; }
.sub { min-height: 1.5em; margin: 4px 0 16px; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.card { padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.stack { display: grid; gap: 10px; }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; margin-bottom: 6px; font-weight: 500; }
.input { width: 100%; height: 36px; padding: 5px 12px; color: var(--fg); font: 14px var(--sans); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; outline: none; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
@media (max-width: 600px) { .input { height: 40px; font-size: 16px; } } /* 16px keeps iOS from zooming in */
.check { display: flex; align-items: center; gap: 8px; margin: -2px 0 16px; color: var(--muted); cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  color: var(--fg); font: 500 14px var(--sans); white-space: nowrap; text-decoration: none; cursor: pointer;
  background: var(--btn); border: 1px solid var(--border); border-radius: 6px; }
.btn:hover { background: var(--btn-hover); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:disabled:hover { background: var(--btn); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { color: var(--accent-fg); background: var(--accent); border-color: transparent; }
.btn-primary:hover, .btn-primary:disabled:hover { background: var(--accent-hover); }
.btn-block { width: 100%; height: 40px; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand-icon { width: 16px; height: 16px; fill: currentColor; }
.providers { display: grid; gap: 8px; }
.soon { margin-left: 6px; padding: 0 6px; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 18px;
  border: 1px solid var(--border); border-radius: 2em; }
.provider .soon { position: absolute; right: 10px; }

.divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.flash { margin: 0 0 16px; padding: 10px 14px; font-size: 14px; border: 1px solid; border-radius: 6px; }
.flash.err { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); }
.card > .flash:only-child { margin: 0; }
.box-below { margin: 16px 0 0; padding: 16px; text-align: center; border: 1px solid var(--border); border-radius: 8px; }
.box-below a[aria-disabled] { color: var(--muted); cursor: default; text-decoration: none; }
.small-link { justify-self: center; margin-top: 4px; font-size: 13px; }
.legal { margin-top: 32px; color: var(--muted); font-size: 12px; text-align: center; }

/* Account page */
h2 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.card h2:not(:first-child), #providers-box { margin-top: 20px; }
.items { margin: 0 0 12px; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: 6px; }
.items:empty { display: none; }
.items li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--border); }
.items li:first-child { border-top: 0; }
.item-text { display: grid; flex: 1; min-width: 0; }
.item-name { font-weight: 500; overflow-wrap: anywhere; }
.item-meta { color: var(--muted); font-size: 12px; }
.btn-small { height: 30px; padding: 0 10px; font-size: 13px; }
.hint.left { margin: 0 0 12px; text-align: left; }
.below { margin-top: 16px; }
