:root {
  --background: #f2f3f5;
  --surface: #ffffff;
  --surface-input: #faf8ff;
  --border: #e5e6eb;
  --outline: #c3c5d9;
  --text: #191b24;
  --text-muted: #434656;
  --placeholder: #737688;
  --primary: #0047cf;
  --primary-hover: #165dff;
  --success: #006e16;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background: var(--background);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--background);
  font-size: 14px;
  line-height: 22px;
  letter-spacing: 0;
}

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

button,
a,
input,
label {
  -webkit-tap-highlight-color: transparent;
}

.login-shell {
  width: min(1024px, 100%);
  height: 600px;
  display: flex;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.brand-panel,
.form-panel {
  min-width: 0;
}

.brand-panel {
  flex: 0 0 45%;
}

.form-panel {
  flex: 0 0 55%;
}

.brand-panel {
  position: relative;
  background: #dfe5f0 url("./assets/login-building.jpg") center / cover no-repeat;
}

.brand-panel__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px;
  color: #ffffff;
  background: linear-gradient(0deg, rgba(0, 71, 207, 0.92), rgba(0, 71, 207, 0.42));
}

.brand-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
}

.brand-name--mobile {
  justify-content: center;
  color: var(--primary);
}

.brand-subtitle {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  line-height: 24px;
}

.brand-meta p {
  margin: 0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 20px;
}

.brand-meta p:first-child {
  color: rgba(255, 255, 255, 0.82);
}

.brand-meta p:last-child {
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
}

.form-panel {
  display: flex;
  align-items: center;
  padding: 48px;
  background: var(--surface);
}

.login-content {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.mobile-brand {
  display: none;
  margin-bottom: 32px;
  text-align: center;
}

.mobile-brand p {
  margin: 4px 0 0;
  color: var(--text-muted);
}

.form-heading {
  margin-bottom: 32px;
}

.form-heading h1 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
}

.form-heading p {
  margin: 0;
  color: var(--text-muted);
}

.login-form {
  display: grid;
  gap: 24px;
}

.field label,
.field-row a {
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
}

.field > label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.field-row label {
  color: var(--text-muted);
}

.field-row a {
  color: var(--primary);
  text-decoration: none;
}

.field-row a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 40px;
  color: var(--text);
  background: var(--surface-input);
  border: 1px solid var(--outline);
  border-radius: 2px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

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

.input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

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

.icon--brand {
  width: 24px;
  height: 24px;
}

.input-icon {
  position: absolute;
  top: 14px;
  left: 12px;
  color: var(--placeholder);
  pointer-events: none;
}

.password-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--placeholder);
  background: transparent;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--text-muted);
}

.remember-field {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  cursor: pointer;
}

.remember-field input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.submit-button {
  width: 100%;
  height: 48px;
  color: #ffffff;
  background: var(--primary);
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.submit-button:hover {
  background: var(--primary-hover);
}

.password-toggle:focus-visible,
.remember-field input:focus-visible,
.submit-button:focus-visible,
.field-row a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.security-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 32px;
  padding-top: 24px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.security-note__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--success);
}

.security-note p {
  margin: 0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 20px;
}

@media (max-width: 767px) {
  body {
    align-items: stretch;
    padding: 0;
  }

  .login-shell {
    width: 100%;
    min-height: 100vh;
    height: auto;
    border: 0;
    border-radius: 0;
  }

  .brand-panel {
    display: none;
  }

  .form-panel {
    flex-basis: 100%;
    padding: 32px;
  }

  .mobile-brand {
    display: block;
  }

  .form-heading {
    margin-bottom: 32px;
  }
}

@media (max-width: 420px) {
  .form-panel {
    padding: 24px;
  }
}

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