/* Login / first-account pages. Same tokens as the app (style.css) so the
   handoff into the product is seamless; kept separate because these pages
   are served before there is a session. */
:root {
  color-scheme: light dark;
  --bg: #f5f5f7; --fg: #1d1d1f; --muted: #6e6e73; --card: #ffffff; --line: #d9d9de; --line-strong: #c4c4cb;
  --accent: #0a84ff; --accent-hover: #0b76e3; --accent-fg: #fff; --danger: #d0342c; --chip: #eef0f4;
  --ring: rgba(10, 132, 255, .28);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 32px -12px rgba(29, 29, 31, .18);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111114; --fg: #f2f2f7; --muted: #9a9aa3; --card: #1c1c21; --line: #303038; --line-strong: #3d3d46;
    --accent-hover: #2f95ff; --chip: #26262d; --danger: #ff6b62; --ring: rgba(10, 132, 255, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%; display: grid; place-items: center;
  padding: 40px 16px 24px; background: var(--bg); color: var(--fg); accent-color: var(--accent);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--ring); }

.auth { width: 100%; max-width: 400px; align-self: center; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 0 20px 4px; }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 22px; height: 22px; display: block; }
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.brand-sub { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px;
  box-shadow: var(--shadow);
}
@media (max-width: 420px) { .card { padding: 22px 20px; } body { padding-top: 24px; } }

h1 { font-size: 22px; line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 6px; text-wrap: balance; }
.lead { margin: 0 0 22px; color: var(--muted); font-size: 14px; text-wrap: pretty; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted); }
.control { position: relative; }
input:not([type=checkbox]) {
  width: 100%; height: 44px; font: inherit; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--card); color: inherit; caret-color: var(--accent);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line-strong)); }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
input:user-invalid { border-color: var(--danger); }
input:user-invalid:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 30%, transparent); }
.control.with-toggle input { padding-right: 84px; }
/* Browser autofill paints its own yellow/blue box; keep it on the card colour. */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--fg); -webkit-box-shadow: 0 0 0 1000px var(--card) inset; transition: background-color 9999s ease-out 0s;
}

.toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--accent); background: transparent; border: 0;
  padding: 6px 8px; border-radius: 7px; cursor: pointer;
}
.toggle:hover { background: var(--chip); }
.toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.alert {
  display: none; align-items: flex-start; gap: 8px; margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px;
  color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--card));
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
}
.alert[data-show] { display: flex; }
.alert svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

.submit {
  width: 100%; height: 46px; margin-top: 4px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-fg);
  font: inherit; font-size: 15px; font-weight: 600; letter-spacing: -0.005em; cursor: pointer;
  transition: background-color 150ms ease, transform 100ms ease;
}
.submit:hover { background: var(--accent-hover); }
.submit:active { transform: translateY(1px); }
.submit:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring), 0 0 0 1px var(--card) inset; }
.submit[disabled] { opacity: .7; cursor: progress; }

.foot { margin: 20px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); text-align: center; text-wrap: pretty; }
.foot a { color: var(--accent); text-decoration: none; }
.foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
