@property --border-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #fff;
  background: #070319;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body { overflow-x: hidden; background: #070319; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }

.login-page { position: relative; min-height: 100svh; display: flex; flex-direction: column; align-items: center; overflow-x: hidden; overflow-y: auto; isolation: isolate; }
.motion-backdrop { position: absolute; inset: 0; z-index: -3; overflow: hidden; background: linear-gradient(145deg, #eee3fb, #b993df 52%, #513169); }
.hero-background { position: absolute; inset: -3%; width: 106%; height: 106%; object-fit: cover; object-position: center center; transform-origin: 50% 44%; filter: saturate(.82) contrast(.93) brightness(1.02); will-change: transform; animation: cameraJourney 18s cubic-bezier(.45,.05,.55,.95) infinite alternate; }
.purple-wash { position: absolute; inset: 0; background: linear-gradient(108deg, rgba(239,225,255,.66) 0%, rgba(211,176,242,.46) 36%, rgba(157,103,208,.34) 65%, rgba(72,36,100,.48) 100%); }
.purple-wash::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(255,255,255,.14), rgba(248,239,255,.05) 48%, rgba(42,18,64,.32)); mix-blend-mode: soft-light; }
.purple-wash::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 51% 18%, rgba(255,255,255,.54), transparent 31%), radial-gradient(circle at 83% 65%, rgba(210,176,255,.24), transparent 34%), linear-gradient(90deg, rgba(247,239,255,.12), transparent 56%, rgba(65,28,92,.12)); mix-blend-mode: screen; }
.dot-field { position: absolute; inset: 0; opacity: .14; background-image: radial-gradient(rgba(255,255,255,.75) .8px, transparent .8px); background-size: 30px 30px; mask-image: linear-gradient(to bottom, #000, transparent 72%); }

.login-nav { width: 100%; min-height: 84px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px; padding: 18px 48px; color: #140a22; animation: navIn .8s cubic-bezier(.22,1,.36,1) both; }
.login-brand { display: inline-flex; align-items: center; gap: 11px; justify-self: start; }
.login-brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: #090414; box-shadow: 0 12px 28px rgba(28,7,48,.22); font-size: 13px; font-weight: 850; }
.login-brand > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.login-brand b { font-size: 15px; letter-spacing: -.2px; }
.login-brand small { color: rgba(20,10,34,.52); font-size: 9px; text-transform: uppercase; letter-spacing: 1px; }
.login-nav-links { display: flex; align-items: center; gap: 34px; }
.login-nav-links a { position: relative; padding: 10px 0; color: rgba(20,10,34,.66); font-size: 13px; font-weight: 600; }
.login-nav-links a::after { content: ""; position: absolute; right: 0; bottom: 3px; left: 0; height: 1.5px; background: #140a22; transform: scaleX(0); transform-origin: left; transition: transform .3s cubic-bezier(.22,1,.36,1); }
.login-nav-links a:hover::after { transform: scaleX(1); }
.secure-entry { justify-self: end; display: inline-flex; align-items: center; gap: 9px; color: rgba(255,255,255,.72); font-size: 12px; }
.secure-entry i { width: 8px; height: 8px; border-radius: 50%; background: #80efbd; box-shadow: 0 0 0 5px rgba(128,239,189,.12); }

.login-hero { width: min(1100px, calc(100% - 48px)); padding: clamp(40px, 7vh, 86px) 0 46px; text-align: center; animation: heroIn 1s .14s cubic-bezier(.22,1,.36,1) both; }
.login-hero p, .access-intro p { margin: 0; color: rgba(20,10,34,.62); font-size: 10px; font-weight: 800; letter-spacing: 2.2px; }
.login-hero h1 { max-width: 900px; margin: 18px auto 0; color: #160b24; font-family: "Songti SC", "STSong", Georgia, serif; font-size: clamp(42px, 5.6vw, 76px); font-weight: 400; line-height: 1.08; letter-spacing: -2.8px; }
.login-hero > span { display: block; max-width: 640px; margin: 24px auto 0; color: rgba(20,10,34,.66); font-size: 14px; line-height: 1.8; }

.access-panel { width: min(1140px, calc(100% - 40px)); margin-top: auto; display: grid; grid-template-columns: minmax(0,1fr) minmax(360px,.82fr); gap: 44px 64px; padding: 38px 46px 0; color: #170d22; background: rgba(255,255,255,.91); border: 1px solid rgba(255,255,255,.72); border-bottom: 0; box-shadow: 0 -18px 60px rgba(28,7,48,.13); backdrop-filter: blur(18px); animation: panelIn 1s .3s cubic-bezier(.22,1,.36,1) both; }
.access-intro { align-self: end; padding-bottom: 4px; }
.access-intro p { color: rgba(23,13,34,.46); }
.access-intro h2 { margin: 11px 0 12px; font-family: "Songti SC", "STSong", Georgia, serif; font-size: clamp(26px, 3vw, 38px); font-weight: 400; line-height: 1.15; letter-spacing: -1px; }
.access-intro span { color: rgba(23,13,34,.62); font-size: 13px; line-height: 1.7; }

form { min-width: 0; }
.field-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
form label { display: grid; gap: 7px; }
form label span { color: rgba(23,13,34,.68); font-size: 11px; font-weight: 700; }
input { width: 100%; height: 46px; padding: 0 13px; border: 1px solid #ded2ec; border-radius: 11px; color: #170d22; background: rgba(248,244,252,.86); outline: 0; font: inherit; font-size: 13px; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
input::placeholder { color: #a599ae; }
input:focus { border-color: #a068ff; background: #fff; box-shadow: 0 0 0 4px rgba(160,104,255,.12); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 50px; }
.password-toggle { position: absolute; top: 50%; right: 5px; width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 9px; color: #806f8f; background: transparent; transform: translateY(-50%); }
.password-toggle:hover { color: #6d32af; background: rgba(160,104,255,.1); transform: translateY(-50%); }
.password-toggle:focus-visible { outline: 3px solid rgba(160,104,255,.2); outline-offset: 1px; }
.password-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-icon-hide { display: none; }
.password-toggle[aria-pressed="true"] .password-icon-show { display: none; }
.password-toggle[aria-pressed="true"] .password-icon-hide { display: block; }
.login-error { min-height: 18px; margin: 7px 0 5px; color: #c34361; font-size: 11px; }
.login-error.is-success { color: #267f61; }
.login-border-wrap { --border-angle: 0deg; height: 48px; padding: 2px; display: block; border-radius: 999px; background: conic-gradient(from var(--border-angle), #a068ff, #130922, #dfb7ff, #7130cf, #130922, #a068ff); animation: borderOrbit 3s linear infinite; }
button { width: 100%; height: 100%; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: inherit; color: #fff; background: #090414; cursor: pointer; font: inherit; font-size: 13px; font-weight: 750; transition: background .3s ease, transform .3s cubic-bezier(.22,1,.36,1); }
button b { font-size: 19px; font-weight: 400; transition: transform .3s cubic-bezier(.22,1,.36,1); }
button:hover { background: #3b1764; transform: translateY(-1px); }
button:hover b { transform: translateX(4px); }
button:disabled { cursor: wait; opacity: .65; }
form footer { margin-top: 8px; color: #8a7f92; font-size: 10px; text-align: center; }
.register-link { width: auto; height: auto; margin-left: 5px; padding: 4px 2px; display: inline-flex; gap: 5px; color: #6c35ae; background: transparent; border-radius: 0; font-size: 10px; vertical-align: middle; }
.register-link b { font-size: 11px; }
.register-link:hover { color: #3b1764; background: transparent; transform: none; }

.register-dialog { width: min(780px, calc(100% - 32px)); max-height: calc(100svh - 34px); padding: 0; overflow: auto; border: 1px solid rgba(255,255,255,.72); border-radius: 24px; color: #170d22; background: rgba(251,248,253,.97); box-shadow: 0 36px 100px rgba(25,7,45,.35); backdrop-filter: blur(26px); }
.register-dialog::backdrop { background: rgba(10,4,20,.58); backdrop-filter: blur(9px); }
.register-dialog[open] { animation: dialogIn .45s cubic-bezier(.22,1,.36,1) both; }
.register-shell { padding: 30px; }
.register-shell > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid #e8deef; }
.register-shell > header p { margin: 0 0 8px; color: #806a91; font-size: 9px; font-weight: 800; letter-spacing: 2px; }
.register-shell > header h2 { margin: 0; font-family: "Songti SC", "STSong", Georgia, serif; font-size: 30px; font-weight: 400; }
.register-shell > header span { display: block; margin-top: 8px; color: #756a7e; font-size: 12px; }
.dialog-close { width: 38px; min-width: 38px; height: 38px; padding: 0; justify-content: center; color: #4a3856; background: #eee5f4; border-radius: 50%; font-size: 22px; font-weight: 400; }
.dialog-close:hover { color: #fff; background: #3b1764; }
#registerForm { padding-top: 22px; }
.register-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.permission-options { margin: 20px 0 0; padding: 0; border: 0; }
.permission-options legend { margin-bottom: 10px; color: #55445f; font-size: 11px; font-weight: 800; }
.permission-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.permission-options legend { grid-column: 1 / -1; }
.permission-options label { position: relative; min-height: 88px; padding: 14px; display: block; border: 1px solid #e0d4e9; border-radius: 13px; background: #fff; cursor: pointer; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.permission-options label:hover { transform: translateY(-2px); border-color: #b890e4; }
.permission-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.permission-options label:has(input:checked) { border-color: #9c5de5; box-shadow: 0 0 0 3px rgba(160,104,255,.1); background: #fbf8ff; }
.permission-options label:has(input:checked)::after { content: "\2713"; position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #8e49dc; font-size: 11px; }
.permission-options span { display: block; padding-right: 19px; }
.permission-options b { display: block; color: #24132f; font-size: 12px; }
.permission-options small { display: block; margin-top: 7px; color: #7f7189; font-size: 10px; line-height: 1.55; }
.register-message { min-height: 20px; margin: 14px 0 8px; color: #bd4260; font-size: 11px; }
.register-message.is-success { color: #267f61; }
.register-submit { height: 50px; border-radius: 999px; }
.admin-setup-dialog { border-color: rgba(179,119,245,.72); }
.setup-security-note { margin: 18px 0 0; padding: 13px 15px; display: flex; align-items: center; gap: 12px; border: 1px solid #e4d5f1; border-radius: 12px; color: #654976; background: #f5edfb; }
.setup-security-note b { white-space: nowrap; font-size: 11px; }
.setup-security-note span { color: #7c6a87; font-size: 10px; line-height: 1.55; }
.admin-setup-submit { background: linear-gradient(135deg,#321052,#7934ca); }
@keyframes dialogIn { from { opacity: 0; transform: translateY(22px) scale(.97); } }

.capability-row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3,1fr); gap: 3px; padding-top: 22px; border-top: 1px solid #e7dfef; }
.capability-row article { min-height: 54px; padding: 0 18px; display: flex; align-items: center; gap: 10px; background: #f4eff8; cursor: default; transition: background .2s ease; }
.capability-row article:hover { background: #ece2f5; }
.capability-row span { color: #9a8ca5; font-size: 11px; }
.capability-row i { margin-left: 5px; color: #c0b3c9; font-style: normal; }
.capability-row b { font-size: 12px; }
.capability-row em { margin-left: auto; color: #9a8ca5; font-size: 16px; font-style: normal; transition: transform .2s ease, color .2s ease; }
.capability-row article:hover em { color: #6e35bd; transform: translateX(3px); }

.compliance-footer { width: 100%; min-height: 40px; padding: 10px 18px; display: flex; align-items: center; justify-content: center; gap: 16px; flex: 0 0 auto; color: rgba(255,255,255,.72); background: rgba(8,3,17,.9); border-top: 1px solid rgba(255,255,255,.12); font-size: 11px; line-height: 1.4; backdrop-filter: blur(16px); }
.compliance-footer a { display: inline-flex; align-items: center; gap: 7px; transition: color .2s ease, transform .2s ease; }
.compliance-footer a:hover { color: #fff; transform: translateY(-1px); }
.compliance-footer img { width: 18px; height: 18px; object-fit: contain; flex: 0 0 auto; }
.compliance-divider { width: 1px; height: 16px; background: rgba(255,255,255,.2); }

@keyframes borderOrbit { to { --border-angle: 360deg; } }
@keyframes cameraJourney {
  0% { transform: scale(1.08) translate3d(-1.4%, -.5%, 0); }
  42% { transform: scale(1.13) translate3d(1.3%, -1.8%, 0); }
  72% { transform: scale(1.16) translate3d(.3%, -.2%, 0); }
  100% { transform: scale(1.11) translate3d(-1%, 1.2%, 0); }
}
@keyframes navIn { from { opacity: 0; transform: translateY(-18px); } }
@keyframes heroIn { from { opacity: 0; transform: translateY(30px); } }
@keyframes panelIn { from { opacity: 0; transform: translateY(54px); } }

@media (max-height: 760px) and (min-width: 761px) {
  .login-hero { padding-top: 24px; padding-bottom: 24px; }
  .login-hero h1 { font-size: clamp(38px, 4.8vw, 58px); }
  .login-hero > span { margin-top: 16px; }
  .access-panel { padding-top: 28px; }
}

@media (max-width: 820px) {
  .login-page { min-height: 100vh; overflow: auto; }
  .hero-background { object-position: 47% center; animation-duration: 22s; }
  .login-nav { min-height: 72px; grid-template-columns: 1fr auto; padding: 14px 20px; }
  .login-nav-links { display: none; }
  .login-hero { width: calc(100% - 36px); padding: 54px 0 60px; }
  .login-hero h1 { font-size: clamp(36px, 10vw, 52px); letter-spacing: -1.5px; }
  .access-panel { width: calc(100% - 24px); grid-template-columns: 1fr; gap: 24px; padding: 30px 24px 0; }
  .access-intro { text-align: center; }
  .capability-row { grid-template-columns: 1fr; }
  .permission-options { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .login-brand small, .secure-entry { display: none; }
  .login-hero { padding-top: 42px; }
  .login-hero > span { font-size: 13px; }
  .access-panel { padding-inline: 18px; }
  .field-row { grid-template-columns: 1fr; }
  .register-shell { padding: 22px 18px; }
  .register-shell > header h2 { font-size: 25px; }
  .register-fields { grid-template-columns: 1fr; }
  .compliance-footer { padding-block: 9px; flex-direction: column; gap: 7px; }
  .compliance-divider { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hero-background { animation: none !important; transform: scale(1.08); }
}
