:root {
  color-scheme: light;
  --ink: #1d2738;
  --ink-soft: #5c687a;
  --muted: #626f80;
  --line: #d9dee6;
  --line-strong: #c9d0da;
  --page: #f5f6f8;
  --surface: #ffffff;
  --red: #d8282f;
  --red-dark: #b91f26;
  --red-soft: #fff4f4;
  --success: #16734a;
  --success-soft: #f1f8f4;
  --focus: #1769d2;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 50;
  top: 10px;
  left: 10px;
  padding: 9px 12px;
  border-radius: 4px;
  color: #fff;
  background: #1d2738;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.portal-header {
  height: 73px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.portal-header__inner {
  display: flex;
  width: min(100% - 40px, 1120px);
  height: 100%;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
}

.portal-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.portal-brand img {
  display: block;
  width: 164px;
  height: auto;
}

.portal-brand__divider {
  width: 1px;
  height: 28px;
  flex: 0 0 auto;
  background: #d7dce4;
}

.portal-brand__label {
  color: #465268;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.25px;
  white-space: nowrap;
}

.portal-header__host {
  color: var(--muted);
  font-size: 12px;
}

.auth-main {
  min-height: calc(100vh - 73px);
  min-height: calc(100svh - 73px);
  padding: 58px 20px 32px;
}

.auth-main__content {
  width: min(100%, 440px);
  margin: 0 auto;
}

.login-card {
  width: 100%;
  padding: 34px 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgb(28 39 56 / 6%);
}

.login-card__header h1 {
  margin: 0;
  color: var(--ink);
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.7px;
  line-height: 1.2;
}

.login-card__header > p:last-child {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}

.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 22px;
  padding: 11px 12px;
  border: 1px solid #ebc5c7;
  border-radius: 6px;
  color: #8d1f25;
  background: var(--red-soft);
  font-size: 13px;
  line-height: 1.45;
}

.form-alert__mark {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  font-size: 11px;
  font-weight: 800;
}

.form-alert--success {
  border-color: #bfdccf;
  color: #145d3e;
  background: var(--success-soft);
}

.form-alert--success .form-alert__mark {
  background: var(--success);
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 27px;
}

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

.field-group label,
.field-label-row {
  color: #303b4d;
  font-size: 13px;
  font-weight: 650;
}

.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.field-label-row a {
  color: #3d4b61;
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #aab2bf;
  text-underline-offset: 3px;
}

.field-label-row a:hover {
  color: var(--red-dark);
  text-decoration-color: currentColor;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.input-shell input {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 15px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.input-shell--password input {
  padding-right: 70px;
}

.input-shell input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.input-shell input:hover {
  border-color: #abb4c1;
}

.input-shell input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 2px rgb(23 105 210 / 16%);
}

.field-group--invalid .input-shell input {
  border-color: var(--red);
  background: #fffafa;
}

.field-group--invalid .input-shell input:focus {
  box-shadow: 0 0 0 2px rgb(216 40 47 / 14%);
}

.field-error {
  margin: 0;
  color: #9a2026;
  font-size: 12px;
  line-height: 1.4;
}

.password-toggle {
  position: absolute;
  right: 4px;
  min-width: 56px;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  color: #465268;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.password-toggle:hover {
  color: #202a3b;
  background: #f1f3f6;
}

.primary-action {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  padding: 11px 18px;
  border: 1px solid var(--red);
  border-radius: 6px;
  color: #fff;
  background: var(--red);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.primary-action:hover {
  border-color: var(--red-dark);
  background: var(--red-dark);
}

.primary-action:active {
  background: #a71c22;
}

.primary-action:disabled {
  border-color: #bd7377;
  background: #bd7377;
  cursor: wait;
}

.account-notice {
  margin-top: 22px;
  padding: 11px 12px;
  border-left: 3px solid #aab3c0;
  color: #5c6878;
  background: #f7f8fa;
}

.account-notice p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.account-notice strong {
  color: #394457;
}

.login-help {
  margin-top: 21px;
  padding-top: 19px;
  border-top: 1px solid #e4e7ec;
  text-align: center;
}

.login-help p {
  margin: 0 0 4px;
  color: var(--ink-soft);
  font-size: 12px;
}

.login-help a,
.login-help span {
  color: #445066;
  font-size: 12px;
  font-weight: 600;
}

.login-help a {
  text-underline-offset: 3px;
}

.login-help span[aria-disabled="true"] {
  color: #667286;
}

.auth-main__legal {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

:focus-visible {
  outline: 3px solid rgb(23 105 210 / 36%);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .portal-header {
    height: 65px;
  }

  .portal-header__inner {
    width: min(100% - 32px, 440px);
  }

  .portal-brand {
    gap: 10px;
  }

  .portal-brand img {
    width: 146px;
  }

  .portal-brand__divider {
    height: 24px;
  }

  .portal-brand__label {
    font-size: 11px;
  }

  .portal-header__host {
    display: none;
  }

  .auth-main {
    min-height: calc(100vh - 65px);
    min-height: calc(100svh - 65px);
    padding: 34px 16px 24px;
  }

  .login-card {
    padding: 29px 26px;
  }
}

@media (max-width: 400px) {
  html,
  body {
    background: #fff;
  }

  .portal-header__inner {
    width: calc(100% - 28px);
  }

  .portal-brand img {
    width: 140px;
  }

  .auth-main {
    padding: 28px 16px 22px;
  }

  .login-card {
    padding: 6px 0 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-card__header h1 {
    font-size: 30px;
  }

  .field-label-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-contrast: more) {
  .input-shell input,
  .login-card,
  .primary-action {
    border-width: 2px;
  }
}
