:root {
  color-scheme: light;
  --bg: #eef3f3;
  --paper: #ffffff;
  --ink: #1e2b31;
  --muted: #68777d;
  --line: #d6e0e2;
  --teal: #168b80;
  --teal-dark: #0e6f67;
  --teal-soft: #e7f5f2;
  --coral: #e8665d;
  --night: #17272b;
  --night-soft: #20383a;
  --shadow: 0 18px 48px rgba(18, 35, 42, .14);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

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

button { cursor: pointer; }

::selection { background: #bfe4df; color: #143d3a; }

:focus-visible {
  outline: 3px solid rgba(22, 139, 128, .26);
  outline-offset: 2px;
}

.login-shell {
  width: min(880px, 100%);
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(360px, 1.1fr);
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.login-intro {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px;
  background: var(--night);
  color: #f4f8f7;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  position: relative;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  border: 1px solid #42605f;
  border-radius: 8px;
  background: var(--night-soft);
  color: #78d4c9;
}

.brand-mark > svg:first-child { width: 27px; height: 27px; }

.brand-spark {
  position: absolute;
  inset-inline-end: -6px;
  top: -6px;
  width: 18px;
  height: 18px;
  padding: 3px;
  border: 1px solid #efc9c5;
  border-radius: 5px;
  background: #fff0ee;
  color: var(--coral);
}

.brand-lockup h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.brand-lockup p {
  margin: 6px 0 0;
  color: #9eb2b4;
  font-size: 13px;
}

.security-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid #31484b;
  color: #b7c7c8;
}

.security-state > svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: #78d4c9;
}

.security-state span { min-width: 0; display: grid; gap: 3px; }
.security-state strong { color: #edf6f5; font-size: 13px; }
.security-state small { color: #8fa5a7; font-size: 11px; line-height: 1.5; }

.login-panel {
  min-width: 0;
  align-self: center;
  padding: 52px clamp(36px, 7vw, 72px);
}

.login-heading { margin-bottom: 28px; }

.login-heading h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
}

.login-heading p { margin: 8px 0 0; color: var(--muted); }

.login-error {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 18px;
  padding: 11px 12px;
  border: 1px solid #efc9c5;
  border-radius: 7px;
  background: #fff3f1;
  color: #9b3539;
  font-size: 13px;
  line-height: 1.5;
}

.login-error svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; }

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

.login-form label { display: grid; gap: 8px; }
.login-form label > span:first-child { font-size: 13px; font-weight: 700; }

.field-control { position: relative; display: block; }

.field-control > svg {
  position: absolute;
  inset-inline-start: 13px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: #7a8c91;
  pointer-events: none;
}

.field-control input {
  width: 100%;
  min-height: 48px;
  padding: 11px 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfc;
  color: var(--ink);
  font-size: 16px;
  caret-color: var(--teal);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field-control input:hover { border-color: #aebdc1; }

.field-control input:focus {
  outline: 0;
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(22, 139, 128, .12);
}

.password-toggle {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  transform: translateY(-50%);
  background: transparent;
  color: #728489;
}

.password-toggle:hover { background: var(--teal-soft); color: var(--teal-dark); }
.password-toggle svg { width: 18px; height: 18px; }

.login-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 4px;
  padding: 11px 18px;
  border: 1px solid var(--teal-dark);
  border-radius: 7px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 7px 18px rgba(14, 111, 103, .18);
  transition: background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.login-button:hover { background: var(--teal-dark); box-shadow: 0 9px 22px rgba(14, 111, 103, .24); }
.login-button:active { transform: translateY(1px); }
.login-button:disabled { cursor: wait; opacity: .72; box-shadow: none; }
.login-button svg { width: 18px; height: 18px; }
.login-button.is-loading svg { animation: spin 800ms linear infinite; }

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

@media (max-width: 720px) {
  body { align-items: start; padding: 0; background: #fff; }

  .login-shell {
    min-height: 100vh;
    grid-template-columns: 1fr;
    border-radius: 0;
    box-shadow: none;
  }

  .login-intro { min-height: 190px; padding: 28px 24px; }
  .security-state { padding-top: 20px; }
  .login-panel { width: 100%; padding: 42px 24px 48px; }
}

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