:root {
  --paper: #f2f1ed;
  --paper-soft: #f8f7f3;
  --surface: #fcfcfa;
  --ink: #132d28;
  --ink-deep: #0d2723;
  --ink-soft: #51625d;
  --muted: #82908b;
  --line: #d9ded9;
  --line-dark: rgba(237, 235, 222, .22);
  --brand: #143d35;
  --brand-light: #e8e4d4;
  --accent: #1570d8;
  --accent-soft: rgba(21, 112, 216, .10);
  --champagne: #c2a970;
  --danger: #c9362b;
  --radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  font-size: 14px;
  line-height: 1.5;
}

button,
input { font: inherit; }

input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(201, 54, 43, .09);
}

.login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(520px, 56%) minmax(420px, 44%);
  background: var(--surface);
}

.login-brand-panel {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(34px, 4.4vw, 70px);
  color: var(--brand-light);
  background:
    linear-gradient(118deg, transparent 0 64%, rgba(255, 255, 255, .025) 64% 64.2%, transparent 64.2%),
    linear-gradient(26deg, transparent 0 73%, rgba(255, 255, 255, .018) 73% 73.2%, transparent 73.2%),
    var(--brand);
}

.login-brand-panel::before {
  content: "Q";
  position: absolute;
  right: -2.5vw;
  bottom: -12vw;
  color: rgba(232, 228, 212, .045);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(420px, 54vw, 780px);
  line-height: .74;
  pointer-events: none;
  user-select: none;
}

.login-brand-panel::after {
  content: "";
  position: absolute;
  top: 0;
  right: 15%;
  width: 1px;
  height: 100%;
  background: linear-gradient(transparent 7%, var(--line-dark) 7% 72%, transparent 72%);
  pointer-events: none;
}

.brand-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-wordmark {
  color: #f4f1e6;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .18em;
}

.system-badge {
  padding: 6px 9px 5px;
  border: 1px solid var(--line-dark);
  color: rgba(244, 241, 230, .68);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .11em;
}

.brand-stage {
  position: relative;
  z-index: 1;
  width: min(620px, 85%);
  margin: auto 0;
  padding: clamp(70px, 11vh, 126px) 0 clamp(58px, 8vh, 92px);
}

.brand-sequence {
  display: grid;
  grid-template-columns: auto minmax(44px, 78px) auto;
  align-items: center;
  gap: 13px;
  width: fit-content;
  margin-bottom: 27px;
  color: rgba(244, 241, 230, .58);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  letter-spacing: .16em;
}

.brand-sequence i {
  display: block;
  height: 1px;
  background: var(--champagne);
  opacity: .78;
}

.brand-stage h1 {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-weight: 500;
}

.brand-stage h1 span {
  color: #f5f2e8;
  font-size: clamp(42px, 5vw, 74px);
  line-height: 1.08;
  letter-spacing: -.055em;
}

.brand-stage h1 strong {
  margin-top: 8px;
  color: rgba(232, 228, 212, .32);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 4vw, 58px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: .16em;
}

.brand-description {
  max-width: 500px;
  margin: 28px 0 0;
  color: rgba(244, 241, 230, .68);
  font-size: 14px;
  line-height: 1.9;
}

.brand-pipeline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 40px;
  color: rgba(244, 241, 230, .72);
  font-size: 11px;
  letter-spacing: .08em;
}

.brand-pipeline i {
  width: 22px;
  height: 1px;
  background: rgba(244, 241, 230, .28);
}

.brand-foot {
  position: relative;
  z-index: 1;
  display: flex;
  gap: clamp(40px, 7vw, 100px);
  padding-top: 20px;
  border-top: 1px solid var(--line-dark);
}

.brand-foot div { display: grid; gap: 5px; }

.brand-foot span {
  color: rgba(244, 241, 230, .36);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  letter-spacing: .15em;
}

.brand-foot strong {
  color: rgba(244, 241, 230, .72);
  font-size: 11px;
  font-weight: 500;
}

.login-workspace {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(48px, 7vw, 112px);
  background:
    linear-gradient(90deg, transparent calc(100% - 72px), rgba(19, 45, 40, .05) calc(100% - 72px), rgba(19, 45, 40, .05) calc(100% - 71px), transparent calc(100% - 71px)),
    var(--surface);
}

.login-workspace-inner {
  width: min(100%, 410px);
}

.mobile-wordmark { display: none; }

.access-mark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(46px, 8vh, 88px);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  letter-spacing: .16em;
}

.access-mark b {
  color: var(--champagne);
  font-size: 12px;
  font-weight: 400;
}

.login-form { width: 100%; }

.login-form-head { margin-bottom: 38px; }

.form-eyebrow {
  margin: 0 0 13px;
  color: #27736a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
}

.login-form-head h2 {
  margin: 0;
  color: var(--ink-deep);
  font-size: clamp(28px, 2.35vw, 36px);
  font-weight: 650;
  line-height: 1.22;
  letter-spacing: -.04em;
}

.login-form-head > p:last-child {
  margin: 12px 0 0;
  color: var(--ink-soft);
}

.form-field { margin-top: 22px; }

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 9px;
}

.field-label-row label {
  color: var(--ink);
  font-weight: 650;
}

.field-label-row span {
  color: #a0aaa6;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  letter-spacing: .12em;
}

.form-field input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  color: var(--ink-deep);
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.form-field input::placeholder { color: #a4adaa; }
.form-field input:hover { border-color: #b7c0bc; }
.form-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.password-field { position: relative; }
.password-field input { padding-right: 68px; }

.password-toggle {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 58px;
  height: 46px;
  border: 0;
  border-radius: 4px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease;
}

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

.password-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form-message {
  min-height: 21px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}

.login-submit {
  position: relative;
  width: 100%;
  height: 52px;
  margin-top: 12px;
  border: 1px solid var(--ink-deep);
  border-radius: var(--radius);
  color: #f8f6ee;
  background: var(--ink-deep);
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background-color .16s ease, transform .12s ease, box-shadow .16s ease;
}

.login-submit:hover {
  background: #19463e;
  box-shadow: 0 8px 22px rgba(13, 39, 35, .17);
}

.login-submit:active { transform: translateY(1px); }
.login-submit:focus-visible { outline: 3px solid rgba(21, 112, 216, .22); outline-offset: 3px; }
.login-submit:disabled { cursor: wait; opacity: .78; transform: none; }

.submit-spinner {
  display: none;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.login-form[aria-busy="true"] .submit-spinner { display: inline-block; }

.form-footnote {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.workspace-foot {
  margin: clamp(50px, 9vh, 96px) 0 0;
  color: #a3aca8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  letter-spacing: .14em;
  text-align: center;
}

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

@media (max-width: 1040px) {
  .login-shell { grid-template-columns: minmax(420px, 51%) minmax(380px, 49%); }
  .brand-stage { width: 92%; }
  .login-workspace { padding: 52px; }
}

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

  .login-brand-panel {
    min-height: 206px;
    padding: 28px clamp(24px, 6vw, 48px);
  }

  .login-brand-panel::before {
    right: -20px;
    bottom: -150px;
    font-size: 390px;
  }

  .login-brand-panel::after { right: 22%; }
  .system-badge, .brand-description, .brand-pipeline, .brand-foot { display: none; }

  .brand-stage {
    width: auto;
    margin: auto 0 0;
    padding: 30px 0 0;
  }

  .brand-sequence { display: none; }

  .brand-stage h1 span {
    font-size: clamp(31px, 7vw, 44px);
    letter-spacing: -.045em;
  }

  .brand-stage h1 strong {
    margin-top: 4px;
    font-size: 20px;
    letter-spacing: .18em;
  }

  .login-workspace {
    min-height: calc(100dvh - 206px);
    display: block;
    padding: 54px clamp(24px, 7vw, 64px) calc(34px + env(safe-area-inset-bottom));
    background: var(--surface);
  }

  .login-workspace-inner { margin: 0 auto; }
  .access-mark { display: none; }
  .workspace-foot { margin-top: 54px; }
}

@media (max-width: 520px) {
  .login-brand-panel {
    min-height: 170px;
    padding: 23px 20px;
  }

  .brand-wordmark { font-size: 18px; }

  .brand-stage {
    margin-top: auto;
    padding-top: 24px;
  }

  .brand-stage h1 span { font-size: 29px; }
  .brand-stage h1 strong { font-size: 15px; }

  .login-workspace {
    min-height: calc(100dvh - 170px);
    padding: 38px 20px calc(28px + env(safe-area-inset-bottom));
  }

  .login-form-head { margin-bottom: 30px; }
  .login-form-head h2 { font-size: 27px; }
  .form-field input { font-size: 16px; }
  .workspace-foot { display: none; }
}

@media (max-height: 700px) and (min-width: 821px) {
  .login-brand-panel { padding-top: 28px; padding-bottom: 28px; }
  .brand-stage { padding-top: 30px; padding-bottom: 30px; }
  .brand-stage h1 span { font-size: 44px; }
  .brand-stage h1 strong { font-size: 32px; }
  .brand-description { margin-top: 18px; }
  .brand-pipeline { margin-top: 22px; }
  .login-workspace { padding-top: 28px; padding-bottom: 28px; }
  .access-mark { margin-bottom: 32px; }
  .workspace-foot { margin-top: 36px; }
}

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