:root {
  color-scheme: light dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --page: #ffffff;
  --card: #ffffff;
  --field: #f5f5f7;
  --field-hover: #ebebed;
  --text: #171717;
  --muted: #737373;
  --line: #e5e5e5;
  --brand: #0071e3;
  --button: #171717;
  --button-hover: #2b2b2b;
  --button-text: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--page);
  color: var(--text);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 48px 24px;
}

.login-card {
  width: min(100%, 448px);
  padding: 32px;
  border-radius: 12px;
  background: var(--card);
}

.login-header {
  display: grid;
  gap: 8px;
}

.product-pill {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
}

h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.login-header p,
.security-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 20px;
  margin-top: 32px;
}

.field-group {
  display: grid;
  gap: 7px;
}

.field-label {
  font-size: 13px;
  font-weight: 650;
}

.workspace-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 11px 14px;
  border-radius: 9px;
  background: var(--field);
}

.workspace-control > span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.workspace-control strong {
  font-size: 14px;
  font-weight: 600;
}

.workspace-control small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 0 4px color-mix(in srgb, #34c759 14%, transparent);
}

.sign-in-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 9px;
  background: var(--button);
  color: var(--button-text);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: background 140ms ease, transform 140ms ease;
}

.sign-in-button:hover {
  background: var(--button-hover);
}

.sign-in-button:active {
  transform: translateY(1px);
}

.sign-in-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent);
  outline-offset: 3px;
}

.security-note {
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0a0a0a;
    --card: #171717;
    --field: #262626;
    --field-hover: #333333;
    --text: #fafafa;
    --muted: #a3a3a3;
    --line: #333333;
    --brand: #4a9fff;
    --button: #ffffff;
    --button-hover: #f0f0f0;
    --button-text: #171717;
  }

  .login-card {
    box-shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 12px 32px -16px rgb(0 0 0 / 60%);
  }
}

@media (max-width: 520px) {
  .login-shell {
    align-items: start;
    padding: max(48px, env(safe-area-inset-top)) 18px 32px;
  }

  .login-card {
    padding: 24px;
  }
}
