:root {
  --ink: #17232e;
  --ink-soft: #61707a;
  --ink-faint: #8a969e;
  --navy: #13212d;
  --teal: #28786f;
  --teal-dark: #1d6159;
  --teal-soft: #e8f3f0;
  --paper: #f3f1eb;
  --surface: #ffffff;
  --line: #d9e0dc;
  --amber: #ad642e;
  --amber-soft: #fff1e5;
  --red: #ad3e3e;
  --red-soft: #fff0ef;
  --shadow: 0 30px 80px rgba(14, 29, 39, 0.13);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 0.92fr) minmax(520px, 1.08fr);
}

.story-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: clamp(32px, 5vw, 64px);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 20% 15%, rgba(96, 175, 164, 0.22), transparent 32%),
    linear-gradient(145deg, #172b38, #101d27 68%);
}

.story-panel::after {
  position: absolute;
  right: -14%;
  bottom: -18%;
  width: 66%;
  aspect-ratio: 1;
  content: "";
  border: 1px solid rgba(139, 203, 194, 0.16);
  border-radius: 50%;
  box-shadow:
    0 0 0 58px rgba(139, 203, 194, 0.025),
    0 0 0 116px rgba(139, 203, 194, 0.018);
}

.story-panel__texture {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom right, black, transparent 78%);
}

.story-brand,
.story-copy,
.story-rule {
  position: relative;
  z-index: 1;
}

.story-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.story-brand__mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: #a4d4cd;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 13px;
}

.story-brand__mark svg {
  width: 30px;
  height: 30px;
}

.story-brand strong,
.story-brand span {
  display: block;
}

.story-brand strong {
  font-size: 18px;
  letter-spacing: 0.08em;
}

.story-brand span {
  margin-top: 1px;
  color: #81959f;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.story-copy {
  max-width: 560px;
  margin: auto 0;
  padding: 80px 0;
}

.story-copy__eyebrow {
  color: #83c4bb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.story-copy h1 {
  margin: 16px 0 19px;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: clamp(43px, 5.2vw, 72px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.18;
}

.story-copy p {
  max-width: 450px;
  margin: 0;
  color: #a9bac0;
  font-size: 14px;
  line-height: 1.9;
}

.story-rule {
  display: flex;
  width: 92px;
  gap: 7px;
}

.story-rule span {
  display: block;
  height: 2px;
  background: rgba(145, 205, 197, 0.65);
}

.story-rule span:nth-child(1) {
  width: 44px;
}

.story-rule span:nth-child(2) {
  width: 22px;
  opacity: 0.5;
}

.story-rule span:nth-child(3) {
  width: 9px;
  opacity: 0.25;
}

.form-panel {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 54px clamp(28px, 7vw, 96px) 78px;
  background:
    radial-gradient(circle at 100% 0, rgba(40, 120, 111, 0.09), transparent 33%),
    var(--paper);
}

.login-card {
  width: min(440px, 100%);
  padding: 42px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(208, 216, 212, 0.92);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.mobile-brand {
  display: none;
}

.login-heading > span {
  color: var(--teal);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.17em;
}

.login-heading h2 {
  margin: 7px 0 5px;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.login-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

#login-form {
  display: grid;
  gap: 18px;
  margin-top: 32px;
}

#login-form[hidden],
.help-text[hidden] {
  display: none;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: #465762;
  font-size: 11px;
  font-weight: 700;
}

.field-control {
  position: relative;
}

.field-control > svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 17px;
  height: 17px;
  pointer-events: none;
  fill: none;
  stroke: #89969e;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateY(-50%);
}

.field-control input {
  width: 100%;
  height: 48px;
  padding: 0 43px 0 42px;
  color: var(--ink);
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: 150ms ease;
}

.field-control input::placeholder {
  color: #a6afb4;
}

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

.field-control input:focus {
  background: #fff;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(40, 120, 111, 0.1);
}

.field-control input:disabled {
  opacity: 0.65;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  color: #839198;
  background: transparent;
  border: 0;
  border-radius: 8px;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--teal);
  background: var(--teal-soft);
}

.password-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form-message {
  display: none;
  min-height: 0;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 11px;
  line-height: 1.55;
}

.form-message:not(:empty) {
  display: block;
}

.form-message[data-type="error"] {
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid #efcdca;
}

.form-message[data-type="warning"] {
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid #eed1b9;
}

.login-button {
  display: flex;
  height: 49px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
  color: #fff;
  background: var(--teal);
  border: 0;
  border-radius: 10px;
  box-shadow: 0 9px 23px rgba(40, 120, 111, 0.23);
  font-size: 13px;
  font-weight: 750;
  transition: 150ms ease;
}

.login-button:hover:not(:disabled) {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

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

.login-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.help-text {
  margin: 17px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  text-align: center;
}

.security-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 27px;
  padding-top: 18px;
  color: #849198;
  border-top: 1px solid #e7ebe9;
  font-size: 9px;
  line-height: 1.6;
}

.security-note svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: #67988f;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.setup-panel {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 27px;
  padding: 15px;
  color: #835126;
  background: var(--amber-soft);
  border: 1px solid #efd1b6;
  border-radius: 11px;
}

.setup-panel[hidden] {
  display: none;
}

.setup-panel__icon {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  place-items: center;
  color: #ae6932;
  background: rgba(255, 255, 255, 0.58);
  border-radius: 8px;
}

.setup-panel__icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.setup-panel strong {
  font-size: 12px;
}

.setup-panel p {
  margin: 3px 0 8px;
  font-size: 10px;
  line-height: 1.65;
}

.setup-panel code {
  display: block;
  padding: 8px;
  overflow-x: auto;
  color: #704321;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  font-family: Consolas, monospace;
  font-size: 8px;
  line-height: 1.5;
  white-space: nowrap;
}

.form-panel footer {
  position: absolute;
  bottom: 23px;
  color: #9aa3a8;
  font-size: 9px;
  letter-spacing: 0.05em;
}

@media (max-width: 920px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .story-panel {
    display: none;
  }

  .form-panel {
    padding: 56px 22px 74px;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 35px;
  }

  .mobile-brand__mark {
    display: grid;
    width: 37px;
    height: 37px;
    place-items: center;
    color: var(--teal);
    background: var(--teal-soft);
    border-radius: 10px;
  }

  .mobile-brand__mark svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
  }

  .mobile-brand strong {
    font-size: 16px;
    letter-spacing: 0.06em;
  }
}

@media (max-width: 520px) {
  .form-panel {
    display: block;
    padding: 24px 15px 65px;
  }

  .login-card {
    padding: 28px 22px;
    border-radius: 17px;
  }

  .login-heading h2 {
    font-size: 28px;
  }

  .form-panel footer {
    right: 0;
    bottom: 18px;
    left: 0;
    text-align: center;
  }
}

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