:root {
  --ink: #242c33;
  --paper: #edf0f3;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --display: var(--sans);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #3c6894; outline-offset: 3px; }
::selection { background: #c5dbed; color: #192c40; }
input, textarea { caret-color: #477294; }
body { scrollbar-width: thin; scrollbar-color: #9eabb5 #e9edf0; }

#public-home {
  height: 100dvh;
  min-height: 500px;
  position: relative;
  overflow: hidden;
  background: #050a11;
  color: #eef3f6;
  isolation: isolate;
}
.earth-cover {
  position: absolute;
  inset: 0;
  background: #050a11 url("/approved/earth-sunrise.png") center / cover no-repeat;
  z-index: -2;
  animation: earth-breathe 12s ease-in-out infinite alternate;
  transform: scale(1.001);
  transform-origin: 58% 52%;
  will-change: transform, filter;
}
#public-home[data-motion=paused] .earth-cover,
body:has(#login-dialog[open]) .earth-cover { animation-play-state: paused; }
#public-home::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 58%, #02070d80 100%);
}
#public-home .login-trigger {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 9.5%;
  translate: -50% 0;
  width: 146px;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid #ffffffd9;
  border-radius: 999px;
  background: #edf1f5;
  color: #17202a;
  box-shadow: 0 12px 36px #0007;
  font-size: 16px;
  font-weight: 500;
  transition: background .18s ease, transform .18s ease;
}
#public-home .login-trigger:hover { background: #fff; transform: translateY(-2px); }
#public-home button:focus-visible, #public-home a:focus-visible { outline-color: #fff; outline-offset: 5px; }
.cover-footer {
  position: absolute;
  z-index: 2;
  left: 24px;
  right: 24px;
  bottom: 13px;
  display: flex;
  justify-content: center;
  font-size: 11px;
}
.cover-footer a { color: #c4ccd3; text-decoration: none; min-height: 28px; display: inline-flex; align-items: center; text-underline-offset: 4px; }
.cover-footer a:hover { text-decoration: underline; color: #fff; }

dialog { color: var(--ink); background: #fff; border: 1px solid #c9d1d8; padding: 0; max-height: calc(100dvh - 32px); overflow: auto; }
dialog::backdrop { background: #080d1466; }
#login-dialog {
  width: min(600px, calc(100vw - 64px));
  min-height: min(690px, calc(100dvh - 100px));
  margin: auto 4.5vw auto auto;
  border: 1px solid #d9e1e866;
  border-radius: 24px;
  color: #f0f3f6;
  background: linear-gradient(145deg, #252b34e8, #1b2430e6);
  box-shadow: inset 0 1px 0 #ffffff12, 0 28px 80px #0009;
  backdrop-filter: blur(18px);
}
#login-dialog::backdrop {
  background: #03070d1a url("/approved/earth-sunrise.png") center / cover no-repeat;
}
#login-dialog[open] { animation: login-arrive .24s cubic-bezier(.16, 1, .3, 1); }
#login-dialog form { padding: 44px 42px 40px; display: grid; gap: 24px; }
.login-brand { display: grid; line-height: 1.15; margin-bottom: 2px; }
.login-brand strong { font-size: 20px; font-weight: 500; letter-spacing: .02em; }
.login-brand span { color: #aeb9c5; font-size: 13px; }
.login-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 2px 0 4px; }
#login-dialog h1 { font-size: 30px; font-weight: 400; letter-spacing: -.02em; line-height: 1.25; margin: 0; }
#login-dialog .login-heading p { margin: 2px 0 0; color: #b5bec8; font-size: 15px; }
#login-dialog .dialog-close { flex: none; width: 44px; height: 44px; margin: -10px -10px 0 0; border: 0; border-radius: 9px; color: #c8d0d7; background: transparent; padding: 11px; }
#login-dialog .dialog-close:hover { background: #ffffff12; color: #fff; }
.dialog-close svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; }
#login-dialog label { display: grid; gap: 8px; color: #c8d0d7; font-size: 14px; }
#login-dialog input { height: 52px; min-width: 0; width: 100%; border: 1px solid #697684; border-radius: 12px; padding: 0 15px; background: #101720a3; color: #f1f4f7; font-size: 16px; caret-color: #d3e2ed; }
#login-dialog input::placeholder { color: #818c98; }
.login-help { margin: -4px 0 -8px; color: #abc5df; font-size: 14px; }
#login-dialog .login-submit { height: 54px; border: 1px solid #fff; border-radius: 14px; background: #edf1f5; color: #17202a; font-size: 17px; font-weight: 500; }
#login-dialog .login-submit:hover { background: #fff; }
#login-dialog [role=alert] { color: #ffd1cd; background: #8b3c3936; border-radius: 8px; padding: 10px 12px; margin: 0; font-size: 14px; overflow-wrap: anywhere; }
#login-dialog :focus-visible { outline-color: #d8e9f4; }
#toast { position: fixed; z-index: 300; bottom: 24px; right: 24px; max-width: min(400px, calc(100vw - 32px)); padding: 14px 18px; border-radius: 8px; background: #26333f; color: #edf3f7; box-shadow: 0 12px 30px #14233333; line-height: 1.5; }

@keyframes login-arrive { from { transform: translateY(10px); opacity: .8; } to { transform: translateY(0); opacity: 1; } }
@keyframes earth-breathe {
  from { transform: scale(1.001); filter: brightness(.985) saturate(.99); }
  to { transform: scale(1.012); filter: brightness(1.015) saturate(1.015); }
}

@media (max-width: 700px) {
  #public-home .earth-cover { background-position: 54% center; }
  #public-home .login-trigger { bottom: 10.5%; width: 122px; min-height: 48px; }
  .cover-footer { bottom: 6px; font-size: 10px; }
  #login-dialog {
    width: calc(100vw - 36px);
    min-height: min(690px, calc(100dvh - 56px));
    margin: auto;
    border-radius: 24px;
  }
  #login-dialog form { padding: 32px 26px 34px; gap: 21px; }
  #login-dialog h1 { font-size: 25px; }
  #login-dialog .login-heading p { font-size: 14px; }
}

@media (max-height: 560px) {
  #public-home { min-height: 320px; }
  #public-home .login-trigger { bottom: 12%; min-height: 44px; }
  #login-dialog { min-height: 0; }
  #login-dialog form { padding-top: 24px; padding-bottom: 24px; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  #public-home *, #login-dialog { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
