body {
  --bg: #fefefe;
  --bg-warm: #f2f2f0;
  --card: #fff;
  --ink: #202020;
  --ink-mid: #4f4f4b;
  --muted: #6f6f6b;
  --line: #e6e6e3;
  --rust: #e85d24;
  --rust-dark: #c94a18;
  --rust-dim: #fff0e9;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -.008em;
}

::selection { background: #ffe0d2; color: var(--ink); }

.split {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: minmax(390px, 44%) minmax(420px, 1fr);
}

.split-left {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: clamp(30px, 4vw, 54px);
  background: #f8f8f7;
  color: var(--ink);
}

.login-story {
  display: flex;
  width: min(100%, 540px);
  margin: auto 0;
  flex-direction: column;
  gap: clamp(38px, 7vh, 64px);
  padding: 60px 0;
}

.login-story-copy h2 {
  max-width: 500px;
  color: #171717;
  font-size: clamp(36px, 4.1vw, 58px);
  font-weight: 560;
  line-height: 1.02;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.login-story-copy p {
  max-width: 48ch;
  margin-top: 18px;
  color: var(--ink-mid);
  font-size: 15px;
  line-height: 1.65;
}

.works-with-title {
  max-width: 42ch;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.integration-list {
  display: grid;
  max-width: 520px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0;
  border-block: 1px solid var(--line);
  list-style: none;
}

.integration-list li {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 15px 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.integration-list li + li { border-left: 1px solid var(--line); }

.integration-logo {
  display: grid;
  width: 30px;
  height: 30px;
  flex: none;
  place-items: center;
  border-radius: 7px;
  background: #fff;
}

.integration-logo img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.private-workspace-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.private-workspace-note svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.split-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(40px, 7vw, 88px);
  background: var(--bg);
}

.auth-col { width: 100%; max-width: 410px; }

.auth-col h1 {
  margin-bottom: 26px;
  color: #171717;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(30px, 3vw, 38px);
  font-weight: 620;
  line-height: 1.14;
  letter-spacing: -.035em;
  text-align: left;
  text-wrap: balance;
}

.auth-sub {
  max-width: 46ch;
  margin: -12px 0 24px;
  color: var(--ink-mid);
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
}

.auth-sub strong { color: var(--ink); font-weight: 600; }

#step-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#step-loading h1 { margin-bottom: 12px; text-align: center; }
#step-loading .auth-sub { margin: 0; text-align: center; }

label {
  margin: 15px 0 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  height: 46px;
  padding: 0 14px;
  border: 1px solid #deded9;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
}

input::placeholder { color: #777772; }

input:focus {
  border-color: #aaa9a4;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(232, 93, 36, .13);
}

.btn {
  min-height: 46px;
  margin-top: 18px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -.008em;
}

.btn:hover { background: #080808; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; }
.btn:focus-visible,
.code-links a:focus-visible,
.muted-link:focus-visible,
.legal-links a:focus-visible,
.auth-hint a:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
}

.session-spinner {
  width: 30px;
  height: 30px;
  margin: 0 0 24px;
  border: 3px solid var(--line);
  border-top-color: var(--rust);
  border-radius: 50%;
  animation: session-spin .8s linear infinite;
}

.session-retry { max-width: 220px; }

.account-closed-help {
  max-width: 48ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.account-closed-create {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.account-closed-support { margin-top: 14px; }

@keyframes session-spin { to { transform: rotate(360deg); } }

.auth-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.auth-hint a { color: var(--ink-mid); text-underline-offset: 3px; }

.invite-context {
  margin: -8px 0 22px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--rust-dim);
  color: #8a3615;
  font-size: 13px;
  line-height: 1.55;
}

.auth-notice {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 9px;
  background: #eef7f0;
  color: #236d36;
  font-size: 12.5px;
  line-height: 1.5;
}

.organization-card {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.organization-avatar {
  display: grid;
  width: 46px;
  height: 46px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 18px;
  font-weight: 650;
}

.organization-copy { display: flex; min-width: 0; flex-direction: column; line-height: 1.45; }
.organization-copy strong,
.organization-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.organization-copy strong { color: var(--ink); font-size: 14.5px; }
.organization-copy span { color: var(--muted); font-size: 12.5px; }
.organization-copy .organization-state { color: #8a3615; font-size: 11px; font-weight: 600; }

.code-row {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin: 10px 0 18px;
}

.code-row input {
  width: 48px;
  height: 56px;
  padding: 0;
  text-align: center;
  font-size: 23px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.code-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 13px; }
.code-links a,
.muted-link { color: var(--muted); text-underline-offset: 3px; }
.code-links a:hover,
.muted-link:hover { color: var(--ink); }
.muted-link { display: block; margin: 10px 0; font-size: 13px; text-align: center; }
.trustline { margin: 18px 0; color: var(--muted); font-size: 12px; line-height: 1.55; text-align: center; }
.legal-links { width: 100%; max-width: 48ch; margin: 32px auto 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; text-align: center; text-wrap: balance; }
.legal-links a { color: inherit; text-underline-offset: 3px; }

.terms-consent { margin-top: 24px; }
label.terms-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding-block: 8px;
  min-height: 44px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  cursor: pointer;
}
.terms-checkbox input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--ink);
  cursor: pointer;
}
.terms-checkbox a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.terms-checkbox input:focus-visible, .terms-checkbox a:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 4px;
}
.terms-version { margin: 6px 0 0 30px; color: var(--ink-mid); font-size: 12px; line-height: 1.55; }
.error { min-height: 20px; margin-top: 12px; color: #b42318; font-size: 13px; line-height: 1.5; }
.error:empty { min-height: 0; margin-top: 0; }
.error a { color: inherit; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .session-spinner { animation-duration: 1.8s; }
  .btn:active { transform: none; }
}

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .split-left { min-height: auto; padding: 28px clamp(24px, 7vw, 56px) 32px; }
  .login-story { margin: 54px 0 0; gap: 30px; padding: 0; }
  .login-story-copy h2 { max-width: 600px; font-size: clamp(34px, 7vw, 50px); }
  .login-story-copy p { margin-top: 14px; }
  .private-workspace-note { margin-top: 30px; }
  .split-right { min-height: auto; justify-content: flex-start; padding: 54px clamp(24px, 7vw, 56px) 72px; }
  .auth-col { max-width: 430px; margin: 0 auto; }
}

@media (max-width: 560px) {
  .split-left { padding: 24px 20px 28px; }
  .login-story { margin-top: 32px; padding: 0; }
  .login-story-copy h2 { font-size: 36px; }
  .login-story-copy p { font-size: 14px; }
  .works-with,
  .private-workspace-note { display: none; }
  .split-right { min-height: auto; padding: 40px 20px 48px; }
  .auth-col h1 { font-size: 32px; }
  .code-row { gap: 6px; }
  .code-row input { width: calc((100% - 30px) / 6); min-width: 0; height: 52px; }
}
