:root {
  color-scheme: light dark;
  --page: #edf5f6;
  --brand-surface: #dceff2;
  --form-surface: #f8fbfb;
  --field-surface: #ffffff;
  --text: #17383e;
  --text-soft: #526c71;
  --line: #bfd3d6;
  --accent: #277c89;
  --accent-strong: #1d6975;
  --accent-text: #f6fbfc;
  --coral: #efa7aa;
  --danger: #a93c45;
  --danger-soft: #f9e6e7;
  --focus: #55b8c7;
  --shadow: rgb(37 92 101 / 12%);
  --panel-radius: 28px;
  --control-radius: 12px;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  background: var(--page);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
  min-height: 100dvh;
  padding: 18px;
}

.brand-panel {
  position: relative;
  min-height: calc(100dvh - 36px);
  overflow: hidden;
  border-radius: var(--panel-radius);
  background:
    radial-gradient(circle at 92% 12%, rgb(239 167 170 / 72%) 0 12%, transparent 12.4%),
    radial-gradient(circle at 3% 89%, rgb(82 184 199 / 35%) 0 23%, transparent 23.4%),
    var(--brand-surface);
}

.brand-panel::after {
  position: absolute;
  right: -8rem;
  bottom: -13rem;
  width: 32rem;
  aspect-ratio: 1;
  border: 5rem solid rgb(82 184 199 / 20%);
  border-radius: 42%;
  content: "";
  transform: rotate(38deg);
}

.brand-panel__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: min(100%, 780px);
  min-height: 100%;
  padding: clamp(38px, 5.6vw, 86px);
}

.brand-logo {
  display: block;
  width: clamp(210px, 22vw, 330px);
  height: auto;
}

.brand-copy {
  padding: 8vh 0 5vh;
}

.brand-kicker,
.mobile-brand {
  margin: 0 0 18px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .08em;
}

.brand-copy h1 {
  max-width: 9em;
  margin: 0;
  font-size: clamp(48px, 5.2vw, 78px);
  font-weight: 750;
  letter-spacing: -.055em;
  line-height: 1.08;
}

.brand-description {
  max-width: 26em;
  margin: 28px 0 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.75;
}

.form-panel {
  display: grid;
  place-items: center;
  padding: clamp(36px, 6vw, 96px);
}

.form-wrap {
  width: min(100%, 430px);
}

.form-header {
  margin-bottom: 40px;
}

.mobile-brand {
  display: none;
}

.form-header h2 {
  margin: 0;
  font-size: clamp(34px, 3vw, 46px);
  font-weight: 750;
  letter-spacing: -.045em;
  line-height: 1.15;
}

.form-header > p:last-child {
  margin: 14px 0 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.7;
}

#login-form {
  display: grid;
  gap: 22px;
}

.field {
  display: grid;
  gap: 9px;
}

.field label {
  font-size: 14px;
  font-weight: 650;
}

.field input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  outline: none;
  background: var(--field-surface);
  color: var(--text);
  padding: 0 15px;
  caret-color: var(--accent);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.field input:hover {
  border-color: color-mix(in srgb, var(--line), var(--accent) 38%);
}

.field input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 4px rgb(85 184 199 / 18%);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 70px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  min-width: 52px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: rgb(85 184 199 / 12%);
}

.password-toggle:focus-visible {
  outline: 3px solid rgb(85 184 199 / 30%);
  outline-offset: 1px;
}

.field-note {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
}

.form-error {
  min-height: 22px;
  margin: -4px 0 -2px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}

.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: var(--control-radius);
  background: var(--accent);
  box-shadow: 0 14px 32px var(--shadow);
  color: var(--accent-text);
  cursor: pointer;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: .02em;
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.submit-button:hover {
  background: var(--accent-strong);
  box-shadow: 0 16px 36px rgb(37 92 101 / 18%);
}

.submit-button:active {
  transform: translateY(1px) scale(.995);
}

.submit-button:focus-visible {
  outline: 3px solid rgb(85 184 199 / 34%);
  outline-offset: 3px;
}

.submit-button:disabled {
  cursor: wait;
  opacity: .72;
  transform: none;
}

.access-note {
  margin: 30px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.form-wrap.is-error {
  animation: form-error-feedback 220ms ease-out;
}

@keyframes form-error-feedback {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-5px); }
  70% { transform: translateX(4px); }
}

@media (max-width: 760px) {
  .login-layout {
    display: block;
    min-height: 100dvh;
    padding: 0;
    background: var(--form-surface);
  }

  .brand-panel {
    min-height: auto;
    border-radius: 0 0 var(--panel-radius) var(--panel-radius);
    background:
      radial-gradient(circle at 92% -12%, rgb(239 167 170 / 62%) 0 22%, transparent 22.5%),
      var(--brand-surface);
  }

  .brand-panel::after,
  .brand-copy {
    display: none;
  }

  .brand-panel__inner {
    min-height: auto;
    padding: 27px 24px 30px;
  }

  .brand-logo {
    width: 180px;
  }

  .form-panel {
    display: block;
    padding: 44px 24px 32px;
  }

  .form-wrap {
    margin: 0 auto;
  }

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

  .mobile-brand {
    display: block;
    margin-bottom: 13px;
    font-size: 12px;
  }

  .form-header h2 {
    font-size: 34px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #101b1e;
    --brand-surface: #18363c;
    --form-surface: #101b1e;
    --field-surface: #17272b;
    --text: #e7f1f2;
    --text-soft: #aabdc0;
    --line: #355156;
    --accent: #59bbc9;
    --accent-strong: #77cbd6;
    --accent-text: #10282d;
    --danger: #ffadb2;
    --danger-soft: #512c30;
    --focus: #77cbd6;
    --shadow: rgb(0 0 0 / 25%);
  }

  .brand-logo {
    filter: brightness(1.06) saturate(.92);
  }

  .brand-panel {
    background:
      radial-gradient(circle at 92% 12%, rgb(239 167 170 / 38%) 0 12%, transparent 12.4%),
      radial-gradient(circle at 3% 89%, rgb(82 184 199 / 25%) 0 23%, transparent 23.4%),
      var(--brand-surface);
  }

  .password-toggle:hover {
    background: rgb(85 184 199 / 16%);
  }
}

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

@media (forced-colors: active) {
  .field input,
  .submit-button,
  .password-toggle {
    border: 1px solid ButtonText;
  }
}
