/* Sign-in and access screens: the dark brand panel is the same surface as the
   workspace rail, so the screen that follows reads as a continuation. */

.auth-screen {
  display: grid;
  min-height: 100vh;
  margin: 0;
  grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
  color: var(--text-primary);
  background: var(--bg-primary);
  font-family: var(--font-family-base);
}

.auth-brand {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  padding: clamp(1.75rem, 4vw, 3.5rem);
  color: var(--sidebar-text);
  background: var(--sidebar-background-solid);
  border-right: 1px solid var(--sidebar-border);
}

.auth-brand__home {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  align-self: flex-start;
  gap: 0.6rem;
  color: var(--sidebar-active-text);
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
}

.auth-brand__mark {
  width: 44px;
  height: 30px;
  overflow: visible;
}

.auth-brand__mark path,
.auth-brand__mark .auth-brand__mark-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-brand__mark-loop {
  stroke: var(--brand-mark-loop);
  stroke-width: 5.4;
}

.auth-brand__mark-wave {
  stroke: var(--brand-mark-wave);
  stroke-width: 5.4;
}

.auth-brand__mark-dot {
  fill: var(--brand-mark-wave);
}

.auth-brand__mark-line {
  stroke: var(--brand-mark-line);
  stroke-width: 1.9;
}

.auth-brand__mark-node {
  fill: var(--brand-mark-node);
}

.auth-brand__lab {
  color: var(--sidebar-muted);
  font-weight: 400;
}

.auth-brand__divider {
  margin: 0 0.1rem;
  color: var(--sidebar-border);
}

.auth-brand__pitch {
  max-width: 30rem;
}

.auth-brand__headline {
  margin: 0 0 1.25rem;
  color: var(--sidebar-active-text);
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.18;
  word-break: keep-all;
}

.auth-brand__lede {
  margin: 0;
  color: var(--sidebar-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  word-break: keep-all;
}

/* The product loop, drawn the way the work inbox draws it after sign-in. */
.auth-loop {
  display: grid;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
}

.auth-loop__step {
  position: relative;
  padding-top: 1.5rem;
  color: var(--sidebar-text);
  font-size: 0.95rem;
  font-weight: 600;
}

.auth-loop__step::before {
  position: absolute;
  top: 0.3rem;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--sidebar-border);
  content: "";
}

.auth-loop__step:last-child::before {
  right: auto;
  width: 0;
}

.auth-loop__step::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 0.65rem;
  height: 0.65rem;
  border: 2px solid var(--sidebar-background-solid);
  border-radius: var(--radius-full);
  background: #13bfd0;
  box-shadow: 0 0 0 1px #13bfd0;
  content: "";
}

.auth-loop__detail {
  display: block;
  margin-top: 0.3rem;
  padding-right: 1rem;
  color: var(--sidebar-muted);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.45;
  word-break: keep-all;
}

.auth-main {
  display: grid;
  min-width: 0;
  place-items: center;
  padding: clamp(1.75rem, 4vw, 3.5rem);
}

.auth-panel {
  width: min(100%, 22rem);
}

.auth-panel[hidden] {
  display: none;
}

.auth-panel__status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.9rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}

.auth-panel__status::before {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--radius-full);
  background: var(--status-warning);
  content: "";
}

.auth-panel__status[data-tone="blocked"]::before {
  background: var(--status-danger);
}

.auth-panel__title {
  margin: 0 0 0.6rem;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  word-break: keep-all;
}

.auth-panel__body {
  margin: 0 0 1.75rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  word-break: keep-all;
}

.auth-actions {
  display: grid;
  gap: 0.6rem;
}

.auth-button {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0 1rem;
  color: var(--text-primary);
  background: var(--surface-raised-solid);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast);
}

.auth-button[hidden] {
  display: none;
}

.auth-button:hover {
  background: var(--bg-hover);
}

.auth-button--primary {
  color: var(--text-on-brand);
  background: var(--brand-primary-strong);
  border-color: transparent;
}

.auth-button--primary:hover {
  background: var(--brand-primary-strong-hover);
}

.auth-button[aria-busy="true"] {
  cursor: progress;
  opacity: 0.72;
}

.auth-button__google {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.auth-button__spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  box-sizing: border-box;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
  border-radius: var(--radius-full);
  animation: auth-spin 0.8s linear infinite;
}

.auth-button[aria-busy="true"] .auth-button__spinner {
  display: block;
}

.auth-button[aria-busy="true"] .auth-button__google {
  display: none;
}

.auth-note {
  margin: 1rem 0 0;
  color: var(--text-tertiary);
  font-size: 0.85rem;
  line-height: 1.55;
  word-break: keep-all;
}

.auth-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-underline-offset: 3px;
}

.auth-link:hover {
  color: var(--text-primary);
}

.auth-footer {
  margin: 1.1rem 0 0;
}

.auth-demo {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.auth-demo[hidden] {
  display: none;
}

.auth-demo__label {
  margin: 0 0 0.65rem;
  color: var(--text-tertiary);
  font-size: 0.82rem;
}

.auth-demo__roles {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.auth-demo__roles .auth-button {
  min-height: 44px;
  padding: 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.auth-screen :is(a, button):focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

.auth-brand :is(a, button):focus-visible {
  outline-color: var(--sidebar-active-text);
}

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

@media (prefers-reduced-motion: reduce) {
  .auth-button__spinner {
    animation-duration: 2.4s;
  }
}

@media (max-width: 860px) {
  .auth-screen {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .auth-brand {
    gap: 1.25rem;
    padding: 1.25rem 1.25rem 1.5rem;
    border-right: 0;
    border-bottom: 1px solid var(--sidebar-border);
  }

  .auth-brand__headline {
    margin-bottom: 0;
    font-size: 1.45rem;
  }

  .auth-brand__break,
  .auth-brand__lede,
  .auth-loop {
    display: none;
  }

  .auth-main {
    align-items: start;
    padding: 2rem 1.25rem;
  }
}
