:root {
  --bg: #f3f6f1;
  --card: #ffffff;
  --ink: #13251d;
  --muted: #65736b;
  --line: #dce4dd;
  --green: #126a45;
  --green-deep: #0b4c34;
  --green-soft: #2c8a62;
  --lime: #d8f06a;
  --red: #b84236;
  --orange: #a96314;
  --shadow: 0 28px 80px rgba(20, 46, 32, .12);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(216, 240, 106, .28), transparent 28rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

.login-shell {
  width: min(1180px, calc(100% - 48px));
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(32px, env(safe-area-inset-top)) 0 max(32px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(390px, .75fr);
  gap: 70px;
  align-items: center;
}

.brand-panel { min-width: 0; padding: 18px 0; }

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

.logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  padding: 10px;
  display: flex;
  align-items: end;
  gap: 3px;
  background: var(--green);
  box-shadow: 0 12px 28px rgba(18, 106, 69, .2);
}

.logo span { flex: 1; border-radius: 2px 2px 0 0; background: var(--lime); }
.logo span:nth-child(1) { height: 45%; }
.logo span:nth-child(2) { height: 72%; }
.logo span:nth-child(3) { height: 58%; }
.logo span:nth-child(4) { height: 92%; }

.brand-name { color: var(--green); font-size: 12px; font-weight: 850; letter-spacing: .12em; }

.brand-copy { margin: clamp(54px, 8vh, 86px) 0 40px; }

.eyebrow {
  margin: 0 0 13px;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .12em;
}

.brand-headline {
  max-width: 700px;
  margin: 0;
  font-size: clamp(42px, 5.2vw, 68px);
  line-height: 1.02;
  letter-spacing: -.055em;
  font-weight: 900;
}

.brand-description {
  max-width: 610px;
  margin: 23px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.scope-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.scope-item {
  min-width: 0;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(19, 37, 29, .08);
  border-radius: 17px;
}

.scope-index {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--green);
  background: rgba(216, 240, 106, .34);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 900;
}

.scope-item strong, .scope-item span { display: block; }
.scope-item strong { font-size: 13px; }
.scope-item div > span { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }

.signal-card {
  margin-top: 12px;
  padding: 15px 17px 8px;
  overflow: hidden;
  border: 1px solid rgba(19, 37, 29, .08);
  border-radius: 18px;
  background: rgba(255, 255, 255, .7);
}

.signal-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .1em; }
.live-dot { color: var(--green); letter-spacing: 0; }
.live-dot::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--green-soft); box-shadow: 0 0 0 4px rgba(44, 138, 98, .12); }
.signal-card svg { display: block; width: 100%; height: 88px; margin-top: 8px; overflow: visible; }
.signal-card .area { fill: url(#area); }
.signal-card .line { fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; }
.signal-card circle { fill: var(--lime); stroke: var(--green); stroke-width: 3; }

.auth-panel { min-width: 0; }
.auth-wrap { width: min(100%, 440px); margin-left: auto; }

.auth-card {
  position: relative;
  overflow: hidden;
  padding: 38px;
  background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(19, 37, 29, .08);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.auth-card::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -100px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(216, 240, 106, .16);
  pointer-events: none;
}

.secure-pill {
  width: max-content;
  padding: 7px 11px;
  color: var(--green);
  background: #edf5ef;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}
.secure-pill span { margin-right: 5px; color: var(--green-soft); font-size: 8px; }

.login-title { margin: 23px 0 8px; font-size: 31px; line-height: 1.2; letter-spacing: -.04em; }
.auth-description { margin: 0 0 26px; color: var(--muted); font-size: 13px; }

.notice {
  margin: 0 0 18px;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid rgba(184, 66, 54, .2);
  color: var(--red);
  background: #fff1ef;
  font-size: 12px;
  line-height: 1.55;
}
.notice.success { color: var(--green); border-color: rgba(18, 106, 69, .2); background: #edf7f0; }
.notice.info { color: var(--orange); border-color: rgba(169, 99, 20, .2); background: #fff7ea; }

form { position: relative; z-index: 1; }
.field + .field { margin-top: 17px; }
.field label { display: block; margin-bottom: 8px; color: #32443a; font-size: 12px; font-weight: 800; }

.input-wrap { position: relative; }
.field-icon { position: absolute; left: 14px; top: 50%; width: 19px; height: 19px; transform: translateY(-50%); color: #829087; pointer-events: none; }
.field-icon svg, .shield svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

input {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 44px;
  color: var(--ink);
  background: #f7f9f6;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  font-size: 14px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input::placeholder { color: #9aa49e; }
input:hover { border-color: #bdc9c0; }
input:focus { background: white; border-color: var(--green-soft); box-shadow: 0 0 0 4px rgba(44, 138, 98, .11); }
input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 4px rgba(184, 66, 54, .08); }
input:disabled { opacity: .68; cursor: wait; }

.password-toggle {
  position: absolute;
  right: 7px;
  top: 50%;
  min-width: 42px;
  min-height: 42px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  color: var(--green);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.password-toggle:hover { background: #edf5ef; }
.password-toggle:focus-visible { outline: 3px solid rgba(44, 138, 98, .22); }

.field-error { min-height: 15px; display: block; margin: 5px 2px 0; color: var(--red); font-size: 10px; }

.session-note {
  margin: 8px 0 18px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 9px;
  align-items: start;
  color: var(--muted);
  background: #f4f7f3;
  border-radius: 12px;
  font-size: 10px;
  line-height: 1.55;
}
.shield { width: 18px; height: 18px; color: var(--green-soft); }

.submit-button {
  width: 100%;
  min-height: 52px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 13px;
  color: white;
  background: var(--green);
  box-shadow: 0 12px 25px rgba(18, 106, 69, .19);
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.submit-button:hover { background: #0e5d3c; box-shadow: 0 15px 30px rgba(18, 106, 69, .24); transform: translateY(-1px); }
.submit-button:active { transform: translateY(0); }
.submit-button:focus-visible { outline: 4px solid rgba(44, 138, 98, .25); outline-offset: 2px; }
.submit-button:disabled { opacity: .78; cursor: wait; transform: none; }
.button-arrow { position: absolute; right: 18px; font-size: 18px; }
.spinner { display: none; width: 15px; height: 15px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
.submit-button.loading .spinner { display: block; }
.submit-button.loading .button-arrow { display: none; }

.help-text { position: relative; z-index: 1; margin: 24px 0 0; color: var(--muted); text-align: center; font-size: 10px; line-height: 1.65; }

footer { margin-top: 17px; padding: 0 4px; display: flex; justify-content: space-between; color: #7d8982; font-size: 10px; }
.noscript { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); padding: 12px 16px; color: white; background: var(--red); border-radius: 10px; font-size: 12px; }

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

@media (max-width: 980px) {
  .login-shell { width: min(760px, calc(100% - 34px)); grid-template-columns: 1fr; gap: 34px; align-items: start; }
  .brand-panel { padding-top: 10px; }
  .brand-copy { margin: 38px 0 28px; }
  .brand-headline { font-size: clamp(38px, 8vw, 58px); }
  .signal-card { display: none; }
  .auth-wrap { width: 100%; margin: 0; }
}

@media (max-width: 600px) {
  .login-shell {
    width: min(calc(100% - 24px), 430px);
    padding: max(12px, env(safe-area-inset-top)) 0 max(16px, env(safe-area-inset-bottom));
    gap: 12px;
    align-content: start;
  }
  .brand-panel { padding: 0 2px; }
  .brand-copy, .scope-list, .signal-card { display: none; }
  .brand-mark { gap: 10px; }
  .logo { width: 34px; height: 34px; padding: 8px; border-radius: 10px; }
  .brand-name { font-size: 9px; letter-spacing: .08em; }
  .auth-card { padding: 20px 16px 18px; border-radius: 18px; box-shadow: 0 12px 36px rgba(20, 46, 32, .1); }
  .auth-card::after, .secure-pill { display: none; }
  .login-title { margin: 0 0 4px; font-size: 26px; }
  .auth-description { margin-bottom: 16px; font-size: 12px; }
  .field + .field { margin-top: 12px; }
  .field label { margin-bottom: 6px; }
  input { height: 48px; font-size: 16px; }
  .password-toggle { min-width: 44px; min-height: 44px; }
  .field-error:empty { min-height: 0; margin-top: 0; }
  .field-error:not(:empty) { min-height: 15px; margin-top: 5px; }
  .session-note { margin: 6px 0 12px; padding: 8px 10px; }
  .submit-button { min-height: 48px; }
  .help-text { margin-top: 14px; }
  footer { display: none; }
}

@media (max-width: 340px) {
  .auth-card { padding-inline: 14px; }
}

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