/* auth.css - the server-rendered pages: sign in, first-run setup, accept an invite, OAuth consent.
   Colours, radius and fonts match lib/ui/site/site.css and the app. */

:root {
  color-scheme: light dark;
  --bg: #fbfaf7;
  --card: #ffffff;
  --card-2: #f3f1eb;
  --ink: #15171a;
  --ink-2: #4b505a;
  --ink-3: #6f747d;
  --line: #e4e1d8;
  --line-strong: #cfcbbf;
  --accent: #0e6b52;
  --accent-2: #0a5641;
  --accent-ink: #ffffff;
  --accent-soft: #e1efe9;
  --neg: #b42318;
  --neg-bg: #fdeceb;
  --shadow: 0 1px 2px rgb(20 20 20 / .04), 0 10px 28px rgb(20 20 20 / .06);
  --radius: 14px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101214;
    --card: #1a1d21;
    --card-2: #22262b;
    --ink: #ecebe6;
    --ink-2: #b4b8be;
    --ink-3: #8a8f97;
    --line: #2a2e33;
    --line-strong: #3a3f46;
    --accent: #45c79b;
    --accent-2: #62d6ae;
    --accent-ink: #062a1e;
    --accent-soft: #14322a;
    --neg: #f28a7f;
    --neg-bg: #3a1c19;
    --shadow: 0 1px 2px rgb(0 0 0 / .3);
  }
}
:root[data-theme="dark"] {
    --bg: #101214;
    --card: #1a1d21;
    --card-2: #22262b;
    --ink: #ecebe6;
    --ink-2: #b4b8be;
    --ink-3: #8a8f97;
    --line: #2a2e33;
    --line-strong: #3a3f46;
    --accent: #45c79b;
    --accent-2: #62d6ae;
    --accent-ink: #062a1e;
    --accent-soft: #14322a;
    --neg: #f28a7f;
    --neg-bg: #3a1c19;
    --shadow: 0 1px 2px rgb(0 0 0 / .3);
  }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--sans); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

main.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px 48px; }
main.auth::before { content: ""; display: block; width: 40px; height: 40px; margin-bottom: 20px; background: url("/favicon.svg") center / contain no-repeat; }

.card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; }
h1 { font-size: 22px; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; margin: 0 0 18px; }
.card h1 + .note { margin-top: -10px; }
label { display: block; font-weight: 600; font-size: 13.5px; margin: 0 0 6px; color: var(--ink); }
input, select, textarea { width: 100%; min-height: 42px; padding: 0 12px; margin: 0 0 16px; font: inherit; font-size: 16px; color: var(--ink); background: var(--card); border: 1px solid var(--line-strong); border-radius: 10px; }
textarea { padding: 10px 12px; min-height: 90px; }
input[type="checkbox"], input[type="radio"] { width: 16px; min-height: 16px; height: 16px; margin: 0 8px 0 0; accent-color: var(--accent); vertical-align: -2px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 0; border-color: var(--accent); }
button, .btn-alt { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 16px; font: 600 15px/1.2 var(--sans); border-radius: 10px; cursor: pointer; text-decoration: none; }
button { margin-top: 4px; color: var(--accent-ink); background: var(--accent); border: 1px solid var(--accent); }
button:hover { background: var(--accent-2); border-color: var(--accent-2); }
button + button, button + .btn-alt, .btn-alt + button { margin-top: 10px; }
.err { margin: 14px 0 0; padding: 10px 12px; font-size: 14px; color: var(--neg); background: var(--neg-bg); border-radius: 10px; }
.note { margin: 0 0 18px; font-size: 14px; color: var(--ink-2); }
.card > .note:last-child { margin: 18px 0 0; text-align: center; }
.card ul { margin: 0 0 18px; padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.card code { font-size: 13px; background: var(--card-2); padding: 1px 5px; border-radius: 5px; }

.alt { display: grid; gap: 10px; margin-top: 18px; }
.alt > span { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.alt > span::before, .alt > span::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-alt { color: var(--ink); background: var(--card); border: 1px solid var(--line); }
.btn-alt:hover { border-color: var(--ink-3); color: var(--ink); background: var(--card); }

@media (max-width: 440px) {
  main.auth { justify-content: flex-start; padding-top: 40px; }
  .card { padding: 22px 18px; }
}

/* a chosen theme wins over the OS setting (theme.js sets data-theme before first paint) */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
