:root {
  font-family:"Segoe UI","Microsoft YaHei",system-ui,sans-serif;
  color:#17202a;
  background:#f5f7fa;
  font-synthesis:none;
  --muted:#687689;
  --blue:#2563eb;
  --line:#dfe5ed;
}
* { box-sizing:border-box; }
html { width:100%; height:100%; overflow:hidden; }
body {
  position:fixed;
  inset:0;
  margin:0;
  width:100%;
  height:100vh;
  height:var(--login-viewport-height,100dvh);
  overflow:hidden;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
}
button,input { font:inherit; }
button { cursor:pointer; }
button:disabled { cursor:wait; opacity:.65; }
a { color:inherit; text-decoration:none; }
[hidden] { display:none!important; }
button:focus-visible,a:focus-visible,input:focus-visible { outline:3px solid #a9c3ff; outline-offset:3px; }
.login-header,.login-footer {
  width:min(1280px,100%);
  margin:0 auto;
  padding:clamp(12px,3.5dvh,32px) clamp(20px,4.4vw,56px);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  min-width:0;
}
.login-header { grid-row:1; }
.login-footer { grid-row:3; }
.brand { display:flex; align-items:center; gap:12px; font-size:17px; font-weight:700; letter-spacing:-.3px; }
.brand small { display:block; margin-top:5px; font-size:11px; font-weight:400; letter-spacing:1px; color:var(--muted); }
.brand-icon { display:grid; place-items:center; position:relative; width:42px; height:42px; border-radius:11px; background:#202d43; color:white; font:29px Georgia,serif; }
.brand-icon i { position:absolute; right:7px; top:7px; width:6px; height:6px; background:#7be1b1; border-radius:50%; }
.local-badge { display:flex; align-items:center; gap:8px; border:1px solid var(--line); border-radius:30px; padding:8px 12px; color:#566578; font-size:11px; background:#fff; white-space:nowrap; }
.local-badge i { width:6px; height:6px; background:#318770; border-radius:50%; }
.login-layout {
  grid-row:2;
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);
  grid-template-rows:minmax(0,1fr);
  align-items:center;
  gap:clamp(28px,6.5vw,84px);
  width:min(1168px,100%);
  min-width:0;
  min-height:0;
  margin:0 auto;
  padding:clamp(8px,2.5dvh,28px) clamp(20px,4.4vw,56px);
}
.welcome { min-width:0; }
.eyebrow { display:flex; align-items:center; gap:10px; font-size:10px; font-weight:650; letter-spacing:2px; color:#6e7d91; }
.eyebrow>span { height:1px; width:25px; background:#7e96bb; }
h1 { font-size:clamp(28px,3.4vw,45px); line-height:1.45; letter-spacing:-1.5px; font-weight:650; margin:22px 0 16px; }
h1>span { color:var(--blue); }
.welcome-description { font-size:13px; line-height:2.1; color:var(--muted); margin:0; }
.workspace-map { display:flex; align-items:center; justify-content:space-between; position:relative; max-width:370px; height:142px; margin:20px 0 26px; padding:0 16px; }
.map-line { position:absolute; top:59px; left:50px; right:50px; border-top:1px dashed #a8bbd4; }
.map-node { position:relative; display:grid; place-items:center; width:55px; height:55px; border:1px solid #d8e1ee; border-radius:14px; background:#fff; color:#607591; }
.map-node svg { width:25px; height:25px; stroke:currentColor; stroke-width:1.4; }
.map-node small { position:absolute; bottom:-26px; font-size:10px; letter-spacing:.5px; }
.map-center { display:grid; place-items:center; position:relative; width:78px; height:78px; background:#eaf0fc; border:1px solid #d0ddf5; border-radius:21px; font:40px Georgia,serif; color:#3465bd; box-shadow:0 0 0 10px #eef2f9; }
.map-center>span { position:absolute; bottom:-32px; font:10px "Segoe UI",sans-serif; letter-spacing:.6px; color:#75849a; }
.workspace-features { display:flex; gap:33px; border-top:1px solid var(--line); padding-top:22px; }
.workspace-features>div { min-width:0; }
.workspace-features span { display:block; font:10px "Segoe UI",sans-serif; color:#8d9bae; margin-bottom:9px; }
.workspace-features strong { font-size:12px; font-weight:600; }
.workspace-features p { font-size:11px; color:var(--muted); line-height:1.7; margin:7px 0 0; }
/* The frame owns the available viewport space, not the form's natural height.
   Responsive rules reduce decoration first; JS only scales the card as a last
   resort for unusually short viewports, keyboard changes or expanded errors. */
.login-card-viewport { position:relative; width:100%; height:100%; min-width:0; min-height:0; overflow:clip; }
.login-card {
  position:absolute;
  top:50%;
  left:50%;
  width:calc(100% - 8px);
  max-width:450px;
  min-width:0;
  padding:clamp(20px,3.8dvh,35px) clamp(22px,3vw,36px) clamp(20px,3dvh,26px);
  border:1px solid #e2e7ef;
  border-radius:18px;
  background:#fff;
  box-shadow:0 12px 42px #263d6609;
  transform:translate(-50%,-50%) scale(var(--login-card-scale,1));
  transform-origin:center;
}
.card-icon { display:grid; place-items:center; width:42px; height:42px; background:#eff4ff; color:var(--blue); border-radius:12px; margin-bottom:clamp(12px,2.6dvh,24px); }
.card-icon svg { width:24px; height:24px; stroke:currentColor; stroke-width:1.5; }
.card-eyebrow { font-size:11px; letter-spacing:1px; color:var(--muted); }
h2 { font-size:25px; line-height:1.4; font-weight:650; letter-spacing:-.4px; margin:8px 0 10px; }
.login-description { font-size:12px; line-height:1.9; color:var(--muted); margin:0 0 clamp(12px,2.8dvh,26px); }
form label { display:block; margin:clamp(10px,2dvh,18px) 0 9px; font-size:12px; font-weight:600; }
input { display:block; width:100%; min-width:0; height:46px; padding:12px 14px; border:1px solid #d6dee8; border-radius:8px; background:#fcfdff; color:#182333; font-size:13px; transition:border-color .15s,box-shadow .15s; }
input::placeholder { color:#939faf; }
input:focus { border-color:#719df4; box-shadow:0 0 0 3px #2563eb0a; outline:none; }
.password-field { position:relative; }
.password-field input { padding-right:62px; }
.password-field button { position:absolute; right:4px; top:4px; height:38px; padding:0 12px; border:0; border-radius:6px; background:transparent; color:#66758a; font-size:11px; }
.password-field button:hover { color:var(--blue); background:#edf3ff; }
.password-hint { font-size:11px; line-height:1.8; color:var(--muted); margin:12px 0 0; overflow-wrap:anywhere; }
.submit-button { display:flex; align-items:center; justify-content:center; position:relative; gap:14px; width:100%; min-height:46px; border:1px solid #215bd6; border-radius:8px; background:var(--blue); color:#fff; font-size:13px; font-weight:600; margin-top:clamp(14px,2.8dvh,26px); transition:background .15s,transform .15s; }
.submit-button:hover:not(:disabled) { background:#1e54cc; }
.submit-button:active:not(:disabled) { transform:translateY(1px); }
.submit-arrow { position:absolute; right:17px; font-size:18px; font-weight:400; }
form[aria-busy="true"] .submit-arrow { width:14px; height:14px; font-size:0; border:2px solid #ffffff60; border-top-color:#fff; border-radius:50%; animation:spin 1s linear infinite; }
.session-note { display:flex; justify-content:center; gap:8px; margin:18px 0 0; color:#7b8798; font-size:11px; line-height:1.7; }
.session-note>span { font-size:17px; }
.session-note p { margin:0; }
.form-message { font-size:12px; line-height:1.8; padding:10px 12px; border:1px solid #d4e3f6; background:#f1f6ff; color:#285a9c; border-radius:7px; margin:0 0 12px; overflow-wrap:anywhere; }
.form-message[data-error="true"] { background:#fff5f3; border-color:#f1d9d4; color:#a64231; }
.login-footer { font-size:10px; color:#8b97a6; padding-top:clamp(8px,2dvh,20px); padding-bottom:clamp(12px,2.8dvh,26px); }
.footer-divider { margin:0 9px; color:#bec7d3; }
@keyframes spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; } }
@media(max-width:1050px) {
  .workspace-features { gap:20px; }
  .welcome-description br { display:none; }
}
@media(max-width:760px) {
  .login-header { padding:18px 24px; }
  .login-layout { grid-template-columns:minmax(0,1fr); gap:0; width:min(480px,100%); padding:8px 20px; }
  .welcome { display:none; }
  .login-card { padding:26px; }
  .card-icon { margin-bottom:18px; }
  .login-footer { padding:12px 24px 18px; font-size:9px; }
  .local-badge { font-size:10px; padding:7px 10px; }
  .brand { font-size:15px; }
  .brand small { font-size:10px; }
  .brand-icon { width:36px; height:36px; font-size:26px; }
  /* Avoid mobile browsers zooming the form on focus. */
  input { font-size:16px; }
}
@media(max-height:800px) {
  .card-icon { display:none; }
  .login-card { padding-top:22px; padding-bottom:22px; }
  .login-description { line-height:1.65; margin-bottom:12px; }
  form label { margin:12px 0 6px; }
  input { height:42px; padding:9px 12px; }
  .password-field button { height:34px; }
  .password-hint { margin-top:8px; line-height:1.65; }
  .submit-button { min-height:42px; margin-top:18px; }
  .session-note { margin-top:12px; line-height:1.5; }
  .workspace-map { height:112px; margin:14px 0 22px; }
  .map-line { top:44px; }
}
@media(max-height:650px) {
  .login-header { padding-top:10px; padding-bottom:10px; }
  .brand small,.card-eyebrow,.session-note,.login-footer,.workspace-map,.workspace-features { display:none; }
  .login-layout { padding-top:6px; padding-bottom:6px; }
  .login-card { padding-top:18px; padding-bottom:18px; }
  h2 { font-size:22px; line-height:1.3; margin:0 0 8px; }
  .login-description { font-size:11px; margin-bottom:8px; }
  form label { margin:8px 0 4px; font-size:11px; }
  input { height:38px; padding-top:8px; padding-bottom:8px; }
  .password-field button { height:30px; }
  .password-hint { font-size:10px; line-height:1.5; margin-top:6px; }
  .submit-button { min-height:38px; margin-top:12px; }
  .form-message { padding:6px 10px; font-size:11px; line-height:1.5; margin-bottom:8px; }
}
@media(max-height:480px) {
  .login-header { display:none; }
  .welcome { display:none; }
  .login-layout { grid-template-columns:minmax(0,1fr); width:min(480px,100%); gap:0; padding:8px 16px; }
  .login-card { padding:14px 20px; }
}
@media(max-width:360px) {
  .login-header { padding-left:16px; padding-right:16px; }
  .login-layout { padding-left:12px; padding-right:12px; }
  .login-card { padding-left:18px; padding-right:18px; }
  .local-badge { display:none; }
}
