:root {
  color-scheme: dark;
  --bg: #101516;
  --panel: #182021;
  --panel2: #1d2728;
  --line: #354243;
  --text: #eef0e8;
  --muted: #a4b2ad;
  --gold: #dfbb7f;
  --green: #50c18d;
  --error: #f08a86;
  --auth-input-bg: #283543;
  --auth-input-border: #4a5958;
}
* { box-sizing: border-box; }
body {
  min-height: 100vh; margin: 0; display: grid; place-items: center; padding: 34px;
  background: radial-gradient(ellipse at 22% 18%, #202b2b 0, transparent 38%), var(--bg);
  color: var(--text); font: 15px/1.6 system-ui, -apple-system, "Segoe UI", "Noto Sans", sans-serif;
}
.login-shell, .registration-shell {
  width: min(100%, 980px); min-height: 590px; display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: linear-gradient(135deg, #192223, #12191a); box-shadow: 0 24px 80px #0005;
}
.brand-panel {
  position: relative; isolation: isolate; overflow: hidden; padding: 58px 54px;
  display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(150deg, #202b2b, #161e1f); border-right: 1px solid var(--line);
}
.brand-panel > :not(.taiwan-watermark) { position: relative; z-index: 1; }
.taiwan-watermark {
  position: absolute; z-index: 0; top: 50%; right: 26px; width: min(58%, 300px); height: auto;
  transform: translateY(-50%); pointer-events: none;
}
.brand-mark {
  width: 50px; height: 50px; display: grid; place-items: center; border: 1px solid var(--gold);
  color: var(--gold); font-weight: 800; letter-spacing: .1em;
}
.eyebrow, .section-kicker, .edition, footer { font-size: 10px; letter-spacing: .17em; }
.eyebrow { margin: 38px 0 12px; color: var(--gold); }
h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.08; letter-spacing: -.04em; margin: 0; font-weight: 640; }
.brand-copy { max-width: 330px; margin: 20px 0 0; color: var(--muted); font-size: 15px; }
.brand-rule { height: 1px; background: var(--line); margin: 42px 0 14px; }
.edition { color: #85958d; }
.creator-credit { margin: 8px 0 0; color: #85958d; font-size: 9px; letter-spacing: .16em; }
.form-panel { padding: 65px 55px; display: flex; flex-direction: column; justify-content: center; }
.section-kicker { color: var(--gold); }
h2 { font-size: 26px; line-height: 1.25; margin: 12px 0 8px; letter-spacing: -.025em; }
.form-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.form-panel form { display: grid; gap: 16px; margin-top: 29px; }
.form-panel label { display: grid; gap: 7px; font-size: 12px; color: #c6d0ca; }
.form-panel input, .registration-main input {
  width: 100%; height: 48px; border: 1px solid var(--auth-input-border); border-radius: 6px;
  background: var(--auth-input-bg); color: var(--text); padding: 0 13px; font: inherit; outline: none; caret-color: var(--text);
}
.form-panel input:focus, .registration-main input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px #dfbb7f2a; }

/* Keep browser-filled credentials consistent with ordinary fields on both pages. */
:is(.form-panel,.registration-main) input:autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: inset 0 0 0 1000px var(--auth-input-bg);
}
:is(.form-panel,.registration-main) input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  -webkit-box-shadow: inset 0 0 0 1000px var(--auth-input-bg);
}
:is(.form-panel,.registration-main) input:autofill:focus {
  box-shadow: inset 0 0 0 1000px var(--auth-input-bg), 0 0 0 2px #dfbb7f2a;
}
:is(.form-panel,.registration-main) input:-webkit-autofill:focus {
  -webkit-box-shadow: inset 0 0 0 1000px var(--auth-input-bg), 0 0 0 2px #dfbb7f2a;
}

.primary {
  height: 48px; margin-top: 5px; border: 1px solid var(--gold); border-radius: 6px;
  background: var(--gold); color: #182021; font: 650 14px system-ui; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.primary:hover { background: #edca91; }
.secondary {
  width: 100%; min-height: 42px; margin-top: 10px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel2);
  color: var(--text); font: 600 12px system-ui; cursor: pointer;
}
.secondary:hover { border-color: var(--gold); color: var(--gold); }
.secondary:disabled { opacity: .6; cursor: wait; }
.primary span { font-size: 19px; }
.status { min-height: 25px; margin: 14px 0 0; color: var(--error); font-size: 12px; }
.status.success { color: var(--green); }
.password-note { margin: -7px 0 0; font-size: 11px; color: var(--muted); }
.file-help { margin-top: 24px; padding: 15px; border: 1px solid #82693f; border-radius: 7px; background: #26261f; color: var(--text); }
.file-help strong { color: var(--gold); font-size: 13px; }
.file-help p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.file-help code { color: var(--gold); font: inherit; }
.security-note { display: flex; align-items: center; gap: 9px; margin: 23px 0 0; color: var(--muted); font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 100%; background: var(--green); box-shadow: 0 0 10px #50c18d88; }
footer { position: fixed; bottom: 17px; color: #75837e; text-align: center; }
footer span { color: var(--gold); padding: 0 5px; }
[hidden] { display: none !important; }
.auth-link{color:var(--gold);font-size:12px;text-decoration:none}
.auth-link:hover{text-decoration:underline}
.forgot-link{justify-self:end;margin-top:-8px}
.recovery-language{display:flex;justify-content:flex-end;gap:6px;margin-bottom:24px}
.recovery-language button{border:1px solid transparent;background:transparent;color:var(--muted);padding:6px 10px;border-radius:6px;cursor:pointer;font:inherit;font-size:12px}
.recovery-language button[aria-pressed="true"]{color:var(--gold);border-color:#76613f;background:#dfbb7f12}
.recovery-panel .auth-link{display:inline-block;margin-top:18px}
.auth-link:focus-visible,.recovery-language button:focus-visible{outline:2px solid var(--gold);outline-offset:4px}
@media (max-width: 720px) {
  body { padding: 20px 14px 46px; }
  .login-shell { max-width: 480px; min-height: 0; grid-template-columns: 1fr; }
  .brand-panel { padding: 29px 28px 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand-mark { width: 40px; height: 40px; }
  .eyebrow { margin: 20px 0 8px; }
  .brand-panel h1 { font-size: 34px; }
  .brand-copy { font-size: 13px; margin-top: 12px; }
  .brand-rule { margin: 20px 0 10px; }
  .taiwan-watermark { top: 48%; right: 16px; width: min(52%, 230px); }
  .form-panel { padding: 30px 28px 36px; }
}

/* Keep sign-in notices below all form actions, including session-limit recovery. */
body.login-page{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px}
.login-page .login-shell{flex:0 0 auto}
.login-page>footer{position:static;inset:auto;flex:none;width:100%;margin:0;line-height:1.8;overflow-wrap:anywhere}
