/* ============================================================
 * QORDY Staff PIN Login — Apple & Awwwards Grade Minimal UX
 * Modern, cinematic glassmorphism with tactile haptics
 * ============================================================ */

:root {
  --login-bg: #07090e;
  --login-surface: rgba(15, 23, 42, 0.65);
  --login-border: rgba(255, 255, 255, 0.09);
  --login-border-hover: rgba(255, 255, 255, 0.22);
  --login-ink-primary: #f8fafc;
  --login-ink-secondary: #94a3b8;
  --login-ink-muted: #64748b;
  --login-accent: #6366f1;
  --login-accent-glow: rgba(99, 102, 241, 0.35);
  --login-key-bg: rgba(255, 255, 255, 0.045);
  --login-key-border: rgba(255, 255, 255, 0.07);
}

.q-staff-login,
.q-staff-login * {
  box-sizing: border-box;
}

.q-staff-login {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background-color: var(--login-bg);
  background-image: 
    radial-gradient(at 15% 15%, rgba(99, 102, 241, 0.14) 0px, transparent 45%),
    radial-gradient(at 85% 85%, rgba(139, 92, 246, 0.12) 0px, transparent 45%),
    radial-gradient(at 50% 50%, rgba(15, 23, 42, 0.85) 0px, transparent 100%);
  color: var(--login-ink-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display, "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Ambient dynamic background lighting */
.q-staff-login__bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.q-staff-login__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}

.q-staff-login__glow--1 {
  top: -8%;
  left: 20%;
  width: 32rem;
  height: 32rem;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, rgba(79, 70, 229, 0.04) 50%, transparent 70%);
  animation: glowFloat1 12s ease-in-out infinite alternate;
}

.q-staff-login__glow--2 {
  bottom: -8%;
  right: 18%;
  width: 30rem;
  height: 30rem;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.16) 0%, rgba(147, 51, 234, 0.03) 50%, transparent 70%);
  animation: glowFloat2 15s ease-in-out infinite alternate;
}

@keyframes glowFloat1 {
  0% { transform: translate(0, 0) scale(0.95); opacity: 0.6; }
  100% { transform: translate(40px, 30px) scale(1.1); opacity: 1; }
}

@keyframes glowFloat2 {
  0% { transform: translate(0, 0) scale(1); opacity: 0.7; }
  100% { transform: translate(-35px, -25px) scale(1.15); opacity: 1; }
}

.q-staff-login__main {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.25rem max(1.5rem, env(safe-area-inset-bottom));
}

.q-staff-login__card {
  width: 100%;
  max-width: 24.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--login-surface);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--login-border);
  border-radius: 2rem;
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  padding: 2.25rem 2rem 2rem;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

@media (max-width: 400px) {
  .q-staff-login__card {
    padding: 1.75rem 1.25rem 1.5rem;
    border-radius: 1.5rem;
  }
}

.q-staff-login__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.q-staff-login__logo-wrap {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 0.875rem;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.q-staff-login__logo-wrap:hover {
  transform: scale(1.05);
}

.q-staff-login__logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.q-staff-login__logo-fallback {
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.q-staff-login__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--login-ink-primary);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.q-staff-login__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 0.5rem;
}

.q-staff-login__badge-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: badgeDotPulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes badgeDotPulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.q-staff-login__badge-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(199, 210, 254, 0.5);
}

.q-staff-login__badge-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.04em;
}

.q-staff-login__hint {
  margin: 0.45rem 0 0;
  font-size: 0.8125rem;
  color: var(--login-ink-secondary);
  font-weight: 500;
}

/* Flash alerts */
.q-staff-login__flash {
  width: 100%;
  margin-top: 0.875rem;
}

.q-staff-login__flash-item {
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.q-text-status-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
}

.q-text-status-warning {
  background: rgba(245, 158, 11, 0.15) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  color: #fcd34d !important;
}

.q-text-status-success {
  background: rgba(34, 197, 94, 0.15) !important;
  border: 1px solid rgba(34, 197, 94, 0.35) !important;
  color: #86efac !important;
}

.q-text-status-info {
  background: rgba(99, 102, 241, 0.15) !important;
  border: 1px solid rgba(99, 102, 241, 0.35) !important;
  color: #c7d2fe !important;
}

/* PIN Dots */
.q-staff-login__pin-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  margin: 1.5rem 0 1.65rem;
}

.q-staff-login__pin-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.q-staff-login__pin-dot.is-filled {
  background: #ffffff;
  border-color: #ffffff;
  transform: scale(1.2);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.85), 0 0 30px rgba(99, 102, 241, 0.5);
}

.q-staff-login__card.is-submitting .q-staff-login__pin-dot {
  animation: dotPulse 0.8s ease-in-out infinite alternate;
}

@keyframes dotPulse {
  0% { opacity: 0.35; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1.2); }
}

/* Keypad */
.q-staff-login__keypad {
  display: grid;
  grid-template-columns: repeat(3, 4.85rem);
  justify-content: center;
  column-gap: 1.25rem;
  row-gap: 0.85rem;
  width: 100%;
}

@media (max-width: 360px) {
  .q-staff-login__keypad {
    grid-template-columns: repeat(3, 4.2rem);
    column-gap: 0.75rem;
    row-gap: 0.65rem;
  }
}

.q-staff-login__key {
  width: 4.85rem;
  height: 4.85rem;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--login-key-border);
  border-radius: 50%;
  background: var(--login-key-bg);
  color: var(--login-ink-primary);
  font-family: inherit;
  font-size: 1.95rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

@media (max-width: 360px) {
  .q-staff-login__key {
    width: 4.2rem;
    height: 4.2rem;
    font-size: 1.7rem;
  }
}

.q-staff-login__key:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--login-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.4), 0 0 12px rgba(99, 102, 241, 0.2);
}

.q-staff-login__key:active,
.q-staff-login__key.is-active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.q-staff-login__key--action {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--login-ink-secondary);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.q-staff-login__key--action:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: transparent;
  color: #ffffff;
  transform: none;
  box-shadow: none;
}

.q-staff-login__key--action:active,
.q-staff-login__key--action.is-active {
  opacity: 0.5;
  transform: scale(0.94);
  background: transparent;
}

.q-staff-login__key--action svg {
  width: 1.6rem;
  height: 1.25rem;
  stroke-width: 1.8;
  color: currentColor;
}

/* Security footer */
.q-staff-login__footer {
  margin-top: 1.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--login-ink-muted);
  letter-spacing: 0.02em;
}

.q-staff-login__footer svg {
  width: 0.875rem;
  height: 0.875rem;
  color: #22c55e;
}

/* Shake animation for errors */
.animate-shake {
  animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

.q-staff-login__card.is-submitting {
  pointer-events: none;
}

.q-staff-login__card.is-submitting .q-staff-login__keypad {
  opacity: 0.35;
  filter: blur(1px);
}
