:root {
  --page: #ffffff;
  --panel: #f5f5f5;
  --raised: #ffffff;
  --text: #1d1d1d;
  --muted: #6e6e6e;
  --line: #d2d2d2;
  --soft: #ebebeb;
  --focus: rgb(0 0 0 / 14%);
  --danger: #343434;
  color-scheme: light;
  color: var(--text);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter,
    "PingFang SC", "Noto Sans CJK SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; min-height: 100dvh; background: var(--page); }

button, input { font: inherit; }

.auth-shell {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  min-height: 100dvh;
}

.brand-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: 19px 18px 22px;
  background: color-mix(in srgb, var(--panel) 42%, var(--page));
  border-right: 1px solid var(--line);
}

.brand-lockup { display: flex; gap: 10px; align-items: center; }

.brand-mark {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--page);
  background: var(--text);
  border: 1px solid var(--text);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 12%);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.brand-copy { display: grid; gap: 2px; min-width: 0; }
.brand-copy strong { font-size: 17px; font-weight: 800; line-height: 1.1; }
.brand-copy span, .access-label { color: var(--muted); font-size: 11px; }

.brand-rule {
  width: 1px;
  min-height: 96px;
  margin: 30px 0 14px 19px;
  flex: 1 1 auto;
  background: linear-gradient(to bottom, var(--line), transparent);
}

.access-label { margin: 0 0 0 1px; }

.auth-workspace {
  display: grid;
  grid-template-rows: 1fr;
  min-width: 0;
  min-height: 100dvh;
  padding: 32px;
}

.auth-panel {
  align-self: center;
  width: min(100%, 420px);
  margin: 44px auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
}

.auth-header { margin-bottom: 26px; }
.auth-header h1 { margin: 6px 0 9px; font-size: 24px; line-height: 1.2; }
.auth-header > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.eyebrow { margin: 0; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }

.auth-form { display: grid; gap: 9px; }
.auth-form label { margin-top: 2px; font-size: 13px; font-weight: 600; }

.auth-form input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--text);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.auth-form input::placeholder { color: var(--muted); opacity: .72; }
.auth-form input:hover { border-color: var(--text); }
.auth-form input:focus { border-color: var(--text); box-shadow: 0 0 0 3px var(--focus); }
.code-input { font-variant-numeric: tabular-nums; }

.auth-form button, .primary-link, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 8px;
  padding: 0 16px;
  border: 1px solid var(--text);
  border-radius: 8px;
  font-weight: 650;
  cursor: pointer;
}

.auth-form button, .primary-link { color: var(--page); background: var(--text); }
.auth-form button:hover, .primary-link:hover { filter: contrast(1.15); }
.auth-form button:focus-visible, .primary-link:focus-visible, .secondary-button:focus-visible, .text-link:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.notice {
  margin: -8px 0 20px;
  padding: 11px 12px;
  color: var(--text);
  background: var(--panel);
  border-left: 3px solid var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.notice-error { color: var(--danger); }
.text-link { display: inline-block; margin-top: 18px; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.primary-link { width: 100%; text-decoration: none; }
.logout-form { margin-top: 10px; }
.secondary-button { width: 100%; color: var(--text); background: var(--raised); }
.signed-email { overflow-wrap: anywhere; }

@media (prefers-color-scheme: dark) {
  :root {
    --page: #000000;
    --panel: #1c1c1c;
    --raised: #1c1c1c;
    --text: #f5f5f5;
    --muted: #989898;
    --line: #383838;
    --soft: #202020;
    --focus: rgb(255 255 255 / 18%);
    --danger: #cecece;
    color-scheme: dark;
  }
}

@media (max-width: 700px) {
  .auth-shell { grid-template-columns: 1fr; grid-template-rows: 64px minmax(0, 1fr); }
  .brand-rail { min-height: 0; padding: 13px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand-mark { width: 38px; height: 38px; }
  .brand-rule, .access-label { display: none; }
  .auth-workspace { min-height: calc(100dvh - 64px); padding: 18px 16px 16px; }
  .auth-panel { align-self: start; width: 100%; margin: 34px 0 0; padding: 0; border: 0; background: transparent; }
}

@media (max-width: 380px) {
  .auth-header h1 { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
