body.portal-body {
  --portal-ink: #171719;
  --portal-muted: #535358;
  --portal-accent: #6541ad;
  --portal-accent-dark: #4d2b90;
  --portal-line: #dcdce0;
  --portal-surface: #fff;
  --portal-bg: #f5f5f3;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  margin: 0;
  color: var(--portal-ink);
  background: var(--portal-bg);
  font: 16px/1.55 system-ui, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.portal-body *,
.portal-body *::before,
.portal-body *::after {
  box-sizing: border-box;
}

.portal-body [hidden] { display: none !important; }
.portal-body a { color: inherit; }
.portal-body :focus-visible {
  outline: 2px solid var(--portal-accent);
  outline-offset: 3px;
}

.portal-body .portal-skip {
  position: absolute;
  z-index: 10;
  top: 12px;
  left: 12px;
  transform: translateY(calc(-100% - 20px));
  background: var(--portal-surface);
  padding: 8px 16px;
}

.portal-body .portal-skip:focus { transform: translateY(0); }
.portal-body .portal-wrap {
  width: min(1320px, calc(100% - clamp(36px, 9vw, 144px)));
  margin-inline: auto;
}

.portal-body .portal-header {
  background: var(--portal-surface);
  border-bottom: 1px solid var(--portal-line);
}

@media screen and (min-width: 881px) and (hover: hover) {
  .portal-body .portal-header { position: sticky; top: 0; z-index: 5; }
  html { scroll-padding-top: calc(77px + .75rem); }
}

.portal-body .portal-nav {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.portal-body .portal-wordmark {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--portal-ink);
  text-decoration: none;
}
.portal-body .portal-wordmark img { display:block; max-width:100%; height:auto; }

.portal-body .portal-nav-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.portal-body .portal-nav-link {
  color: var(--portal-ink);
  font-size: 14px;
  text-decoration: none;
}

.portal-body .portal-nav-link span { margin-left: 3px; }
.portal-body .portal-nav-link:hover { color: var(--portal-accent); }
.portal-body .portal-main { flex: 1 0 auto; }
.portal-body .portal-muted { color: var(--portal-muted); }
.portal-body .portal-card {
  background: var(--portal-surface);
  border: 1px solid var(--portal-line);
  border-radius: 6px;
}

.portal-body .portal-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--portal-accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.portal-body .portal-button:hover { background: var(--portal-accent-dark); }
.portal-body .portal-button--secondary {
  border-color: var(--portal-line);
  background: var(--portal-surface);
  color: var(--portal-ink);
}

.portal-body .portal-button--secondary:hover {
  border-color: var(--portal-accent);
  background: var(--portal-bg);
}

.portal-body .portal-button:disabled { opacity: .6; cursor: wait; }
.portal-body .portal-footer {
  border-top: 1px solid var(--portal-line);
  background: var(--portal-surface);
  color: var(--portal-muted);
  font-size: 13px;
}

.portal-body .portal-footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-block: 19px;
}

.portal-body .portal-footer a { text-decoration: none; }
.portal-body .portal-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

.portal-login .portal-login-main {
  display: grid;
  align-items: center;
  justify-items: center;
  padding: clamp(40px, 8vh, 112px) 18px;
}

.portal-login .portal-login-card {
  width: min(100%, 460px);
  padding: clamp(24px, 5vw, 44px);
  box-shadow: 0 16px 42px #1717190c;
}

.portal-login .portal-login-card h1 {
  margin: 0 0 28px;
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -.052em;
}

.portal-login .portal-login-form {
  display: grid;
  gap: 18px;
}

.portal-login .portal-field {
  display: grid;
  gap: 7px;
}

.portal-login .portal-field label { font-size: 14px; font-weight: 600; }
.portal-login .portal-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #bcbcc3;
  border-radius: 4px;
  padding: 9px 11px;
  background: var(--portal-surface);
  color: var(--portal-ink);
  font: inherit;
}

.portal-login .portal-field input:hover { border-color: #898991; }
.portal-login .portal-login-form .portal-button { margin-top: 3px; }
.portal-login .portal-login-error {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid #9a333e;
  background: #fbf1f2;
  color: #7b2732;
  font-size: 14px;
}

.portal-login .portal-login-help {
  margin: 24px 0 0;
  border-top: 1px solid var(--portal-line);
  padding-top: 18px;
  color: var(--portal-muted);
  font-size: 14px;
}

.portal-login .portal-login-help a {
  color: var(--portal-accent-dark);
  font-weight: 600;
  text-underline-offset: 3px;
}

@media (max-width: 600px) {
  .portal-body .portal-nav { min-height: 64px; }
  .portal-body .portal-wordmark img { width: 102px; }
  .portal-login .portal-login-main { padding-block: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-body .portal-button { transition: none; }
}

@media (max-width: 600px) {
  .portal-body .portal-wrap { width: calc(100% - 2 * clamp(14px, 4vw, 24px)); }
  .portal-login .portal-login-main { padding: 32px clamp(14px, 4vw, 24px); align-items: start; }
  .portal-login .portal-login-card { padding: clamp(18px, 5vw, 28px); }
  .portal-body .portal-footer-content { align-items: baseline; flex-wrap: wrap; gap: 8px 16px; }
}
