.auth-mode .app-shell {
  display: block;
}

.auth-mode .sidebar,
.auth-mode .topbar {
  display: none;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 32px 20px;
  background: var(--paper, #f4f3ee);
  isolation: isolate;
}

.auth-backdrop-shape {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}

.auth-backdrop-shape-one {
  width: min(58vw, 720px);
  aspect-ratio: 1;
  top: -34%;
  right: -12%;
  background: rgba(214, 83, 63, .1);
}

.auth-backdrop-shape-two {
  width: min(52vw, 640px);
  aspect-ratio: 1;
  bottom: -38%;
  left: -13%;
  background: rgba(47, 114, 93, .11);
}

.auth-card {
  width: min(100%, 470px);
  padding: 30px;
  border: 1px solid rgba(203, 209, 201, .88);
  border-radius: 22px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 24px 80px rgba(29, 47, 39, .13);
  backdrop-filter: blur(18px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line, #dfe3dc);
}

.auth-brand strong,
.auth-brand small {
  display: block;
}

.auth-brand strong {
  color: var(--ink, #17251f);
  font-size: 14px;
}

.auth-brand small {
  margin-top: 3px;
  color: var(--ink-faint, #7d8983);
  font-size: 11px;
}

.auth-brand-mark {
  width: 35px;
  height: 35px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  transform: skewY(-8deg);
}

.auth-brand-mark i {
  align-self: end;
  height: 100%;
  border-radius: 2px;
  background: var(--ink, #17251f);
}

.auth-brand-mark i:first-child {
  height: 55%;
  background: #df6a55;
}

.auth-brand-mark i:nth-child(2) {
  height: 78%;
  background: #c8b96f;
}

.auth-copy {
  margin: 30px 0 22px;
}

.auth-eyebrow {
  color: var(--accent-dark, #a53c2d);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.auth-copy h1 {
  margin: 7px 0 0;
  color: var(--ink, #17251f);
  font-size: clamp(28px, 6vw, 38px);
  letter-spacing: -.045em;
  line-height: 1.05;
}

.auth-copy p,
.auth-domain-notice p,
.auth-error p,
.auth-help {
  margin: 0;
  color: var(--ink-soft, #52625a);
  font-size: 12px;
  line-height: 1.55;
}

.auth-domain-notice {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid #cbded4;
  border-radius: 12px;
  background: var(--green-soft, #dcebe4);
}

.auth-domain-notice > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green, #2f725d);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.auth-domain-notice strong {
  color: var(--green, #2f725d);
}

.auth-error {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #e5bbb3;
  border-radius: 12px;
  background: var(--red-soft, #f5dcd7);
}

.auth-error strong {
  display: block;
  margin-bottom: 3px;
  color: var(--red, #a23b31);
  font-size: 11px;
}

.auth-error p {
  color: #7c3e36;
}

.auth-google-button {
  width: 100%;
  min-height: 48px;
  margin-top: 20px;
  font-size: 13px;
}

.auth-google-button:disabled,
.auth-logout-button:disabled {
  cursor: wait;
  opacity: .64;
}

.auth-google-mark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #fff;
  color: #4285f4;
  font-size: 13px;
  font-weight: 850;
}

.auth-inline-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .34);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin .75s linear infinite;
}

.auth-help {
  margin-top: 13px;
  color: var(--ink-faint, #7d8983);
  font-size: 10px;
  text-align: center;
}

.auth-current-user {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border: 1px solid var(--line, #dfe3dc);
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
}

.auth-user-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green, #2f725d);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.auth-user-identity {
  min-width: 0;
}

.auth-user-identity strong,
.auth-user-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user-identity strong {
  color: var(--ink, #17251f);
  font-size: 11px;
}

.auth-user-identity small {
  margin-top: 2px;
  color: var(--ink-faint, #7d8983);
  font-size: 9px;
}

.auth-user-role {
  max-width: 190px;
  overflow: hidden;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-muted, #eef0eb);
  color: var(--ink-soft, #52625a);
  font-size: 9px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-logout-button {
  appearance: none;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-faint, #7d8983);
  font-size: 10px;
  font-weight: 750;
}

.auth-logout-button:hover {
  background: var(--surface-muted, #eef0eb);
  color: var(--ink, #17251f);
}

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

@media (prefers-reduced-motion: reduce) {
  .auth-inline-spinner { animation-duration: 1.5s; }
}

@media (max-width: 640px) {
  .auth-screen { align-items: start; padding: 18px 12px; }
  .auth-card { margin: auto 0; padding: 24px 20px; border-radius: 18px; }
  .auth-copy { margin-top: 25px; }
  .auth-current-user { grid-template-columns: auto minmax(0, 1fr) auto; }
  .auth-user-role { grid-column: 2; max-width: 100%; justify-self: start; }
  .auth-logout-button { grid-column: 3; grid-row: 1 / span 2; }
}
