:root {
  --bg: #061014;
  --body-bg:
    radial-gradient(920px 560px at 4% -10%, rgba(58, 224, 180, .16), transparent 64%),
    radial-gradient(820px 500px at 100% 4%, rgba(73, 158, 255, .14), transparent 62%),
    linear-gradient(145deg, #050d11 0%, #08161b 48%, #061014 100%);
  --panel: linear-gradient(160deg, rgba(17, 38, 45, .94), rgba(7, 20, 24, .92));
  --field: rgba(4, 14, 18, .7);
  --field-strong: rgba(5, 18, 22, .92);
  --line: rgba(137, 202, 209, .14);
  --line-strong: rgba(110, 235, 198, .34);
  --text: #e9f7f4;
  --muted: #8ca8a9;
  --dim: #5c777a;
  --mint: #63f5c5;
  --mint-2: #2fd6a5;
  --cyan: #57c8ff;
  --red: #ff7e88;
  --shadow: 0 30px 90px rgba(0, 0, 0, .46);
  --grid: rgba(110, 210, 205, .06);
  --radius: 22px;
}

html[data-theme="light"] {
  --bg: #f2f7f3;
  --body-bg:
    radial-gradient(920px 560px at 4% -10%, rgba(43, 191, 145, .18), transparent 64%),
    radial-gradient(820px 500px at 100% 4%, rgba(82, 151, 238, .14), transparent 62%),
    linear-gradient(145deg, #f8fcf9 0%, #eef6f1 48%, #f4f8f5 100%);
  --panel: linear-gradient(160deg, rgba(255, 255, 255, .95), rgba(247, 252, 249, .94));
  --field: rgba(255, 255, 255, .78);
  --field-strong: #ffffff;
  --line: rgba(24, 73, 63, .14);
  --line-strong: rgba(13, 156, 117, .34);
  --text: #10221e;
  --muted: #5f746f;
  --dim: #80938e;
  --mint: #0d9c75;
  --mint-2: #0a8060;
  --cyan: #1b7fc0;
  --red: #c73c4b;
  --shadow: 0 30px 80px rgba(35, 78, 63, .14);
  --grid: rgba(30, 130, 100, .07);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--body-bg);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .2;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}
a { color: inherit; }
button, input { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.glow { position: fixed; width: 440px; height: 440px; border-radius: 50%; pointer-events: none; filter: blur(120px); opacity: .16; }
.glow-a { left: -220px; top: 42%; background: #33e2ae; }
.glow-b { right: -180px; top: 8%; background: #3a8ee8; }

.auth-top {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; }
.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #04231c;
  font-weight: 900;
  letter-spacing: -.04em;
  background: linear-gradient(135deg, #9affdf, #31cfa2 62%, #23a982);
  box-shadow: 0 0 0 1px rgba(135, 255, 216, .38), 0 14px 40px rgba(37, 213, 165, .22);
}
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 20px; letter-spacing: -.035em; }
.brand-copy small { color: var(--dim); font-size: 9px; letter-spacing: .14em; }
.auth-top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.ghost-btn {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(7, 20, 24, .44);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: .18s;
}
html[data-theme="light"] .ghost-btn { background: rgba(255, 255, 255, .7); }
.ghost-btn:hover { color: var(--text); border-color: var(--line-strong); }
.ghost-btn.danger { color: var(--red); }
.theme-toggle { min-width: 82px; }

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  min-height: calc(100vh - 92px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 72px;
  align-items: center;
  padding: 28px 0 46px;
}
.intro { min-width: 0; }
.intro-copy { margin-top: 0; }
.eyebrow { display: block; color: var(--mint); font-size: 9px; font-weight: 800; letter-spacing: .2em; }
.role-badge { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 18px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(7, 20, 24, .42); font-size: 10px; letter-spacing: .08em; }
html[data-theme="light"] .role-badge { background: rgba(255, 255, 255, .7); }
.role-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.intro-copy h1 {
  margin: 14px 0 20px;
  font-size: clamp(34px, 4.4vw, 58px);
  line-height: 1.1;
  letter-spacing: -.055em;
  font-weight: 800;
}
.intro-copy h1 em { color: var(--mint); font-style: normal; }
.intro-copy p { max-width: 540px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.85; }
.feature-list { display: grid; gap: 11px; margin-top: 38px; max-width: 540px; }
.feature-list > div { display: grid; grid-template-columns: 38px 1fr; gap: 4px 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(7, 20, 24, .36); }
html[data-theme="light"] .feature-list > div { background: rgba(255, 255, 255, .62); }
.feature-list span { grid-row: 1 / 3; color: var(--mint); font-size: 10px; font-weight: 800; letter-spacing: .08em; padding-top: 3px; }
.feature-list b { font-size: 12px; font-weight: 650; }
.feature-list i { color: var(--dim); font-size: 10px; font-style: normal; line-height: 1.5; }
.signal { display: flex; align-items: center; gap: 9px; margin-top: 34px; color: var(--dim); font-size: 9px; letter-spacing: .16em; }
.signal i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 13px var(--mint); }

.login-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.status-dot { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.status-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 13px var(--mint); }
.login-card h2 { margin: 20px 0 7px; font-size: 26px; letter-spacing: -.04em; }
.card-sub { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 22px 0 20px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(4, 13, 17, .46); }
html[data-theme="light"] .mode-tabs { background: rgba(240, 247, 243, .9); }
.mode-tab { min-height: 40px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; transition: .2s ease; }
.mode-tab:hover { color: var(--text); }
.mode-tab.active { color: #04231c; font-weight: 750; background: linear-gradient(135deg, #8affda, #31cfa2); box-shadow: 0 8px 24px rgba(49, 207, 162, .2); }

.field { display: grid; gap: 8px; margin-bottom: 14px; }
.field > span, .captcha-head span { color: var(--muted); font-size: 10px; letter-spacing: .05em; }
.input-wrap { position: relative; }
.input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--dim);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.input-wrap input, .captcha-row > input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  color: var(--text);
  background: var(--field);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input-wrap input { padding: 0 14px 0 42px; }
.input-wrap input:focus, .captcha-row > input:focus { border-color: rgba(99, 245, 197, .55); background: var(--field-strong); box-shadow: 0 0 0 3px rgba(99, 245, 197, .08); }
input::placeholder { color: var(--dim); opacity: .78; }
.captcha-block { margin: 3px 0 10px; }
.captcha-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.captcha-head button { border: 0; padding: 0; color: var(--mint); background: transparent; cursor: pointer; font-size: 10px; }
.captcha-row { display: grid; grid-template-columns: 142px minmax(0, 1fr); gap: 10px; }
.captcha-image { position: relative; height: 46px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #e8f0ed; cursor: pointer; }
.captcha-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.captcha-image span { position: absolute; inset: 0; display: grid; place-items: center; color: #48605f; font-size: 10px; background: rgba(232, 240, 237, .92); }
.captcha-image.loaded span { display: none; }
.captcha-row > input { padding: 0 13px; letter-spacing: .06em; }
.form-message { min-height: 18px; margin: 3px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.form-message.error { color: var(--red); }
.form-message.ok { color: var(--mint); }
.submit-btn {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 13px;
  color: #04231c;
  background: linear-gradient(135deg, #9affdf, #31cfa2 64%, #22b48a);
  box-shadow: 0 16px 38px rgba(37, 213, 165, .2);
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  transition: transform .2s, filter .2s;
}
.submit-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.03); }
.submit-btn:disabled { opacity: .48; cursor: not-allowed; }
.submit-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card-foot { display: flex; justify-content: space-between; gap: 14px; margin-top: 18px; color: var(--dim); font-size: 10px; line-height: 1.6; }
.card-foot a, .link-btn { color: var(--mint); text-decoration: none; border: 0; padding: 0; background: transparent; cursor: pointer; font-size: inherit; }
.register-note { margin: 5px 0 4px; color: var(--dim); font-size: 10px; line-height: 1.65; }
.admin-auth .login-card { border-color: rgba(255, 196, 107, .2); }
.admin-auth .role-badge i { background: #ffc46b; box-shadow: 0 0 10px rgba(255, 196, 107, .8); }
.admin-auth .eyebrow, .admin-auth .card-foot a, .admin-auth .link-btn { color: #ffc46b; }
.admin-auth .submit-btn { background: linear-gradient(135deg, #ffe0a6, #ffc46b 65%, #e9a53f); box-shadow: 0 16px 38px rgba(255, 196, 107, .18); }
.admin-auth .mode-tabs { display: none; }
.admin-auth .feature-list span { color: #ffc46b; }

@media (max-width: 940px) {
  .auth-shell { grid-template-columns: 1fr; gap: 30px; padding-top: 18px; }
  .intro { max-width: 640px; }
  .intro-copy h1 { font-size: clamp(32px, 8vw, 50px); }
  .login-card { width: min(460px, 100%); }
}
@media (max-width: 620px) {
  .auth-top, .auth-shell { width: calc(100% - 28px); }
  .auth-top { padding-top: 14px; }
  .auth-top-actions .ghost-btn:not(.theme-toggle) { display: none; }
  .login-card { padding: 22px; }
  .captcha-row { grid-template-columns: 1fr; }
  .captcha-image { width: 100%; }
  .card-foot { flex-direction: column; }
  .feature-list { margin-top: 24px; }
}