:root {
  color-scheme: light;
  --text: #18211e;
  --muted: #6d7974;
  --line: #dfe5e2;
  --accent: #0b9466;
  --accent-strong: #087650;
  --accent-soft: #e9f6f0;
  --danger: #b63b36;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
}

body {
  margin: 0;
  background: #111816 url("/assets/mailroom-login-bg.png") center / cover no-repeat fixed;
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  background: rgba(9, 15, 13, 0.46);
  content: "";
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-page {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto 1fr auto;
  padding: 28px 34px 22px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  color: #fff;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: #eef8f3;
  color: #076246;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.login-brand strong,
.login-brand small {
  display: block;
}

.login-brand strong {
  font-size: 19px;
  line-height: 1.1;
}

.login-brand small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  font-weight: 700;
}

.login-card {
  align-self: center;
  justify-self: center;
  width: min(424px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}

.card-heading {
  position: relative;
  border-bottom: 1px solid var(--line);
  padding: 28px 32px 23px 86px;
}

.heading-icon {
  position: absolute;
  top: 28px;
  left: 32px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #cae2d7;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
}

.eyebrow {
  display: block;
  color: #8c9993;
  font-size: 9px;
  font-weight: 750;
}

.card-heading h1 {
  margin: 5px 0 0;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.15;
}

form {
  padding: 24px 32px 27px;
}

label {
  display: block;
  margin: 14px 0 7px;
  color: #3e4a45;
  font-size: 12px;
  font-weight: 650;
}

label:first-child {
  margin-top: 0;
}

.input-shell {
  position: relative;
}

.input-shell > .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 16px;
  height: 16px;
  color: #94a09a;
  transform: translateY(-50%);
  pointer-events: none;
}

input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  background: #fbfcfb;
  color: var(--text);
  padding: 0 12px 0 40px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input::placeholder {
  color: #a8b1ad;
}

input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(11, 148, 102, 0.13);
}

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

.field-button {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #88958f;
  transform: translateY(-50%);
}

.field-button:hover {
  background: #f0f4f2;
  color: var(--text);
}

.form-message {
  min-height: 34px;
  padding-top: 9px;
  color: var(--danger);
  font-size: 11px;
}

.login-button {
  display: flex;
  width: 100%;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 680;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.login-button:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.login-button:disabled {
  cursor: wait;
  opacity: 0.78;
  transform: none;
}

.loading-icon {
  display: none;
}

.login-button.is-loading .arrow-icon {
  display: none;
}

.login-button.is-loading .loading-icon {
  display: block;
  animation: spin 800ms linear infinite;
}

.card-footer {
  display: flex;
  min-height: 47px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: #f7f9f8;
  color: #7d8983;
  padding: 0 32px;
  font-size: 10px;
  text-transform: uppercase;
}

.card-footer span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #36c989;
  box-shadow: 0 0 0 4px rgba(54, 201, 137, 0.1);
}

.card-footer a {
  color: #65716c;
  text-decoration: none;
}

.card-footer a:hover {
  color: var(--accent-strong);
}

.page-footer {
  justify-self: end;
  color: rgba(255, 255, 255, 0.46);
  font-size: 10px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
  body {
    background-attachment: scroll;
    background-position: 44% center;
  }

  body::before {
    background: rgba(9, 15, 13, 0.6);
  }

  .login-page {
    padding: 20px 16px 16px;
  }

  .login-card {
    margin: 26px 0;
  }

  .card-heading {
    padding: 24px 24px 20px 76px;
  }

  .heading-icon {
    top: 24px;
    left: 24px;
  }

  form {
    padding: 21px 24px 24px;
  }

  .card-footer {
    padding: 0 24px;
  }
}

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