:root {
  --login-bg: #f1f2f4;
  --login-ink: #171a21;
  --login-muted: #626a78;
  --login-line: #dfe2e7;
  --login-panel: #ffffff;
  --login-dark: #1b1d21;
  --login-dark-soft: #25282d;
  --login-red: #d51d26;
  --login-red-dark: #b9161e;
  --login-blue: #245f9c;
  --login-green: #1f7a45;
  --login-shadow: 0 18px 48px rgba(20, 23, 29, 0.12);
}

body.login-page {
  background: var(--login-bg);
}

body.login-page::before {
  display: none;
}

.login-page .login-shell {
  width: min(1180px, calc(100% - 40px));
  grid-template-columns: minmax(0, 1.04fr) minmax(390px, 0.96fr);
  gap: 20px;
  padding: 28px 0;
}

.login-page .brand-panel,
.login-page .auth-card {
  border-radius: 8px;
  border-color: var(--login-line);
  box-shadow: var(--login-shadow);
}

.login-page .brand-panel {
  min-height: 610px;
  gap: 24px;
  padding: 30px;
  background: var(--login-dark);
}

.login-page .brand-panel::after {
  display: none;
}

.login-page .login-logo {
  width: min(330px, 72%);
  padding: 5px;
  border: 0;
  border-radius: 5px;
  box-shadow: none;
}

.environment-tag {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 5px;
  border-color: #454950;
  background: #292c31;
  color: #e7e9ec;
  text-decoration: none;
}

.environment-tag:hover,
.environment-tag:focus-visible {
  background: #34383f;
  border-color: #626873;
  color: #fff;
}

.brand-copy h1 {
  max-width: 520px;
  font-size: 48px;
  line-height: 1.02;
  font-weight: 780;
}

.brand-copy p {
  margin-top: 14px;
  color: #c0c5cd;
  font-size: 15px;
  line-height: 1.55;
}

.workflow-grid {
  gap: 1px;
  overflow: hidden;
  border: 1px solid #383c43;
  border-radius: 6px;
  background: #383c43;
}

.workflow-item {
  min-height: 100px;
  gap: 6px;
  padding: 14px;
  border: 0;
  border-radius: 0;
  background: #24272c;
}

.workflow-item span {
  width: 30px;
  height: 21px;
  border-radius: 4px;
  background: #4a2529;
  color: #ffb9bd;
}

.workflow-item small {
  color: #a8aeb8;
}

.system-strip {
  gap: 1px;
  overflow: hidden;
  border: 1px solid #383c43;
  border-radius: 6px;
  background: #383c43;
}

.system-item {
  min-height: 68px;
  border: 0;
  border-radius: 0;
  background: #202328;
}

.login-page .auth-card {
  padding: 28px;
  background: var(--login-panel);
}

.login-page .auth-panel,
.login-page .auth-card {
  min-width: 0;
}

.auth-icon {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-radius: 5px;
  background: #25282d;
}

.auth-header h2,
.session-panel h2 {
  font-size: 22px;
}

.portal-choice {
  gap: 3px;
  padding: 4px;
  border-radius: 6px;
  background: #f2f3f5;
}

.portal-option {
  border: 1px solid transparent;
  border-radius: 4px;
}

.portal-option:hover {
  color: var(--login-ink);
  background: #e5e7eb;
}

.portal-option.active {
  border-color: #171a21;
  background: #171a21;
  color: #fff;
  box-shadow: none;
}

.field-control {
  border-radius: 5px;
  font-weight: 550;
}

.password-toggle {
  border-radius: 4px;
}

.forgot-password {
  width: fit-content;
  justify-self: end;
  margin-top: 2px;
  color: var(--login-blue);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
}

.forgot-password:hover,
.forgot-password:focus-visible {
  text-decoration: underline;
}

.primary-login {
  border-radius: 5px;
  background: var(--login-red);
  box-shadow: none;
}

.primary-login:hover {
  background: var(--login-red-dark);
}

.auth-footer {
  gap: 6px;
}

.auth-footer span {
  min-height: 30px;
  gap: 6px;
  border: 1px solid #e2e4e8;
  border-radius: 4px;
  background: #f6f7f8;
  font-size: 11px;
}

.auth-footer svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 940px) {
  .login-page .login-shell {
    grid-template-columns: minmax(0, 1fr) !important;
    width: min(660px, calc(100% - 24px));
    gap: 12px;
    padding: 12px 0 24px;
  }

  .login-page .auth-panel {
    width: 100%;
    grid-column: 1;
    order: -1;
  }

  .login-page .brand-panel {
    width: 100%;
    grid-column: 1;
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .login-page .login-shell {
    width: min(calc(100% - 16px), 520px);
    padding-top: 8px;
  }

  .login-page .auth-card {
    padding: 20px 18px;
  }

  .auth-header {
    margin-bottom: 18px;
  }

  .auth-header h2 {
    font-size: 20px;
  }

  .portal-choice {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portal-option {
    padding-inline: 4px;
    font-size: 12px;
  }

  .login-page .brand-panel { display: none; }

  .login-page .login-logo {
    width: min(260px, 78%);
  }

  .brand-copy h1 {
    font-size: 32px;
  }

  .auth-footer span {
    flex: 1 1 130px;
  }
}
