:root {
  color-scheme: light;
  --ink: #1A1A1A;
  --paper: #F2F2F2;
  --line: color-mix(in srgb, var(--ink) 18%, transparent);
  --muted: color-mix(in srgb, var(--ink) 62%, transparent);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1.08fr) minmax(420px, .92fr); }
.auth-intro { position: relative; display: flex; flex-direction: column; min-height: 100vh; padding: clamp(28px, 5vw, 72px); border-right: 1px solid var(--line); overflow: hidden; }
.auth-intro::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .32; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom right, black, transparent 72%); }
.brand { position: relative; z-index: 1; width: fit-content; display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.brand span { font-size: 20px; letter-spacing: -.04em; }
.brand b, .brand em { font-style: normal; }
.brand em { font-weight: 400; }
.intro-copy { position: relative; z-index: 1; margin: auto 0; max-width: 710px; padding: 80px 0; }
.eyebrow, .panel-index { margin: 0 0 24px; font: 700 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; }
.intro-copy h1 { margin: 0; max-width: 760px; font: 500 clamp(46px, 6.2vw, 88px)/.94 Georgia, "Times New Roman", serif; letter-spacing: -.055em; }
.intro-copy > p:last-child { max-width: 570px; margin: 28px 0 0; color: var(--muted); font-size: clamp(16px, 1.5vw, 20px); line-height: 1.65; }
.workflow { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.workflow li { display: grid; gap: 12px; padding: 18px 18px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.workflow span { color: var(--ink); font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }

.auth-panel { display: flex; flex-direction: column; justify-content: center; width: min(100%, 610px); min-height: 100vh; margin: 0 auto; padding: clamp(32px, 7vw, 88px); }
.panel-heading h2 { margin: 0; font: 500 clamp(36px, 4vw, 54px)/1 Georgia, "Times New Roman", serif; letter-spacing: -.04em; }
.panel-heading > p:last-child { margin: 14px 0 0; color: var(--muted); line-height: 1.55; }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 36px 0 28px; border-bottom: 1px solid var(--line); }
.mode-tab { padding: 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.mode-tab.is-active { border-color: var(--ink); color: var(--ink); font-weight: 700; }
.form-status { margin-bottom: 18px; padding: 12px 14px; border-left: 3px solid var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); font-size: 13px; line-height: 1.45; }
.auth-form { display: none; gap: 18px; }
.auth-form.is-active { display: grid; }
.auth-form label { display: grid; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.auth-form input { width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 0; outline: none; background: transparent; color: var(--ink); }
.auth-form input:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.field-hint { margin: -12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.form-row { display: flex; justify-content: flex-end; margin-top: -8px; }
.text-button { width: fit-content; padding: 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; font-size: 12px; }
.back-button { justify-self: center; margin-top: -4px; }
.submit-button, .google-button { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); text-decoration: none; cursor: pointer; font-weight: 700; }
.submit-button:disabled, .code-button:disabled { cursor: wait; opacity: .55; }
.code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.code-button { min-height: 50px; padding: 0 15px; border: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; white-space: nowrap; font-size: 12px; font-weight: 700; }
.divider { display: flex; align-items: center; gap: 12px; margin: 26px 0; color: var(--muted); font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.google-button { justify-content: center; background: transparent; color: var(--ink); }
.google-mark { display: block; width: 20px; height: 20px; flex: 0 0 auto; }
.legal { margin: 22px 0 0; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.5; }
.legal a { color: var(--ink); }

@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --ink: #F2F2F2; --paper: #1A1A1A; }
}
@media (max-width: 880px) {
  .auth-shell { display: block; }
  .auth-intro { min-height: auto; padding-bottom: 34px; border-right: 0; border-bottom: 1px solid var(--line); }
  .intro-copy { padding: 70px 0; }
  .intro-copy h1 { font-size: clamp(44px, 12vw, 72px); }
  .auth-panel { min-height: auto; padding-top: 56px; padding-bottom: 56px; }
}
@media (max-width: 540px) {
  .workflow { grid-template-columns: 1fr; }
  .workflow li { grid-template-columns: 34px 1fr; gap: 4px; padding-top: 14px; }
  .auth-panel { padding-inline: 22px; }
  .code-row { grid-template-columns: 1fr; }
  .code-button { width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .auth-panel { animation: enter .45s ease-out both; }
  @keyframes enter { from { opacity: 0; transform: translateY(10px); } }
}

html[data-theme="light"] { color-scheme: light; --ink: #1A1A1A; --paper: #F2F2F2; }
html[data-theme="dark"] { color-scheme: dark; --ink: #F2F2F2; --paper: #1A1A1A; }

/* Readability pass for supporting account copy. */
.eyebrow,
.panel-index,
.workflow span { font-size: 12px; }
.workflow li { font-size: 14px; }
.auth-form label,
.field-hint,
.text-button,
.code-button { font-size: 13px; }
.divider,
.legal { font-size: 12px; }
