:root {
  --primary-color: #1e40af;
  --primary-hover: #1d4ed8;
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --border-color: #cbd5e1;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: var(--font-family); color: var(--text-main); background: var(--bg-app); }
button, input { font: inherit; }
button { cursor: pointer; min-height: 44px; }
button:disabled { cursor: wait; opacity: .7; }
:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }
.auth-layout { min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(340px, .95fr) minmax(420px, 1.05fr); }
.auth-brand { padding: 48px clamp(32px, 5vw, 88px) 32px; background: radial-gradient(ellipse at 80% 15%, #254d94 0, transparent 54%), repeating-linear-gradient(90deg, transparent 0 79px, #ffffff06 80px), #102b53; color: #fff; position: relative; display: flex; flex-direction: column; overflow: hidden; }
.brand-lockup { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; letter-spacing: 1px; }
.brand-lockup small { font-size: 11px; color: #bfdbfe; letter-spacing: 2px; margin-left: 8px; }
.brand-mark { width: 38px; height: 38px; border: 1px solid #ffffff70; border-radius: 9px; display: grid; place-items: center; }
.brand-intro { padding-top: clamp(50px, 10vh, 120px); }
.brand-eyebrow { color: #bfdbfe; font-size: 13px; letter-spacing: 2px; margin: 0 0 20px; }
.brand-intro h1 { font-size: clamp(34px, 3.7vw, 56px); line-height: 1.3; font-weight: 600; letter-spacing: 2px; margin: 0 0 24px; }
.brand-description { color: #d5e2f5; font-size: 15px; line-height: 1.9; max-width: 310px; margin: 0; }
.brand-document { border: 1px solid #ffffff38; border-radius: 12px; margin-top: 42px; max-width: 330px; padding: 24px; background: linear-gradient(130deg, #ffffff14, #ffffff03); transform: rotate(-3deg); }
.document-topline { height: 3px; width: 36px; background: #93c5fd; margin-bottom: 20px; }
.brand-document > span { font-size: 13px; color: #dbeafe; }
.document-lines { display: grid; gap: 9px; margin: 20px 0 24px; }
.document-lines i { display: block; height: 4px; background: #ffffff20; border-radius: 8px; }
.document-lines i:nth-child(2) { width: 80%; }
.document-lines i:nth-child(4) { width: 62%; }
.document-foot { color: #c7daf5; font-size: 12px; letter-spacing: 2px; }
.document-foot b { margin: 0 12px; font-weight: 400; color: #88a8d2; }
.brand-footer { font-size: 11px; color: #a9bedb; margin: auto 0 0; padding-top: 40px; line-height: 1.8; }
.auth-panel { padding: 48px 48px 24px; display: flex; flex-direction: column; justify-content: center; align-items: center; background: radial-gradient(ellipse at top right, #eaf0fb, transparent 62%), var(--bg-app); }
.auth-card { width: 100%; max-width: 388px; margin: auto 0; padding: 24px 0; }
.panel-eyebrow { color: var(--primary-color); letter-spacing: 2px; font-size: 12px; font-weight: 600; margin: 0 0 14px; }
.auth-card h2 { margin: 0 0 10px; font-size: 28px; letter-spacing: 1px; }
.panel-description { margin: 0 0 26px; color: var(--text-muted); line-height: 1.8; font-size: 14px; }
.auth-mode { display: flex; padding: 4px; background: #e8eef6; border-radius: 8px; margin-bottom: 26px; gap: 4px; }
.auth-mode button { width: 50%; border: 0; background: transparent; border-radius: 6px; color: #475569; font-size: 14px; }
.auth-mode button[aria-pressed="true"] { background: var(--bg-card); color: var(--primary-color); font-weight: 600; box-shadow: 0 1px 4px #0f172a14; }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 9px; }
.field input { display: block; border: 1px solid var(--border-color); border-radius: 7px; width: 100%; min-width: 0; min-height: 48px; padding: 11px 12px; background: #fff; color: var(--text-main); font-size: 16px; }
.field small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 8px; line-height: 1.6; }
.password-field { display: flex; align-items: center; border: 1px solid var(--border-color); border-radius: 7px; background: #fff; }
.password-field input { border: 0; }
.password-field button { border: 0; background: transparent; color: var(--primary-color); padding: 0 14px; flex-shrink: 0; font-size: 13px; }
.auth-submit { border: 0; width: 100%; min-height: 48px; border-radius: 7px; background: var(--primary-color); color: white; font-size: 14px; font-weight: 600; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.auth-submit:hover:not(:disabled) { background: var(--primary-hover); }
.auth-message { padding: 12px 14px; border-radius: 7px; border: 1px solid #f2c0b8; background: #fff1f0; color: #991b1b; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; margin: 0 0 16px; }
.auth-message[data-tone="info"] { color: #1e40af; background: #eff6ff; border-color: #bfdbfe; }
.session-retry { border: 1px solid var(--border-color); color: var(--primary-color); background: #fff; border-radius: 6px; padding: 8px 14px; width: 100%; margin-bottom: 20px; }
.account-note { color: var(--text-muted); font-size: 12px; line-height: 1.8; margin: 22px 0 0; }
.panel-footer { color: var(--text-muted); font-size: 11px; margin-top: 28px; text-align: center; line-height: 1.8; }
@media (max-width: 760px) {
  .auth-layout { display: block; }
  .auth-brand { padding: 24px 28px; }
  .brand-lockup { font-size: 17px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-intro { padding-top: 24px; }
  .brand-eyebrow { font-size: 11px; margin-bottom: 10px; }
  .brand-intro h1 { font-size: 27px; letter-spacing: 1px; margin-bottom: 0; }
  .brand-intro h1 br { display: none; }
  .brand-description, .brand-document, .brand-footer { display: none; }
  .auth-panel { padding: 24px 28px; }
  .auth-card { padding: 0; }
  .panel-eyebrow { display: none; }
  .auth-card h2 { font-size: 24px; }
  .panel-description { margin-bottom: 18px; }
  .auth-mode { margin-bottom: 20px; }
}
@media (max-height: 650px) and (min-width: 761px) {
  .auth-brand, .auth-panel { padding-top: 28px; }
  .brand-intro { padding-top: 36px; }
  .brand-document { margin-top: 26px; padding: 18px; }
}
@media (max-height: 600px) and (max-width: 760px) {
  .auth-brand { padding: 16px 24px; }
  .brand-intro { display: none; }
  .auth-panel { padding: 20px 24px; }
  .panel-description { margin-bottom: 14px; }
  .field { margin-bottom: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .auth-card { animation: arrive .25s ease-out; }
  @keyframes arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
}
/* Account requests and the administrator entry share the existing login surface. */
.brand-lockup [data-site-name] { display: inline-block; max-width: min(300px, 60vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.auth-entry-nav { margin-top: 20px; font-size: 13px; }
.auth-entry-nav a { display: inline-flex; align-items: center; min-height: 44px; color: #1e40af; text-underline-offset: 4px; }
.auth-message[data-tone="success"] { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
