:root {
  --ink: #143c3a;
  --teal: #087d71;
  --teal-dark: #07685f;
  --muted: #748d89;
  --border: #9fcac3;
  --sand: #cdb274;
  --danger: #aa5149;
  color: var(--ink);
  background: #fbfefd;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: #fbfefd;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

img {
  -webkit-user-drag: none;
  user-select: none;
}

[hidden] {
  display: none !important;
}

.login-page {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: #fbfefd;
}

.page-background {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.login-layout {
  display: grid;
  width: min(100%, 1440px);
  min-height: min(900px, 100dvh);
  grid-template-columns: minmax(0, 1.08fr) minmax(470px, 0.92fr);
  align-items: center;
  gap: clamp(34px, 4vw, 72px);
  padding-block: clamp(46px, 6vh, 76px);
  padding-left: clamp(48px, 6vw, 92px);
  padding-right: clamp(44px, 4vw, 56px);
}

.hero-panel {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 690px;
  flex-direction: column;
  justify-content: flex-end;
}

.brand-lockup {
  position: absolute;
  z-index: 3;
  top: 130px;
  left: 0;
  width: clamp(300px, 25vw, 370px);
  height: auto;
  object-fit: contain;
  object-position: left center;
  mix-blend-mode: multiply;
}

.hero-content {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 540px;
  align-items: center;
}

.hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  padding-bottom: 46px;
  transform: translateY(-30px);
}

.hero-copy h1 {
  margin: 0;
  color: #172020;
  font-size: clamp(48px, 4.05vw, 64px);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 1.12;
  white-space: nowrap;
}

.title-accent {
  display: block;
  width: 58px;
  height: 4px;
  margin-top: 28px;
  border-radius: 999px;
  background: var(--sand);
}

.hero-copy p {
  margin: 30px 0 0;
  color: #3d4f4c;
  font-size: clamp(20px, 1.7vw, 27px);
  font-weight: 440;
  letter-spacing: 0.01em;
  line-height: 1.55;
}

.hero-illustration {
  position: absolute;
  z-index: 1;
  right: clamp(-150px, -10vw, -72px);
  bottom: 80px;
  width: clamp(400px, 35vw, 500px);
  height: auto;
  object-fit: contain;
  pointer-events: none;
}

.login-card {
  width: min(100%, 540px);
  min-height: 564px;
  justify-self: end;
  padding: 76px clamp(42px, 4.5vw, 58px) 46px;
  border: 1px solid rgba(178, 216, 209, 0.48);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 74px rgba(25, 80, 74, 0.11);
  transform: translateY(12px);
}

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

.field-group {
  display: grid;
  gap: 14px;
}

.field-label {
  color: #172020;
  font-size: 17px;
  font-weight: 720;
  line-height: 1.3;
}

.field-shell {
  display: flex;
  min-height: 74px;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 8px 26px rgba(24, 86, 78, 0.035);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field-shell:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(8, 125, 113, 0.12);
}

.field-icon {
  width: 28px;
  height: 28px;
  margin: 0 19px 0 22px;
  flex: 0 0 auto;
}

.field-shell input {
  min-width: 0;
  height: 70px;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
}

.field-shell input::placeholder {
  color: #9aacaa;
}

.toggle-password {
  display: inline-flex;
  min-width: 82px;
  min-height: 48px;
  margin-right: 10px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--teal);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.toggle-password img {
  width: 17px;
  height: 17px;
}

.toggle-password:hover {
  background: #eef8f5;
}

.toggle-password:focus-visible,
.login-button:focus-visible,
.dialog-close:focus-visible,
.dialog-cancel:focus-visible {
  outline: 3px solid rgba(8, 125, 113, 0.24);
  outline-offset: 3px;
}

.login-button {
  width: 100%;
  min-height: 74px;
  margin-top: 18px;
  border: 0;
  border-radius: 12px;
  background: var(--teal);
  box-shadow: 0 14px 32px rgba(8, 125, 113, 0.2);
  color: #ffffff;
  font-size: 25px;
  font-weight: 760;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 150ms ease, transform 120ms ease, box-shadow 150ms ease;
}

.login-button:hover {
  background: var(--teal-dark);
  box-shadow: 0 16px 38px rgba(8, 125, 113, 0.25);
}

.login-button:active {
  transform: translateY(1px);
}

.login-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.login-message {
  display: flex;
  min-height: 22px;
  margin: 0;
  align-items: center;
  justify-content: center;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

.login-message:empty {
  display: none;
}

.security-note {
  display: flex;
  margin: 26px 0 0;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #718783;
  font-size: 15px;
}

.security-note img {
  width: 21px;
  height: 21px;
}

.password-dialog {
  width: min(470px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  border: 1px solid #d2e2de;
  border-radius: 22px;
  background: white;
  box-shadow: 0 30px 90px rgba(16, 42, 37, 0.28);
}

.password-dialog::backdrop {
  background: rgba(13, 35, 31, 0.5);
  backdrop-filter: blur(5px);
}

.password-dialog-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 28px;
}

.password-dialog-card label {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
}

.password-dialog-card input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  color: var(--ink);
  border: 1px solid #d2e2de;
  border-radius: 11px;
  outline: none;
  background: white;
  font-size: 16px;
}

.password-dialog-card input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 125, 113, 0.11);
}

.password-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.password-dialog-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.dialog-close {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  padding: 0;
  color: var(--muted);
  border: 1px solid #d2e2de;
  border-radius: 12px;
  background: #f4f7f5;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.first-use-note {
  margin: 0 0 8px;
  padding: 11px 13px;
  color: var(--teal-dark);
  border-radius: 10px;
  background: rgba(8, 125, 113, 0.09);
  font-size: 13px;
  line-height: 1.55;
}

.dialog-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  margin-top: 4px;
}

.dialog-actions .login-button {
  min-height: 48px;
  margin: 0;
  font-size: 15px;
}

.dialog-cancel {
  min-width: 86px;
  height: 48px;
  padding: 0 16px;
  color: var(--muted);
  border: 1px solid #d2e2de;
  border-radius: 11px;
  background: white;
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 1120px) {
  .login-layout {
    grid-template-columns: minmax(0, 1fr) minmax(430px, 0.9fr);
    gap: 30px;
    padding-inline: 46px;
  }

  .hero-panel {
    min-height: 620px;
  }

  .hero-copy h1 {
    font-size: 46px;
  }

  .hero-illustration {
    right: -102px;
    bottom: 64px;
    width: 390px;
  }
}

@media (max-width: 880px) {
  .login-page {
    overflow: auto;
  }

  .login-layout {
    min-height: 100dvh;
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 42px 28px 52px;
  }

  .hero-panel {
    min-height: 410px;
  }

  .brand-lockup {
    position: static;
    width: 270px;
  }

  .hero-content {
    min-height: 330px;
  }

  .hero-copy {
    padding-bottom: 0;
    transform: none;
  }

  .hero-copy h1 {
    font-size: clamp(38px, 7vw, 52px);
  }

  .hero-copy p {
    max-width: 390px;
    font-size: 20px;
  }

  .hero-illustration {
    right: -22px;
    bottom: -30px;
    width: min(54vw, 390px);
  }

  .login-card {
    width: min(100%, 590px);
    min-height: auto;
    justify-self: center;
    transform: none;
  }
}

@media (max-width: 680px) {
  .login-page {
    display: block;
    overflow: auto;
  }

  .page-background {
    display: none;
  }

  .login-layout {
    display: block;
    min-height: 100dvh;
    padding: max(32px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  }

  .hero-panel {
    display: flex;
    min-height: 340px;
  }

  .brand-lockup {
    width: 220px;
    margin-bottom: 10px;
  }

  .hero-content {
    min-height: 280px;
    flex: 1;
    overflow: hidden;
  }

  .hero-copy {
    align-self: start;
    padding-top: 52px;
  }

  .hero-copy h1 {
    color: #133e3b;
    font-size: 34px;
  }

  .title-accent {
    width: 42px;
    margin-top: 12px;
  }

  .hero-copy p {
    width: 216px;
    margin-top: 18px;
    color: #5b7874;
    font-size: 14px;
    line-height: 1.65;
  }

  .hero-illustration {
    top: 34px;
    right: -40px;
    bottom: auto;
    width: 250px;
  }

  .login-card {
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .login-form {
    gap: 16px;
  }

  .field-group {
    gap: 8px;
  }

  .field-label {
    color: #3f6561;
    font-size: 13px;
    font-weight: 650;
  }

  .field-shell {
    min-height: 62px;
    border-width: 1px;
    border-radius: 16px;
  }

  .field-icon {
    width: 19px;
    height: 19px;
    margin: 0 14px 0 17px;
  }

  .field-shell input {
    height: 60px;
    font-size: 16px;
  }

  .toggle-password {
    min-width: 68px;
    min-height: 44px;
    margin-right: 7px;
    font-size: 13px;
  }

  .login-button {
    min-height: 58px;
    margin-top: 3px;
    border-radius: 16px;
    font-size: 16px;
    letter-spacing: 0.08em;
  }

  .login-message {
    min-height: 20px;
    font-size: 12px;
  }

  .security-note {
    margin-top: 12px;
    gap: 7px;
    font-size: 11px;
  }

  .security-note img {
    width: 13px;
    height: 13px;
  }

  .password-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 18px;
  }

  .password-dialog-card {
    padding: 22px 18px;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }

  .dialog-cancel {
    order: 2;
    width: 100%;
  }

  html[data-keyboard-visible="true"] .login-layout {
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  html[data-keyboard-visible="true"] .hero-panel {
    min-height: 108px;
  }

  html[data-keyboard-visible="true"] .brand-lockup,
  html[data-keyboard-visible="true"] .hero-copy p,
  html[data-keyboard-visible="true"] .hero-illustration,
  html[data-keyboard-visible="true"] .security-note {
    display: none;
  }

  html[data-keyboard-visible="true"] .hero-content {
    min-height: 108px;
  }

  html[data-keyboard-visible="true"] .hero-copy {
    padding-top: 14px;
  }

  html[data-keyboard-visible="true"] .hero-copy h1 {
    font-size: 28px;
  }

  html[data-keyboard-visible="true"] .title-accent {
    margin-top: 8px;
  }

  html[data-keyboard-visible="true"] .login-form {
    gap: 12px;
  }

  html[data-keyboard-visible="true"] .field-group {
    scroll-margin-block: 18px;
  }

  html[data-keyboard-visible="true"] .field-shell {
    min-height: 58px;
  }

  html[data-keyboard-visible="true"] .field-shell input {
    height: 56px;
  }
}

@media (max-width: 360px) {
  .login-layout {
    padding-inline: max(18px, env(safe-area-inset-left));
  }

  .hero-copy h1 {
    font-size: 31px;
  }

  .hero-illustration {
    right: -54px;
    width: 232px;
  }
}

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