/* The top bar on every signed-in page, and the Sign in page. */

.brand { display: inline-flex; align-items: center; gap: 8px; flex: none; color: var(--text-primary); text-decoration: none; }
.brand:hover { color: var(--text-primary); text-decoration: none; }
.brand-logo, .brand-logo img { display: block; }
.brand-logo img { width: auto; height: 28px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 56px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-card);
  background: rgba(252, 252, 251, 0.92);
  backdrop-filter: blur(8px);
}

.topnav {
  display: flex;
  flex: 1;
  align-self: stretch;
  align-items: center;
  gap: 16px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  font-size: var(--text-table);
}
.topnav a {
  display: flex;
  flex: none;
  align-items: center;
  height: 56px;
  margin-bottom: -1px;
  padding: 0 2px;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  white-space: nowrap;
  text-decoration: none;
}
.topnav a:hover { color: var(--text-primary); text-decoration: none; }
.topnav a[aria-current] { border-bottom-color: var(--text-primary); color: var(--text-primary); font-weight: 500; }
.topnav-divider { flex: none; width: 1px; height: 18px; background: var(--border-divider); }

.topbar-end { display: flex; flex: none; align-items: center; gap: 14px; margin-left: auto; }
.topbar-end form { display: flex; margin: 0; }
.topbar-signout {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-tertiary);
  font-size: var(--text-meta);
  white-space: nowrap;
  cursor: pointer;
}
.topbar-signout:hover { color: var(--accent-hover); text-decoration: underline; }

/* The avatar opens a small menu: who and where, and the clinic switcher. */
.account-menu { position: relative; }
.account-menu > summary {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-muted-3);
  font-size: var(--text-sm);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 240px;
  padding: 14px 16px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  background: var(--bg-surface);
  box-shadow: var(--shadow-float);
}
.account-name { margin: 0; font-size: var(--text-md); font-weight: 600; }
.account-context { margin: 0; font-size: var(--text-meta); color: var(--text-tertiary); }
.clinic-switcher { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border-row); font-size: var(--text-meta); color: var(--text-tertiary); }

@media (max-width: 48rem) {
  .topbar { gap: 16px; padding: 0 16px; }
}

/* Sign in: the form on the left, the promise on the right. */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-main { display: flex; flex-direction: column; padding: 40px 56px; }
.auth-main .brand-logo img { height: 34px; }
/* Centred in its half, so the space around it is even; the logo and footer keep the corners. */
.auth-form { display: flex; flex-direction: column; gap: 18px; width: 100%; max-width: 380px; margin: auto; }
.auth-heading { display: flex; flex-direction: column; gap: 6px; }
.auth-heading p { margin: 0; font-size: var(--text-table); color: var(--text-tertiary); line-height: 1.5; }
.auth-footer { font-size: var(--text-sm); color: var(--text-faint); }
.auth-aside {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  padding: 48px;
  border-left: 1px solid var(--border-divider);
  background: var(--bg-muted-3);
}
.auth-aside .auth-aside-title { max-width: 360px; color: var(--text-primary); margin: 0; font-size: var(--text-3xl); font-weight: 600; line-height: 1.2; letter-spacing: var(--tracking-tight); text-wrap: pretty; }
.auth-aside p { max-width: 340px; margin: 0; font-size: var(--text-base); color: var(--text-tertiary); line-height: 1.5; }
main.main-bare { max-width: none; padding: 0; }
@media (max-width: 48rem) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-main { padding: 28px 16px; gap: 40px; }
  .auth-aside { display: none; }
}
