@font-face {
  font-family: "MileReha Display";
  src: url("/auth/milereha-display.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  font:
    14px/1.55 -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  --display-font: "MileReha Display", "Songti SC", STSong, SimSun, serif;
  --paper: #f6f5ef;
  --surface: #fffefa;
  --ink: #19382e;
  --muted: #52665a;
  --accent: #1b624d;
  --line: #dce1d7;
  background: var(--paper);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}
body {
  margin: 0 auto;
  width: min(100%, 1320px);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(18px, env(safe-area-inset-top)) clamp(24px, 5vw, 58px)
    max(15px, env(safe-area-inset-bottom));
}
.login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 59px;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.login-brand img {
  display: block;
  border-radius: 11px;
}
.login-brand strong {
  display: block;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.25;
}
.login-brand span {
  display: block;
  font-size: 11px;
  margin-top: 2px;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.trial-label {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(330px, 0.9fr);
  align-items: center;
  gap: clamp(28px, 6.4vw, 92px);
  flex: 1;
  padding-block: clamp(29px, 5vh, 62px);
}
h1,
h2,
p,
figure {
  margin: 0;
}
.login-intro {
  overflow: hidden;
  background: transparent;
  color: var(--ink);
  border-radius: 0;
}
.intro-copy {
  padding: 0 0 30px;
}
.eyebrow {
  color: #5d7767;
  font-size: 12px;
  letter-spacing: 0.13em;
  margin-bottom: 10px;
}
h1 {
  font: 600 clamp(34px, 4.05vw, 56px)/1.35 var(--display-font);
  letter-spacing: -0.045em;
}
h1 span {
  color: #dcb37c;
}
.intro-note {
  max-width: 25em;
  margin-top: 15px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  text-wrap: pretty;
}
.login-image {
  position: relative;
  aspect-ratio: 1.95;
  border-radius: 18px;
  overflow: hidden;
  background: #d8c4a7;
}
.login-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.login-image figcaption {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  padding: 24px 16px 9px;
  color: #fff;
  background: linear-gradient(0deg, #191f18b8, transparent);
  font-size: 11px;
  text-align: right;
}

.login-card {
  min-width: 0;
  padding: 22px 0 22px clamp(28px, 4vw, 54px);
  border-left: 1px solid var(--line);
}
h2 {
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.login-card > p {
  color: var(--muted);
  margin-top: 5px;
}
.login-card .login-welcome {
  color: #6e8276;
  font-size: 10px;
  letter-spacing: 0.16em;
  margin: 0 0 14px;
}
form {
  display: grid;
  gap: 7px;
  margin-top: 28px;
}
label {
  font-size: 13px;
  font-weight: 600;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
.password-field {
  display: flex;
  border: 1px solid #bacabe;
  border-radius: 10px;
  background: #fff;
}
.password-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #17624b24;
}
.password-field:has([aria-invalid="true"]) {
  border-color: #a03127;
}
.password-field input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 8px 12px;
  color: var(--ink);
  border: 0;
  border-radius: 10px;
  background: transparent;
  outline: none;
  font-size: 16px;
}
.password-field button {
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--accent);
  min-width: 48px;
  font-size: 12px;
}
.password-field button:hover {
  background: #eef4eb;
}
.enter-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 10px;
  min-height: 49px;
  padding: 0 14px;
  margin-top: 5px;
  background: var(--accent);
  color: white;
  font-size: 14px;
  font-weight: 650;
  transition: background-color 160ms ease;
}
.enter-button svg {
  transition: transform 160ms ease;
}
.enter-button:hover:not(:disabled) {
  background: #154c3c;
}
.enter-button:hover:not(:disabled) svg {
  transform: translateX(3px);
}
.enter-button:disabled {
  opacity: 0.65;
  cursor: wait;
}
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.error {
  color: #a03127;
  font-size: 13px;
}
.login-card .session-note {
  margin-top: 12px;
  font-size: 12px;
}
.login-footer {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1000px) {
  body {
    max-width: 510px;
    padding-inline: clamp(14px, 4.1vw, 23px);
  }
  .login-header {
    min-height: 43px;
  }
  .login-brand img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }
  .login-brand strong {
    font-size: 15px;
  }
  .login-brand span {
    font-size: 10px;
  }
  .login-layout {
    flex: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding-block: 16px 11px;
  }
  .login-intro {
    border-radius: 17px;
    background: #153c31;
    color: #f9f7ed;
  }
  .eyebrow {
    color: #c3d8be;
  }
  .intro-note {
    color: #e0e9df;
  }
  .login-card .login-welcome {
    display: none;
  }
  .intro-copy {
    padding: 17px 18px 15px;
  }
  .eyebrow {
    margin-bottom: 5px;
    font-size: 11px;
  }
  h1 {
    font-size: clamp(25px, 7.2vw, 34px);
    line-height: 1.32;
  }
  .intro-note {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.55;
  }
  .login-image {
    aspect-ratio: 3.25;
    border-radius: 0;
  }
  .login-image figcaption {
    padding-right: 12px;
    font-size: 10px;
  }
  .login-card {
    position: relative;
    margin: 0;
    padding: 15px 17px 12px;
    border-radius: 15px;
    border: 0;
    background: var(--surface);
    box-shadow: 0 4px 18px #24423508;
  }
  h2 {
    font-size: 20px;
  }
  .login-card > p {
    font-size: 13px;
  }
  form {
    margin-top: 12px;
  }
  .login-footer {
    padding-left: 0;
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .enter-button,
  .enter-button svg {
    transition: none;
  }
}

@media (min-width: 761px) and (max-width: 1000px) {
  body {
    max-width: 620px;
  }
  .login-layout {
    padding-block: 28px 18px;
    gap: 22px;
  }
  .intro-copy {
    padding: 26px;
  }
  h1 {
    font-size: 40px;
  }
  .intro-note {
    font-size: 14px;
  }
  .login-image {
    aspect-ratio: 2.8;
  }
  .login-card {
    padding: 26px;
  }
  h2 {
    font-size: 24px;
  }
}
