/* Korevra SureDesk — live console: sign-in, invitation, and the network indicator.
   Motion is used to explain state, never to decorate. Every animation respects
   prefers-reduced-motion. */

/* ---------- network activity ---------- */
#busy {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 300;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 40% 100%; background-repeat: no-repeat;
  opacity: 0; transition: opacity .25s ease;
  animation: busy-sweep 1.1s linear infinite;
  pointer-events: none;
}
@keyframes busy-sweep {
  0% { background-position: -40% 0; }
  100% { background-position: 140% 0; }
}

/* ---------- authentication ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center;
  padding: 24px; position: relative; overflow: hidden;
  background: var(--paper);
}

.auth-art { position: absolute; inset: 0; pointer-events: none; }
.auth-grid {
  position: absolute; inset: -20%;
  background-image:
    linear-gradient(color-mix(in srgb, var(--navy) 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--navy) 7%, transparent) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 30%, transparent 75%);
  animation: grid-drift 46s linear infinite;
}
@keyframes grid-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(46px, 46px, 0); }
}

.auth-orb {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5;
  will-change: transform;
}
.auth-orb.o1 { width: 420px; height: 420px; background: var(--accent); top: -90px; left: -60px; animation: orb-a 22s ease-in-out infinite; }
.auth-orb.o2 { width: 360px; height: 360px; background: var(--gold); bottom: -110px; right: -40px; animation: orb-b 26s ease-in-out infinite; }
.auth-orb.o3 { width: 300px; height: 300px; background: var(--navy); top: 45%; right: 22%; opacity: .28; animation: orb-c 30s ease-in-out infinite; }
@keyframes orb-a { 50% { transform: translate3d(70px, 50px, 0) scale(1.12); } }
@keyframes orb-b { 50% { transform: translate3d(-60px, -40px, 0) scale(1.08); } }
@keyframes orb-c { 50% { transform: translate3d(-40px, 60px, 0) scale(1.15); } }

.auth-card {
  position: relative; width: 100%; max-width: 420px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 22px; padding: 30px 28px 24px;
  box-shadow: 0 30px 70px -30px rgba(13, 28, 46, .45), 0 1px 0 rgba(255, 255, 255, .5) inset;
  animation: card-in .6s cubic-bezier(.2, .8, .25, 1) both;
}
@keyframes card-in {
  from { opacity: 0; transform: translate3d(0, 18px, 0) scale(.98); }
}

.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-family: var(--display); margin-bottom: 20px; }
.auth-brand b { font-weight: 750; }
.auth-card h1 { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.auth-sub { color: var(--ink2); font-size: 13.5px; margin-top: 6px; margin-bottom: 18px; }
.auth-card label { margin-top: 14px; }
.auth-card input { padding: 11px 13px; border-radius: 11px; }
.auth-go { width: 100%; justify-content: center; margin-top: 20px; padding: 12px; font-size: 14.5px; border-radius: 11px; }
.auth-go:disabled { opacity: .7; }

.auth-error, .auth-note {
  font-size: 12.5px; border-radius: 10px; padding: 10px 12px; margin-bottom: 4px;
  animation: shake .4s ease;
}
.auth-error { background: var(--bad-soft); color: var(--bad); }
.auth-note { background: var(--accent-soft); color: var(--accent-ink); animation: none; }
@keyframes shake {
  25% { transform: translateX(-4px); } 75% { transform: translateX(4px); }
}

.auth-foot {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line2);
  font-size: 12.5px; color: var(--ink3);
}
.auth-foot a { color: var(--ink2); font-weight: 600; }
.auth-foot a:hover { color: var(--accent-ink); }

/* ---------- live chrome ---------- */
.live-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 20px;
  background: var(--good-soft); color: var(--good);
}
.live-chip::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse { 50% { opacity: .25; transform: scale(.8); } }

.pending { opacity: .6; }
.pending::after {
  content: " saving…"; font-size: 10px; font-style: italic; color: var(--ink3);
}

@media (prefers-reduced-motion: reduce) {
  .auth-grid, .auth-orb, .auth-card, .auth-error, .live-chip::before, #busy { animation: none !important; }
  #busy { background: var(--accent); background-size: 100% 100%; }
}
