:root {
  --cream: #f6f6ec;
  --cream-deep: #eeefe2;
  --paper: #fffef9;
  --ink: #18201c;
  --ink-soft: #35413b;
  --muted: #6a766f;
  --faint: #98a29b;
  --line: #e2e4d7;
  --line-strong: #d5d8c8;
  --mint: #0f9b8e;
  --mint-deep: #087b71;
  --mint-soft: #dff5ee;
  --danger: #cf4b5c;
  --font: "Inter", "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --shadow-card: 0 28px 70px -28px rgba(31, 46, 39, 0.28), 0 4px 18px rgba(31, 46, 39, 0.05);
  --ease: cubic-bezier(0.2, 0.75, 0.25, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
img, svg { display: block; }
[hidden] { display: none !important; }
::selection { background: rgba(15, 155, 142, 0.18); }

.login-page { position: relative; overflow-x: hidden; }

/* Decorative scene */
.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 50% -12%, rgba(255, 255, 255, 0.9), transparent 68%),
    linear-gradient(180deg, #f8f8ef 0%, var(--cream) 58%, #f1f2e5 100%);
}
.scene-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(35, 52, 44, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 52, 44, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 78% 72% at 50% 45%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 78% 72% at 50% 45%, #000 20%, transparent 78%);
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.65;
  animation: orbFloat 20s ease-in-out infinite alternate;
}
.orb-a { width: 460px; height: 460px; left: -150px; top: 8%; background: radial-gradient(circle at 40% 40%, #b9efdd, rgba(185, 239, 221, 0)); }
.orb-b { width: 520px; height: 520px; right: -170px; top: 2%; background: radial-gradient(circle at 55% 45%, #d4e2ff, rgba(212, 226, 255, 0)); animation-delay: -7s; }
.orb-c { width: 440px; height: 440px; right: 14%; bottom: -220px; background: radial-gradient(circle at 50% 50%, #fbe3bd, rgba(251, 227, 189, 0)); animation-delay: -12s; }
.orb-d { width: 360px; height: 360px; left: 12%; bottom: -180px; background: radial-gradient(circle at 50% 50%, #e6d9ff, rgba(230, 217, 255, 0)); animation-delay: -3s; }

.scene-ring {
  position: absolute;
  border: 1px solid rgba(24, 32, 28, 0.08);
  border-radius: 50%;
}
.ring-a { width: 620px; height: 620px; left: -240px; bottom: -170px; border-style: dashed; animation: slowSpin 90s linear infinite; }
.ring-b { width: 380px; height: 380px; right: -80px; top: 15%; border-color: rgba(15, 155, 142, 0.13); }
.ring-b::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  top: 34px;
  left: 78px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 6px rgba(15, 155, 142, 0.1);
}
.scene-spark {
  position: absolute;
  width: 22px;
  height: 22px;
  color: rgba(24, 32, 28, 0.22);
  animation: twinkle 4.5s ease-in-out infinite;
}
.spark-a { left: 12%; top: 20%; }
.spark-b { right: 18%; top: 63%; width: 14px; height: 14px; color: rgba(15, 155, 142, 0.34); animation-delay: -2s; }
.spark-c { left: 22%; top: 72%; width: 12px; height: 12px; color: rgba(24, 32, 28, 0.16); animation-delay: -1.2s; }

/* Floating UI cards */
.float-card {
  position: absolute;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  background: rgba(255, 255, 250, 0.66);
  box-shadow: 0 18px 44px -22px rgba(31, 46, 39, 0.24);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  animation: cardFloat 9s ease-in-out infinite;
}
.float-group {
  left: max(28px, calc(50% - 540px));
  top: 32%;
  width: 218px;
  transform: rotate(-4deg);
}
.float-group .fc-head { display: flex; align-items: center; gap: 9px; }
.float-group .fc-head img { width: 20px; height: 20px; }
.float-group .fc-head b { font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em; }
.float-group .fc-head span { margin-left: auto; font-size: 10px; color: var(--faint); font-family: var(--mono); }
.float-group .fc-main { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; }
.float-group .fc-main b { font-size: 28px; font-weight: 600; letter-spacing: -0.05em; }
.float-group .fc-main small { font-size: 10px; color: var(--muted); }
.float-track { height: 5px; border-radius: 99px; background: #e8ebdf; margin-top: 10px; overflow: hidden; }
.float-track i { display: block; width: 64%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7fe0c9, #63b3ff); }
.float-group .fc-foot { margin-top: 7px; font-size: 9.5px; color: var(--faint); letter-spacing: 0.02em; }

.float-status {
  right: max(24px, calc(50% - 552px));
  top: 25%;
  width: 198px;
  transform: rotate(3deg);
  animation-delay: -3.4s;
}
.float-status .fc-row { display: flex; align-items: center; gap: 9px; }
.float-status .pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #1bbf89; }
.float-status .pulse::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid rgba(27, 191, 137, 0.35); animation: pulse 2.2s ease-out infinite; }
.float-status b { font-size: 12px; font-weight: 600; }
.float-status .fc-sub { margin-top: 10px; font-size: 10px; color: var(--muted); }
.float-status .fc-bars { display: flex; align-items: flex-end; gap: 3px; height: 26px; margin-top: 10px; }
.float-status .fc-bars i { flex: 1; border-radius: 2px; background: rgba(15, 155, 142, 0.24); }
.float-status .fc-bars i:nth-child(5) { background: rgba(15, 155, 142, 0.68); }

.float-code {
  right: max(30px, calc(50% - 525px));
  bottom: 14%;
  width: 260px;
  padding: 13px 15px;
  transform: rotate(-2.5deg);
  animation-delay: -6s;
  font-family: var(--mono);
}
.float-code .fc-dots { display: flex; gap: 4px; margin-bottom: 9px; }
.float-code .fc-dots i { width: 6px; height: 6px; border-radius: 50%; background: #dfe2d4; }
.float-code .fc-dots i:first-child { background: #f3bc9d; }
.float-code p { font-size: 9.5px; line-height: 1.8; color: #6d786f; white-space: nowrap; }
.float-code p b { color: var(--mint-deep); font-weight: 600; }
.float-code p em { font-style: normal; color: #a87424; }

/* Page layout */
.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(20px, 4vw, 48px);
}
.login-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 0 18px;
}
.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-lockup img { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 7px 16px -7px rgba(21, 37, 34, 0.5); }
.brand-lockup .brand-word { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.brand-lockup .brand-word span { color: var(--mint-deep); font-weight: 500; }
.admin-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11.5px;
  background: rgba(255, 255, 250, 0.4);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.admin-link:hover { color: var(--ink); border-color: var(--line-strong); background: rgba(255, 255, 250, 0.9); }
.admin-link svg { width: 12px; height: 12px; }

.login-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vh, 34px) 0 clamp(26px, 5vh, 52px);
}
.login-intro { max-width: 640px; text-align: center; padding-bottom: clamp(22px, 4vh, 38px); }
.gemini-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 13px 0 10px;
  margin-bottom: 18px;
  border: 1px solid rgba(24, 32, 28, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 250, 0.55);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
}
.gemini-pill img { width: 16px; height: 16px; }
.login-intro h1 {
  font-size: clamp(34px, 4.6vw, 52px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.045em;
  color: var(--ink);
}
.grad-text {
  background: linear-gradient(96deg, #1c8d80 6%, #5477d8 48%, #b05fbd 84%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-intro > p {
  max-width: 470px;
  margin: 15px auto 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.8;
}

/* Login card */
.login-card {
  position: relative;
  width: min(440px, 100%);
  padding: 34px 34px 26px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 252, 0.98), rgba(253, 253, 246, 0.97));
  box-shadow: var(--shadow-card);
  animation: cardIn 0.65s var(--ease) both;
  backdrop-filter: blur(20px);
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 34px;
  right: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(15, 155, 142, 0.4), transparent);
}
.card-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.card-eyebrow i { width: 5px; height: 5px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(15, 155, 142, 0.12); }
.login-card h2 { font-size: 25px; font-weight: 600; letter-spacing: -0.035em; }
.card-sub { margin-top: 7px; font-size: 12.5px; color: var(--muted); }

.login-form { margin-top: 26px; }
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
}
.field-label span { color: var(--faint); font-size: 10px; font-weight: 400; }
.key-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 10px 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8f8f0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.key-box:focus-within {
  border-color: rgba(15, 155, 142, 0.62);
  background: #fffef9;
  box-shadow: 0 0 0 4px rgba(15, 155, 142, 0.1);
}
.key-box.is-error { border-color: rgba(207, 75, 92, 0.65); box-shadow: 0 0 0 4px rgba(207, 75, 92, 0.08); animation: shake 0.34s ease; }
.key-box > svg { width: 17px; height: 17px; flex: none; color: var(--faint); }
.key-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: 0.045em;
}
.key-box input::placeholder { color: #aab2a9; letter-spacing: 0.08em; }
.key-box input[type="password"] { letter-spacing: 0.12em; }
.reveal-btn {
  flex: none;
  height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--faint);
  font-size: 11px;
  transition: color 0.16s ease, background 0.16s ease;
}
.reveal-btn:hover { color: var(--ink); background: rgba(24, 32, 28, 0.05); }

.login-error {
  min-height: 20px;
  margin-top: 7px;
  padding-left: 2px;
  color: var(--danger);
  font-size: 11.5px;
  line-height: 1.6;
}
.login-error.is-info { color: var(--muted); }

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 3px 0 19px;
}
.remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  user-select: none;
}
.remember input { position: absolute; opacity: 0; pointer-events: none; }
.remember .box {
  position: relative;
  width: 16px;
  height: 16px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fffef9;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.remember .box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(42deg) scale(0);
  transition: transform 0.16s var(--ease);
}
.remember input:checked + .box { background: var(--mint); border-color: var(--mint); }
.remember input:checked + .box::after { transform: rotate(42deg) scale(1); }
.remember input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(15, 155, 142, 0.16); }
.case-hint { color: var(--faint); font-size: 10px; }

.submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 13px;
  background: var(--ink);
  color: #fffef8;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 24px -12px rgba(24, 32, 28, 0.65);
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.submit-btn svg { width: 16px; height: 16px; transition: transform 0.18s var(--ease); }
.submit-btn:hover { background: #25312b; box-shadow: 0 16px 30px -14px rgba(24, 32, 28, 0.7); transform: translateY(-1px); }
.submit-btn:hover svg { transform: translateX(3px); }
.submit-btn:active { transform: translateY(0); }
.submit-btn[disabled] { opacity: 0.7; cursor: wait; transform: none; }
.spinner {
  width: 16px;
  height: 16px;
  border: 1.7px solid rgba(255, 255, 255, 0.32);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.card-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.card-divider::before, .card-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  color: var(--faint);
  font-size: 9.5px;
}
.card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.card-meta svg { width: 11px; height: 11px; color: #8ba39a; }

.login-footnote {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  color: var(--faint);
  font-size: 10.5px;
}
.login-footnote .status-dot { width: 6px; height: 6px; border-radius: 50%; background: #1bbf89; box-shadow: 0 0 0 3px rgba(27, 191, 137, 0.12); }
.login-footnote code { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.login-footnote .sep { width: 1px; height: 10px; background: var(--line-strong); }

.login-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 18px 0 22px;
  color: #9aa49c;
  font-size: 10.5px;
}
.login-footer a:hover { color: var(--ink); }
.login-footer .fdot { color: #c4c9bd; }

@keyframes orbFloat {
  from { transform: translate3d(0, -14px, 0) scale(1); }
  to { transform: translate3d(18px, 24px, 0) scale(1.08); }
}
@keyframes cardFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}
@keyframes slowSpin { to { transform: rotate(360deg); } }
@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8) rotate(0deg); }
  50% { opacity: 0.9; transform: scale(1.1) rotate(18deg); }
}
@keyframes pulse {
  0% { opacity: 0.7; transform: scale(0.6); }
  100% { opacity: 0; transform: scale(1.5); }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .float-card { display: none; }
}
@media (max-width: 720px) {
  .login-shell { padding: 0 16px; }
  .login-topbar { padding-top: 18px; }
  .login-stage { justify-content: flex-start; padding-top: 26px; }
  .login-intro { padding-bottom: 24px; }
  .login-intro h1 { font-size: clamp(30px, 9vw, 38px); }
  .login-intro > p { font-size: 12.5px; max-width: 340px; }
  .gemini-pill { margin-bottom: 13px; }
  .login-card { padding: 28px 22px 22px; border-radius: 20px; }
  .login-card::before { left: 22px; right: 22px; }
  .login-card h2 { font-size: 22px; }
  .login-footnote { flex-wrap: wrap; justify-content: center; }
  .login-footer { padding-bottom: 18px; }
  .orb-a { opacity: 0.45; }
  .orb-b { opacity: 0.5; }
}
@media (max-height: 760px) and (min-width: 721px) {
  .login-intro { padding-bottom: 20px; }
  .login-intro h1 { font-size: 36px; }
  .login-intro > p { display: none; }
  .login-card { padding-top: 28px; padding-bottom: 22px; }
  .login-footnote { margin-top: 14px; }
  .login-topbar { padding-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
