* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body.login-body {
  min-height: 100vh;
  color: var(--momo-text-primary);
  font-family: var(--momo-font-family);
  background: var(--momo-bg-body);
}

.login-page {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px;
  border-right: 1px solid var(--momo-border-light);
  background: var(--momo-bg-paper);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--momo-text-primary);
  font-family: var(--momo-font-display);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark__icon {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--momo-border-strong);
  border-radius: var(--momo-radius-sm);
  background: var(--momo-bg-elevated);
}

.brand-mark__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-brand h1 {
  max-width: 720px;
  margin: 96px 0 var(--momo-space-3);
  color: var(--momo-text-primary);
  font-family: var(--momo-font-display);
  font-size: 52px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.05;
}

.login-brand p {
  max-width: 620px;
  margin: 0;
  color: var(--momo-text-secondary);
  font-size: 16px;
  line-height: 1.75;
}

.login-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--momo-space-6);
}

.login-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--momo-border-light);
  border-radius: var(--momo-radius-sm);
  background: var(--momo-bg-elevated);
  color: var(--momo-text-secondary);
  font-family: var(--momo-font-mono);
  font-size: var(--momo-text-label);
  font-weight: 700;
}

.login-panel-wrap {
  display: grid;
  align-items: center;
  padding: 40px;
  background: var(--momo-bg-body);
}

.login-card {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--momo-border-light);
  border-radius: var(--momo-radius-lg);
  background: var(--momo-bg-surface);
}

.login-card__head {
  padding: var(--momo-space-5);
  border-bottom: 1px solid var(--momo-border-light);
}

.login-card__head span {
  display: inline-flex;
  margin-bottom: var(--momo-space-2);
  color: var(--momo-page-accent-dark, var(--momo-accent-strong));
  font-family: var(--momo-font-mono);
  font-size: var(--momo-text-label);
  font-weight: 700;
}

.login-card__head h2 {
  margin: 0;
  color: var(--momo-text-primary);
  font-family: var(--momo-font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.login-card__body {
  padding: var(--momo-space-5);
}

.login-field {
  margin-bottom: var(--momo-space-5);
}

.login-label {
  display: block;
  margin-bottom: var(--momo-space-2);
  color: var(--momo-text-primary);
  font-family: var(--momo-font-display);
  font-weight: 700;
}

.login-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 66px 10px 12px;
  border: 1px solid var(--momo-border-light);
  border-radius: var(--momo-radius-md);
  outline: 0;
  background: var(--momo-bg-elevated);
  color: var(--momo-text-primary);
  font: inherit;
}

.login-input:focus {
  border-color: var(--momo-page-accent-line, rgba(201, 100, 66, 0.32));
  box-shadow: 0 0 0 3px rgba(201, 100, 66, 0.12);
}

.login-input--plain {
  padding-right: 12px;
}

.password-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  min-width: 44px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--momo-page-accent-dark, var(--momo-accent-strong));
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  transform: translateY(-50%);
}

.login-submit {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--momo-text-primary);
  border-radius: var(--momo-radius-md);
  background: var(--momo-text-primary);
  color: var(--momo-bg-paper);
  cursor: pointer;
  font: inherit;
  font-family: var(--momo-font-display);
  font-weight: 800;
}

.login-submit:hover,
.login-submit:focus-visible {
  border-color: var(--momo-page-accent-dark, var(--momo-accent-strong));
  background: var(--momo-page-accent-dark, var(--momo-accent-strong));
}

.login-alert {
  margin-bottom: var(--momo-space-4);
  padding: var(--momo-space-3);
  border: 1px solid var(--momo-danger-border);
  border-radius: var(--momo-radius-md);
  background: var(--momo-danger-bg);
  color: var(--momo-danger-text);
}

.login-footer {
  padding: 0 var(--momo-space-5) var(--momo-space-5);
  color: var(--momo-text-tertiary);
  font-family: var(--momo-font-mono);
  font-size: var(--momo-text-label);
}

.login-footer--mobile {
  display: none;
}

@media (max-width: 900px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: auto;
    padding: 32px;
    border-right: 0;
    border-bottom: 1px solid var(--momo-border-light);
  }

  .login-brand h1 {
    margin-top: 48px;
    font-size: 40px;
  }

  .login-panel-wrap {
    align-items: start;
    padding: 32px;
  }
}

@media (max-width: 520px) {
  body.login-body,
  .login-page {
    min-height: 100svh;
  }

  .login-brand,
  .login-panel-wrap {
    padding: var(--momo-space-4);
  }

  .login-brand h1 {
    margin-top: var(--momo-space-6);
    font-size: 34px;
  }

  .login-brand p {
    font-size: 15px;
    line-height: 1.65;
  }

  .login-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .login-pill {
    justify-content: center;
    padding-inline: 4px;
    overflow-wrap: anywhere;
  }

  .login-card__head,
  .login-card__body {
    padding: var(--momo-space-4);
  }

  .login-footer--desktop {
    display: none;
  }

  .login-footer--mobile {
    display: block;
  }
}
