:root {
  --login-bg: #eef2f7;
  --login-ink: #101828;
  --login-muted: #667085;
  --login-line: #d9e2ef;
  --login-panel: #ffffff;
  --login-dark: #0b1220;
  --login-dark-soft: #111b2d;
  --login-red: #d71920;
  --login-red-dark: #a90f15;
  --login-blue: #1769c2;
  --login-green: #18864b;
  --login-shadow: 0 28px 70px rgba(15, 23, 42, 0.14);
}

body.login-page {
  min-height: 100vh;
  display: block;
  padding: 0;
  background:
    linear-gradient(135deg, rgba(215, 25, 32, 0.07), transparent 30%),
    linear-gradient(180deg, #f8fafc 0%, var(--login-bg) 100%);
  color: var(--login-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 72%);
}

.login-page .login-shell {
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 28px;
  align-items: center;
  padding: 34px 0;
  position: relative;
}

.login-page .brand-panel,
.login-page .auth-card {
  border: 1px solid rgba(217, 226, 239, 0.92);
  border-radius: 12px;
  box-shadow: var(--login-shadow);
}

.login-page .brand-panel {
  min-height: 660px;
  display: grid;
  align-content: space-between;
  gap: 28px;
  padding: 34px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(215, 25, 32, 0.18), transparent 28%),
    linear-gradient(160deg, var(--login-dark) 0%, var(--login-dark-soft) 58%, #172033 100%);
  color: #f8fafc;
  position: relative;
}

.login-page .brand-panel::after {
  content: "";
  position: absolute;
  right: -92px;
  bottom: -82px;
  width: 280px;
  height: 280px;
  border: 34px solid rgba(255, 255, 255, 0.055);
  transform: skewX(-20deg);
}

.brand-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.login-page .login-logo {
  width: min(430px, 82%);
  height: auto;
  display: block;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #fff;
  padding: 6px;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.32);
}

.login-wordmark {
  min-width: min(360px, 72%);
  min-height: 118px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background:
    linear-gradient(135deg, rgba(215, 25, 32, 0.9), rgba(215, 25, 32, 0.1) 26%, transparent 27%),
    linear-gradient(145deg, #05070c 0%, #111827 48%, #25344f 100%);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.32);
}

.login-wordmark strong,
.login-wordmark span {
  display: block;
}

.login-wordmark strong {
  color: #fff;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

.login-wordmark span {
  color: #dce6f5;
  font-size: 15px;
  font-weight: 800;
}

.environment-tag {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #dce6f5;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-copy {
  max-width: 640px;
  position: relative;
  z-index: 1;
}

.brand-copy h1 {
  max-width: 620px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(36px, 5vw, 66px);
  line-height: 0.98;
  letter-spacing: 0;
}

.brand-copy p {
  max-width: 560px;
  margin: 18px 0 0;
  color: #b9c7db;
  font-size: 17px;
  line-height: 1.65;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}

.workflow-item {
  min-height: 116px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.075);
}

.workflow-item span {
  width: 36px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(215, 25, 32, 0.22);
  color: #ffb9bd;
  font-size: 12px;
  font-weight: 900;
}

.workflow-item strong {
  color: #ffffff;
  font-size: 15px;
}

.workflow-item small {
  color: #a9b6c7;
  font-size: 13px;
  line-height: 1.35;
}

.system-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  position: relative;
  z-index: 1;
}

.system-item {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.13);
}

.status-dot.secure,
.status-dot.online {
  background: var(--login-green);
  box-shadow: 0 0 0 4px rgba(24, 134, 75, 0.16);
}

.status-dot.offline {
  background: var(--login-red);
  box-shadow: 0 0 0 4px rgba(215, 25, 32, 0.16);
}

.status-dot.clock {
  background: var(--login-blue);
  box-shadow: 0 0 0 4px rgba(23, 105, 194, 0.14);
}

.system-item span:not(.status-dot) {
  color: #9eb0c8;
  font-size: 12px;
  font-weight: 750;
}

.system-item strong {
  color: #ffffff;
  font-size: 14px;
  white-space: nowrap;
}

.login-page .auth-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.login-page .auth-card {
  width: 100%;
  padding: 30px;
  background: rgba(255, 255, 255, 0.96);
}

.auth-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.auth-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  flex: 0 0 44px;
}

.auth-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-header h2,
.session-panel h2 {
  margin: 0;
  color: var(--login-ink);
  font-size: 24px;
  line-height: 1.12;
}

.auth-header p,
.session-panel p {
  margin: 7px 0 0;
  color: var(--login-muted);
  font-size: 14px;
  line-height: 1.5;
}

.portal-choice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  padding: 5px;
  border: 1px solid var(--login-line);
  border-radius: 8px;
  background: #f8fafc;
}

.portal-option {
  height: 40px;
  min-height: 40px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: #475467;
  font-weight: 850;
}

.portal-option.active {
  background: var(--login-ink);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.16);
}

.status-message {
  min-height: 22px;
  margin: 0 0 12px;
  color: var(--login-green);
  font-weight: 800;
}

.status-message.error {
  color: #b42318;
}

.auth-form {
  display: grid;
  gap: 9px;
}

.field-label {
  margin: 10px 0 0;
  color: #344054;
  font-size: 13px;
  font-weight: 850;
}

.field-control {
  width: 100%;
  height: 48px;
  min-height: 48px;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  padding: 0 13px;
  background: #ffffff;
  color: var(--login-ink);
  font-size: 15px;
  font-weight: 650;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field-control:focus {
  border-color: var(--login-blue);
  box-shadow: 0 0 0 4px rgba(23, 105, 194, 0.12);
}

.password-field {
  position: relative;
}

.password-field .field-control {
  padding-right: 52px;
}

.password-toggle {
  width: 40px;
  height: 40px;
  min-height: 40px;
  position: absolute;
  right: 4px;
  top: 4px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: #667085;
}

.password-toggle:hover {
  background: #f2f4f7;
  color: var(--login-ink);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.primary-login {
  width: 100%;
  height: 48px;
  min-height: 48px;
  margin-top: 14px;
  border-radius: 8px;
  border: 0;
  background: linear-gradient(180deg, #ef2330 0%, var(--login-red) 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(215, 25, 32, 0.24);
}

.primary-login:hover {
  background: linear-gradient(180deg, #e11d2b 0%, var(--login-red-dark) 100%);
}

.session-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--login-line);
}

.login-page .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.login-page .actions button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 13px;
  background: var(--login-red);
  color: #ffffff;
  font-weight: 850;
}

.login-page .actions button.secondary {
  background: #263249;
}

.login-page .grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.login-page .card,
.login-page .data-card {
  border: 1px solid var(--login-line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.login-page .card strong,
.login-page .data-card strong,
.login-page .card span,
.login-page .data-card span {
  display: block;
}

.login-page .card span,
.login-page .data-card span {
  margin-top: 3px;
  color: var(--login-muted);
  font-size: 13px;
}

.login-page img.qr {
  width: 180px;
  height: 180px;
  border: 1px solid var(--login-line);
  border-radius: 8px;
  margin-top: 10px;
}

.auth-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--login-line);
}

.auth-footer span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 7px;
  background: #f2f4f7;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.login-page .hidden {
  display: none !important;
}

@media (max-width: 940px) {
  .login-page .login-shell {
    grid-template-columns: 1fr;
    width: min(680px, calc(100% - 28px));
    padding: 18px 0;
  }

  .login-page .brand-panel {
    min-height: auto;
    padding: 24px;
  }

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

@media (max-width: 560px) {
  .login-page .login-shell {
    width: min(100% - 20px, 520px);
  }

  .brand-topline {
    display: grid;
  }

  .login-page .login-logo {
    width: 100%;
  }

  .workflow-grid,
  .system-strip {
    grid-template-columns: 1fr;
  }

  .portal-choice {
    grid-template-columns: 1fr;
  }

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

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