:root {
  color-scheme: light;
  --navy: #03121e;
  --ink: #162f40;
  --muted: #526a7a;
  --accent: #295570;
  --paper: #f4f7f9;
  --white: #fff;
  --line: #dce5eb;
  --beige: #d7cdba;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

h1, h2, p, dl, dd, fieldset { margin: 0; }
fieldset { min-inline-size: 0; border: 0; padding: 0; }
input, button, select, textarea { font: inherit; color: inherit; }
:is(a, button, input, textarea):focus-visible { outline: 2px solid #4c809b; outline-offset: 3px; }

.brand-bar { background: var(--navy); color: var(--beige); }
.brand {
  display: flex;
  width: min(100% - 2rem, 74rem);
  min-height: 3.875rem;
  margin-inline: auto;
  align-items: center;
  gap: .7rem;
}
.brand img { width: 7rem; height: 2.9375rem; object-fit: contain; }
.brand span { border-inline-start: 1px solid #456171; padding-inline-start: .65rem; font-weight: 800; }

.auth-card {
  display: grid;
  gap: 1.125rem;
  width: min(100% - 2rem, 29rem);
  margin: clamp(1.5rem, 6vh, 3.5rem) auto;
  padding: clamp(1.25rem, 5vw, 2rem);
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--white);
  box-shadow: 0 12px 30px #03121e0b;
}

.auth-card-wide { width: min(100% - 2rem, 37rem); }
h1 { font-size: clamp(1.55rem, 5vw, 1.9rem); letter-spacing: -.035em; line-height: 1.2; }
h2 { font-size: 1rem; line-height: 1.35; }
.auth-card p, small { color: var(--muted); overflow-wrap: anywhere; }
.stack { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; }
label, dt { font-size: .92rem; font-weight: 650; }
small { font-size: .85rem; }
small:empty { display: none; }

input:not([type='hidden'], [type='checkbox']), select, textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: .55rem .65rem;
  border: 1px solid #aabcc8;
  border-radius: .375rem;
  background: var(--white);
}
textarea { resize: vertical; }
input[type='checkbox'] { margin-inline: 0 .4rem; vertical-align: middle; }
input[readonly] { background: var(--paper); }

.mfa-setup { gap: .85rem; }
.mfa-qr {
  justify-self: center;
  inline-size: min(100%, 14rem);
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: var(--white);
}
.mfa-qr svg { display: block; width: 100%; height: auto; shape-rendering: crispEdges; }
.mfa-manual summary { cursor: pointer; color: var(--accent); }
.mfa-manual .field { margin-block-start: .5rem; }
.button {
  display: inline-flex;
  min-height: 2.75rem;
  padding: .55rem .8rem;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: .375rem;
  background: var(--accent);
  color: var(--white);
  font-weight: 680;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: #20465c; }
.button-secondary { border-color: #aabcc8; background: var(--white); color: var(--ink); }
.button-secondary:hover { background: #edf4f8; }
.button-danger { border-color: #d8aaa1; background: var(--white); color: #902f20; }
.button-danger:hover { background: #fff1ed; }
.button:disabled { opacity: .58; cursor: default; }
.text-link { justify-self: start; color: var(--accent); text-underline-offset: .16em; }

.auth-card .notice {
  padding: .6rem .75rem;
  border: 1px solid var(--line);
  border-radius: .375rem;
  font-size: .9rem;
}
.auth-card .notice-error { border-color: #e6bcb4; background: #fff4f1; color: #902f20; }
.auth-card .notice-success { border-color: #bcd9ca; background: #edf8f1; color: #225538; }
.password-fields:disabled { display: none; }

.connections { display: grid; gap: .65rem; }
.connection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
}
.connection p { margin-top: .25rem; font-size: .9rem; }
.connection form { flex: 0 0 auto; }
.access-pill {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 1rem;
  background: #e1edf4;
  color: var(--accent);
  font-size: .85rem;
  font-weight: 650;
}
.access-active { background: #dff3e8; color: #225538; }
.access-summary { display: grid; gap: .65rem; }
.access-summary > div { display: grid; grid-template-columns: minmax(6rem, 1fr) 2fr; gap: .75rem; }
.access-summary dd { min-width: 0; overflow-wrap: anywhere; }
.copy-field { display: flex; gap: .5rem; }
.copy-field input { min-width: 0; }

@media (max-width: 27rem) {
  .connection { align-items: flex-start; flex-direction: column; }
  .access-summary > div { grid-template-columns: 1fr; gap: .15rem; }
}
