:root {
  --auth-primary: #1B2F77;
  --auth-primary-hover: #162565;
  --auth-primary-soft: #F3F5FB;
  --auth-danger: #CA1720;
  --auth-danger-hover: #8c231c;
  --auth-success: #0DA767;
  --auth-warning: #D18411;
  --auth-surface: #ffffff;
  --auth-ground: #f9fafb;
  --auth-hover: #f3f4f6;
  --auth-border: #e5e7eb;
  --auth-input-border: #d1d5db;
  --auth-text: #4b5563;
  --auth-muted: #6b7280;
  --auth-strong: #1f2937;
  --auth-radius: 6px;
  --auth-shadow: 0 3px 5px rgba(0, 0, 0, .02), 0 0 2px rgba(0, 0, 0, .05), 0 1px 4px rgba(0, 0, 0, .08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body.auth-ui {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--auth-ground);
  color: var(--auth-text);
  font-family: Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.auth-shell-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  min-height: 5rem;
  padding: 0 2rem;
  background: var(--auth-surface);
  box-shadow: var(--auth-shadow);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: .875rem;
  color: var(--auth-strong);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.auth-brand img {
  height: auto;
  display: block;
}

.auth-brand-logo-akd {
  width: 8.75rem;
}

.auth-brand-logo-eu {
  width: 6.5rem;
}

.auth-shell-main {
  width: min(74rem, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 2rem 0;
}

.auth-card {
  width: min(42rem, 100%);
  margin: 0 auto;
  padding: 1.75rem;
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
}

.auth-card.auth-card-wide {
  width: min(68rem, 100%);
}

.auth-eyebrow {
  margin: 0 0 .5rem;
  color: var(--auth-primary);
  font-size: .8125rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  color: var(--auth-strong);
  letter-spacing: 0;
}

h1 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  line-height: 1.25;
}

h2 {
  margin: 1.5rem 0 .75rem;
  font-size: 1rem;
}

p {
  margin: 0 0 1rem;
}

.muted,
.empty,
.none {
  color: var(--auth-muted);
}

.empty,
.none {
  font-size: .9375rem;
}

.status,
.auth-status {
  margin: 1rem 0;
  padding: .875rem 1rem;
  border: 1px solid var(--auth-border);
  border-left: 4px solid var(--auth-primary);
  border-radius: var(--auth-radius);
  background: var(--auth-primary-soft);
}

.auth-actions {
  display: grid;
  gap: .75rem;
  margin-top: 1rem;
}

a.auth-button,
.auth-button,
button.auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  padding: .75rem 1rem;
  border: 1px solid var(--auth-primary);
  border-radius: var(--auth-radius);
  background: var(--auth-primary);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, box-shadow .2s, color .2s;
}

a.auth-button:hover,
.auth-button:hover,
button.auth-button:hover {
  background: var(--auth-primary-hover);
  border-color: var(--auth-primary-hover);
  color: #ffffff;
}

.auth-button.auth-button-secondary {
  background: var(--auth-surface);
  color: var(--auth-primary);
}

.auth-button.auth-button-secondary:hover {
  background: var(--auth-primary-soft);
  border-color: var(--auth-primary);
  color: var(--auth-primary);
}

.auth-button.auth-button-danger {
  width: 100%;
  margin-top: 1rem;
  background: var(--auth-danger);
  border-color: var(--auth-danger);
}

.auth-button.auth-button-danger:hover {
  background: var(--auth-danger-hover);
  border-color: var(--auth-danger-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #9eb8ff, 0 1px 2px 0 rgba(0, 0, 0, 1);
}

.auth-form {
  width: min(28rem, 100%);
  margin: 0 auto;
  padding: 1.75rem;
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
}

.auth-form label {
  display: block;
  margin-top: .875rem;
  color: var(--auth-strong);
  font-size: .875rem;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  margin-top: .375rem;
  padding: .75rem;
  border: 1px solid var(--auth-input-border);
  border-radius: var(--auth-radius);
  background: var(--auth-surface);
  color: var(--auth-text);
  font: inherit;
}

.auth-form input:hover,
.auth-form input:focus {
  border-color: var(--auth-primary);
}

.auth-table-wrap {
  width: 100%;
  overflow-x: auto;
}

table,
.permissions {
  width: 100%;
  border-collapse: collapse;
  margin: .5rem 0 1rem;
  background: var(--auth-surface);
  font-size: .9375rem;
}

th,
td,
.permissions th,
.permissions td {
  padding: .625rem .75rem;
  border: 1px solid var(--auth-border);
  text-align: left;
  vertical-align: top;
}

th,
.permissions th {
  background: var(--auth-primary);
  color: #ffffff;
  font-weight: 700;
}

td:first-child {
  color: var(--auth-strong);
  font-weight: 600;
}

tr:nth-child(even) td {
  background: var(--auth-hover);
}

.permission-name,
strong {
  color: var(--auth-strong);
  font-weight: 700;
}

code {
  padding: .125rem .25rem;
  border-radius: 4px;
  background: var(--auth-hover);
  color: var(--auth-strong);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .875em;
}

pre.json {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  background: var(--auth-surface);
  color: var(--auth-strong);
}

.ok {
  color: var(--auth-success);
  font-weight: 700;
}

.warn {
  color: var(--auth-danger);
  font-weight: 700;
}

.attr-key {
  color: var(--auth-muted);
  font-size: .875rem;
  word-break: break-all;
}

.preserve-lines {
  white-space: pre-line;
}

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

.logout a {
  color: var(--auth-danger);
  font-weight: 700;
  text-decoration: none;
}

.auth-page-diag .auth-shell-main {
  width: min(76rem, calc(100vw - 2rem));
}

.auth-page-post .auth-card {
  text-align: center;
}

@media (max-width: 640px) {
  .auth-shell-header {
    min-height: 4.25rem;
    padding: 0 1rem;
  }

  .auth-brand {
    gap: .625rem;
    font-size: 1.125rem;
  }

  .auth-brand-logo-akd {
    width: 6.75rem;
  }

  .auth-brand-logo-eu {
    width: 5rem;
  }

  .auth-shell-main {
    width: min(100% - 1rem, 74rem);
    padding: 1rem 0;
  }

  .auth-card,
  .auth-form {
    padding: 1.25rem;
  }
}
