html.auth-pending body { visibility: hidden; }
body.auth-locked { overflow: hidden; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  min-width: 320px;
  padding: 32px;
  overflow: auto;
  color: #0b1728;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(238, 246, 251, .9)),
    repeating-linear-gradient(90deg, transparent 0 71px, rgba(48, 103, 139, .035) 72px),
    #eef4f8;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
  isolation: isolate;
}

.auth-orb { position: absolute; z-index: -1; border-radius: 50%; filter: blur(1px); pointer-events: none; }
.auth-orb-one { width: 520px; height: 520px; top: -260px; right: -130px; background: radial-gradient(circle, rgba(10, 132, 255, .24), rgba(10, 132, 255, 0) 70%); }
.auth-orb-two { width: 460px; height: 460px; bottom: -250px; left: -90px; background: radial-gradient(circle, rgba(44, 199, 111, .14), rgba(44, 199, 111, 0) 72%); }

.auth-card {
  width: min(100%, 440px);
  padding: 34px 36px 28px;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(255, 255, 255, .98);
  border-radius: 30px;
  box-shadow: 0 32px 90px rgba(23, 57, 79, .16), 0 2px 12px rgba(23, 57, 79, .05);
  backdrop-filter: blur(24px) saturate(1.08);
  -webkit-backdrop-filter: blur(24px) saturate(1.08);
  animation: auth-card-in 420ms cubic-bezier(.2, .8, .2, 1) both;
}

.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand-mark { width: 42px; height: 42px; padding: 9px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; color: #fff; background: linear-gradient(145deg, #1d91ff, #355dcc); border-radius: 13px; box-shadow: 0 8px 22px rgba(10, 132, 255, .24); }
.auth-brand-mark i { width: 3px; display: block; background: currentColor; border-radius: 9px; }
.auth-brand-mark i:nth-child(1) { height: 11px; opacity: .72; }
.auth-brand-mark i:nth-child(2) { height: 20px; }
.auth-brand-mark i:nth-child(3) { height: 15px; opacity: .86; }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand strong { font-size: 18px; letter-spacing: -.02em; }
.auth-brand small { margin-top: -2px; color: #7a8997; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

.auth-intro { margin-top: 38px; }
.auth-kicker { color: #0a84ff; font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.auth-intro h1 { margin: 10px 0 8px; font-size: 36px; line-height: 1.12; letter-spacing: -.045em; }
.auth-intro p { margin: 0; color: #6a7987; font-size: 14px; }

.auth-form { margin-top: 30px; }
.auth-form > label { margin: 17px 0 8px; display: block; color: #445463; font-size: 12px; font-weight: 700; }
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-wrap input { width: 100%; height: 54px; padding: 0 58px 0 45px; color: #0b1728; background: #f6f9fb; border: 1px solid #dce6ed; border-radius: 15px; outline: none; transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease; }
.auth-input-wrap input:focus { background: #fff; border-color: #58a9f7; box-shadow: 0 0 0 4px rgba(10, 132, 255, .1); }
.auth-field-icon { position: absolute; left: 17px; z-index: 1; color: #7c8c99; font-size: 15px; font-weight: 700; pointer-events: none; }
.auth-lock { width: 13px; height: 11px; border: 1.8px solid currentColor; border-radius: 3px; }
.auth-lock::before { content: ""; position: absolute; width: 7px; height: 7px; left: 1px; top: -7px; border: 1.8px solid currentColor; border-bottom: 0; border-radius: 7px 7px 0 0; }
.auth-password-toggle { position: absolute; right: 8px; height: 38px; padding: 0 10px; color: #0a84ff; background: transparent; border: 0; border-radius: 10px; font-size: 12px; font-weight: 700; }
.auth-error { min-height: 21px; margin: 10px 2px 3px; color: #d93a32; font-size: 12px; }
.auth-submit { width: 100%; height: 56px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; color: #fff; background: linear-gradient(135deg, #168cff, #0876e8); border: 0; border-radius: 16px; box-shadow: 0 12px 26px rgba(10, 132, 255, .24); font-weight: 750; transition: transform 100ms ease, opacity 160ms ease, box-shadow 160ms ease; }
.auth-submit:hover { box-shadow: 0 15px 32px rgba(10, 132, 255, .3); }
.auth-submit:disabled { cursor: wait; opacity: .74; }
.auth-submit b { font-size: 20px; font-weight: 500; }
.auth-submit.is-loading b { animation: auth-loading 800ms ease-in-out infinite alternate; }
.auth-footer { margin-top: 25px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; color: #94a1ac; font-size: 10px; }
.auth-footer span { height: 1px; background: #e3ebf0; }
.auth-footer p { margin: 0; }
.auth-gate.is-success { animation: auth-gate-out 340ms ease both; }
.auth-card.is-shaking { animation: auth-shake 320ms ease; }

.auth-account { position: fixed; z-index: 9000; top: 17px; right: 160px; }
.auth-account-trigger { height: 42px; padding: 0 11px 0 5px; display: flex; align-items: center; gap: 8px; color: #344553; background: rgba(255, 255, 255, .88); border: 1px solid rgba(217, 228, 235, .9); border-radius: 99px; box-shadow: 0 7px 20px rgba(26, 57, 78, .08); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.auth-avatar, .auth-profile-avatar { display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #168cff, #355dcc); font-weight: 800; letter-spacing: -.04em; }
.auth-avatar { width: 32px; height: 32px; border-radius: 50%; font-size: 11px; }
.auth-account-name { font-size: 12px; font-weight: 750; }
.auth-caret { margin-top: -4px; color: #82919c; font-size: 15px; }
.auth-account-menu { position: absolute; top: 50px; right: 0; width: 245px; padding: 12px; background: rgba(255, 255, 255, .96); border: 1px solid #e0e9ef; border-radius: 20px; box-shadow: 0 22px 55px rgba(22, 51, 74, .17); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); animation: auth-menu-in 160ms ease both; }
.auth-account-profile { padding: 8px; display: flex; align-items: center; gap: 11px; }
.auth-profile-avatar { width: 40px; height: 40px; border-radius: 13px; font-size: 12px; }
.auth-account-profile strong, .auth-account-profile small { display: block; }
.auth-account-profile strong { font-size: 14px; }
.auth-account-profile small { color: #82919c; font-size: 10px; }
.auth-session-note { margin: 7px 4px 10px; padding: 10px 11px; color: #72818d; background: #f4f8fa; border-radius: 11px; font-size: 10px; }
.auth-cloud-row { margin: 7px 4px 10px; padding: 10px 11px; display: flex; align-items: center; gap: 8px; color: #557060; background: #eff9f3; border-radius: 11px; font-size: 10px; }
.auth-cloud-dot { width: 7px; height: 7px; background: #2cc76f; border-radius: 50%; box-shadow: 0 0 0 4px rgba(44, 199, 111, .12); }
.auth-cloud-row:has([data-tone="syncing"]) .auth-cloud-dot { background: #0a84ff; box-shadow: 0 0 0 4px rgba(10, 132, 255, .12); animation: auth-cloud-pulse 900ms ease infinite alternate; }
.auth-cloud-row:has([data-tone="error"]) { color: #9b5c22; background: #fff7e8; }
.auth-cloud-row:has([data-tone="error"]) .auth-cloud-dot { background: #ff9f0a; box-shadow: 0 0 0 4px rgba(255, 159, 10, .12); }
.auth-logout { width: 100%; height: 40px; color: #d83d36; background: #fff2f1; border: 0; border-radius: 11px; font-size: 12px; font-weight: 700; }

.auth-boot-card { min-height: 350px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.auth-boot-card .auth-brand { align-self: flex-start; }
.auth-boot-spinner { width: 62px; height: 62px; margin-top: 58px; padding: 5px; border: 1px solid #dce8ef; border-radius: 50%; }
.auth-boot-spinner span { width: 100%; height: 100%; display: block; border: 4px solid rgba(10, 132, 255, .13); border-top-color: #0a84ff; border-radius: 50%; animation: auth-spin 850ms linear infinite; }
.auth-boot-card h1 { margin: 25px 0 7px; font-size: 25px; letter-spacing: -.035em; }
.auth-boot-card > p { margin: 0; color: #7a8997; font-size: 12px; }

@keyframes auth-card-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes auth-menu-in { from { opacity: 0; transform: translateY(-5px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes auth-loading { to { transform: translateX(6px); } }
@keyframes auth-gate-out { to { opacity: 0; transform: scale(1.012); } }
@keyframes auth-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes auth-spin { to { transform: rotate(360deg); } }
@keyframes auth-cloud-pulse { to { opacity: .45; } }

@media (max-width: 720px) {
  .auth-gate { padding: 18px; align-items: center; }
  .auth-card { padding: 28px 24px 23px; border-radius: 25px; }
  .auth-intro { margin-top: 31px; }
  .auth-intro h1 { font-size: 32px; }
  .auth-account { top: 13px; right: 14px; }
  .auth-account-trigger { width: 40px; height: 40px; padding: 4px; }
  .auth-account-name, .auth-caret { display: none; }
  .auth-account-menu { top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card, .auth-account-menu, .auth-gate.is-success, .auth-card.is-shaking { animation: none; }
}
