:root {
  --pkc-auth-bg: #f6f7f9;
  --pkc-auth-panel-bg: #ffffff;
  --pkc-auth-text: #172033;
  --pkc-auth-muted: #5f6b7a;
  --pkc-auth-border: #d9dde3;
  --pkc-auth-accent: #2454a6;
  --pkc-auth-accent-contrast: #ffffff;
  --pkc-auth-focus: #1f6feb;
}

body.pkc-auth-page {
  margin: 0;
  background: var(--pkc-auth-bg);
  color: var(--pkc-auth-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.pkc-auth-card a,
.pkc-auth-user-menu a {
  color: var(--pkc-auth-accent);
}

.pkc-auth-card button,
.pkc-auth-card input,
.pkc-auth-card select,
.pkc-auth-card textarea,
.pkc-auth-user-menu button {
  font: inherit;
}

.pkc-auth-card button,
.pkc-auth-button,
.pkc-auth-card input[type="submit"],
.pkc-auth-profile-logout button {
  border: 1px solid var(--pkc-auth-accent);
  border-radius: 4px;
  background: var(--pkc-auth-accent);
  color: var(--pkc-auth-accent-contrast);
  cursor: pointer;
  padding: 0.45rem 0.75rem;
}

.pkc-auth-card button:hover,
.pkc-auth-button:hover,
.pkc-auth-card input[type="submit"]:hover,
.pkc-auth-profile-logout button:hover {
  filter: brightness(0.96);
}

.pkc-auth-card input[type="text"],
.pkc-auth-card input[type="password"],
.pkc-auth-card textarea,
.pkc-auth-card select {
  box-sizing: border-box;
  width: 100%;
  max-width: 34rem;
  border: 1px solid var(--pkc-auth-border);
  border-radius: 4px;
  background: var(--pkc-auth-panel-bg);
  color: var(--pkc-auth-text);
  padding: 0.45rem 0.55rem;
}

.pkc-auth-card summary,
.pkc-auth-card button,
.pkc-auth-card a,
.pkc-auth-card input,
.pkc-auth-card select,
.pkc-auth-card textarea,
.pkc-auth-user-menu summary,
.pkc-auth-user-menu button,
.pkc-auth-user-menu a {
  outline-offset: 3px;
}

.pkc-auth-card summary:focus-visible,
.pkc-auth-card button:focus-visible,
.pkc-auth-card a:focus-visible,
.pkc-auth-card input:focus-visible,
.pkc-auth-card select:focus-visible,
.pkc-auth-card textarea:focus-visible,
.pkc-auth-user-menu summary:focus-visible,
.pkc-auth-user-menu button:focus-visible,
.pkc-auth-user-menu a:focus-visible {
  outline: 2px solid var(--pkc-auth-focus);
}

.pkc-auth-page .page-header {
  box-sizing: border-box;
  width: min(100%, 1100px);
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--pkc-auth-border);
  background: var(--pkc-auth-panel-bg);
}

.pkc-auth-page .page-main {
  box-sizing: border-box;
  width: min(100%, 760px);
  margin: 1.5rem auto;
  padding: 0 1rem 2rem;
}

.pkc-auth-page .top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.pkc-auth-user-menu {
  margin-left: auto;
  position: relative;
}

.pkc-auth-profile-menu {
  position: relative;
}

.pkc-auth-profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
}

.pkc-auth-profile-trigger::-webkit-details-marker {
  display: none;
}

.pkc-auth-profile-roundel {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pkc-auth-accent);
  color: var(--pkc-auth-accent-contrast);
  font-weight: 700;
  letter-spacing: 0;
}

.pkc-auth-profile-trigger-name {
  color: var(--pkc-auth-muted);
}

.pkc-auth-profile-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 20;
  min-width: 13rem;
  max-width: min(18rem, calc(100vw - 2rem));
  border: 1px solid var(--pkc-auth-border);
  border-radius: 6px;
  background: var(--pkc-auth-panel-bg);
  box-shadow: 0 12px 30px rgb(15 23 42 / 16%);
  padding: 0.75rem;
}

.pkc-auth-profile-heading {
  margin: 0 0 0.65rem;
  color: var(--pkc-auth-muted);
  font-size: 0.92rem;
}

.pkc-auth-profile-heading span,
.pkc-auth-profile-heading strong {
  display: block;
  overflow-wrap: anywhere;
}

.pkc-auth-profile-heading strong {
  color: var(--pkc-auth-text);
}

.pkc-auth-profile-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pkc-auth-profile-links a,
.pkc-auth-login-link {
  display: block;
  border-radius: 4px;
  padding: 0.35rem 0;
}

.pkc-auth-profile-logout {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--pkc-auth-border);
}

.pkc-auth-profile-logout button {
  width: 100%;
}

.pkc-auth-card {
  border: 1px solid var(--pkc-auth-border);
  border-radius: 8px;
  background: var(--pkc-auth-panel-bg);
  padding: 1.25rem;
}

.pkc-auth-card h1,
.pkc-auth-form h1 {
  margin-top: 0;
}

.pkc-auth-form-row {
  margin: 0 0 0.85rem;
}

.pkc-auth-form-row label {
  display: inline-block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.pkc-auth-help {
  color: var(--pkc-auth-muted);
  margin: 0.75rem 0 0;
}

.pkc-auth-secondary-action {
  margin: 1rem 0 0;
  border-top: 1px solid var(--pkc-auth-border);
  padding-top: 0.85rem;
}

.pkc-auth-secondary-action summary {
  cursor: pointer;
  color: var(--pkc-auth-accent);
}

@media (max-width: 640px) {
  .pkc-auth-page .page-header {
    align-items: flex-start;
  }

  .pkc-auth-profile-trigger-name {
    display: none;
  }
}
